Summary:ASTERISK-04359: app_dial matches incorrect extension when exiting "Unable to create channel of type 'SIP'"
Reporter:alexb (alexb)Labels:
Date Opened:2005-06-06 09:50:56Date Closed:2011-06-07 14:03:24
Versions:Frequency of
Description:When app_dial is "Unable to create channel of type 'SIP'" because of busy/congestion, it should jump to ext. n+101.

I think app_dial doesn't show the correct behaviour when exiting in the following situation:

exten => s,1,NoOp(${CALLERID})
exten => s,2,DBGet(temp=PBX/OFF)
exten => s,103,Goto(13)
exten => s,3,DBGet(temp=PBX/VM)
exten => s,104,Hangup          ; Note there's prio 104 for ext. ${CID} !!!
exten => s,4,etc.

exten => s/_00.,1,NoOp(${CALLERID})   ; International calls -> languages-skilled beautiful young girl ;)
exten => s/_00.,2,SetLanguage(en)
exten => s/_00.,3,Dial(SIP/212,20)    ; what should happen if 212 is off
exten => s/_00.,4,Goto(centralino,1)

exten => centralino,1,Dial(${TRUNK2SIP})
exten => centralino,2,Hangup

   -- Executing NoOp("mISDN/1/34********-1", "34********") in new stack
   -- Executing SetLanguage("mISDN/1/34********-1", "en") in new stack
   -- Executing Dial("mISDN/1/34********-1", "SIP/212|20") in new stack
Jun  6 16:27:54 NOTICE[9827]: app_dial.c:969 dial_exec_full: Unable to create channel of type 'SIP' (cause 3)
 == Everyone is busy/congested at this time (1:0/1/0)
   -- Executing Hangup("mISDN/1/34********-1", "") in new stack     ** SEE BELOW **
 == Spawn extension (pstn-in, s, 104) exited non-zero on 'mISDN/1/348*******-1'

The Hangup is due to prio s,104. Since there's no prio s/_00.,104
I believe that it should have gone to prio s/_00.,4 instead. Indeed, I think it doesn't match the right extension.
Comments:By: Michael Jerris (mikej) 2005-06-06 10:17:44

This is because matching is done to the best match at each priority.  The extension is s, and it is looking for a 104.. and it found one.  If you want it to behave how you are intending it too, make s,1, and s/_00.,1 goto's.  This behavior is by design.