[Home]

Summary:ASTERISK-20113: ParkAndAnnounce doesn't return to n+1 when no return_context defined
Reporter:serginuez (serginuez)Labels:
Date Opened:2012-07-10 04:45:24Date Closed:2013-02-24 09:44:18.000-0600
Priority:MinorRegression?
Status:Closed/CompleteComponents:Applications/app_parkandannounce
Versions:10.5.1 Frequency of
Occurrence
Constant
Related
Issues:
Environment:debian sidAttachments:( 0) app_parkandannounce.diff
Description:As shown in the logs below, when ParkAndAnnounce returns after the timeout, if no return_context is defined, instead of returning to n+1 it goes back to itself (n). When a label is specified, it works as intended.

   -- Executing [125@intern:1] Answer("SIP/124-00000000", "") in new stack
   -- Executing [125@intern:2] ParkAndAnnounce("SIP/124-00000000", "pbx-transfer:PARKED,60,SIP/123") in new stack
   -- Dial Tech,String: (SIP,123)
   -- Return Context: (intern,125,2) ID: 124
   -- Started music on hold, class 'default', on SIP/124-00000000
 == Parked SIP/124-00000000 on 701 (lot default). Will timeout back to extension [intern] 125, 2 in 60 seconds
   -- Added extension '701' priority 1 to parkedcalls
   -- Call parked in space: 701, timeout: 60000, return-context:
 == Using SIP RTP CoS mark 5
   -- <SIP/123-00000001> Playing 'pbx-transfer.ulaw' (language 'es')
   -- <SIP/123-00000001> Playing 'digits/7.ulaw' (language 'es')
   -- <SIP/123-00000001> Playing 'digits/0.ulaw' (language 'es')
   -- <SIP/123-00000001> Playing 'digits/1.ulaw' (language 'es')
   -- Stopped music on hold on SIP/124-00000000
 == Timeout for SIP/124-00000000 parked on 701 (default). Returning to intern,125,2
   -- Executing [125@intern:2] ParkAndAnnounce("SIP/124-00000000", "pbx-transfer:PARKED,60,SIP/123") in new stack
   -- Dial Tech,String: (SIP,123)
   -- Return Context: (intern,125,2) ID: 124
   -- Started music on hold, class 'default', on SIP/124-00000000
 == Parked SIP/124-00000000 on 701 (lot default). Will timeout back to extension [intern] 125, 2 in 60 seconds
   -- Added extension '701' priority 1 to parkedcalls
   -- Call parked in space: 701, timeout: 60000, return-context:
 == Using SIP RTP CoS mark 5
   -- <SIP/123-00000002> Playing 'pbx-transfer.ulaw' (language 'es')
   -- <SIP/123-00000002> Playing 'digits/7.ulaw' (language 'es')
   -- <SIP/123-00000002> Playing 'digits/0.ulaw' (language 'es')
   -- <SIP/123-00000002> Playing 'digits/1.ulaw' (language 'es')
   -- Stopped music on hold on SIP/124-00000000
 == SIP/124-00000000 got tired of being parked
Comments:By: serginuez (serginuez) 2012-07-14 05:23:22.064-0500

looking at the source code, I don't know if this is the proper way to fix the behaviour but seems to work for me. It return_context is not provided in the dialplan, instead of returning to n, we add 1 to priority to return to n+1 as described in the app documentation.