[asterisk-dev] Bug in ${EXTEN} handling in asterisk 1.2.18?

Eric "ManxPower" Wieling eric at fnords.org
Fri Jun 15 10:02:08 CDT 2007


You can't goto an extension beginning with _

_ is used for pattern matches in the extension number.

i.e.

exten => _6XX,1,Whatever ; valid

exten => 997,1,Goto(666,1) ; valid

exten => 999,1,Goto(_6XX,1) ; NOT valid

exten => 998,1,Goto(_666,1); NOT valid

Kegan Holtzhausen wrote:
> I am trying to set _ALERT_INFO based on my from phone number for a
> test for changing ring-tones based on type of call.
> 
> What appears to happen is ${EXTEN} in the first noop contains the
> number I dialed, but at the last step when I hand control over to my
> Macro(transferReturn_sipdial) the EXTEN variable appears to have
> changed to the
> SIP_EXTENS_0 variable.
> 
> In my extensions.conf I have:
> Defined a global variable:
> SIP_EXTENS_0=_7603
> 
> and in my local_extensions context I have this:
> exten => ${SIP_EXTENS_0},1,NoOp("Internal Call to ${EXTEN} from ${CALLERIDNUM}")
> exten => ${SIP_EXTENS_0},2,GotoIf($["${CALLERIDNUM}" =
> "7602"]?${SIP_EXTENS_0},5)
> exten => ${SIP_EXTENS_0},3,Goto(${SIP_EXTENS_0},10)
> exten => ${SIP_EXTENS_0},5,Set(_ALERT_INFO=http://10.116.4.8/ringtones/darth1.wav)
> exten => ${SIP_EXTENS_0},6,Goto(${SIP_EXTENS_0},10)
> exten => ${SIP_EXTENS_0},10,noop(ready to connect to extension ${EXTEN})
> exten => ${SIP_EXTENS_0},11,Macro(transferReturn_sipdial,${EXTEN},20,${SWITCHBOARD})
> 
> In the CLI I have the following messages:
> 
>     -- Executing NoOp("SIP/7602-b7b00ce8", ""Internal Call to 7603
> from 7602"") in new stack
>     -- SIP Seeding peer from astdb: '7602' at 7602 at 10.116.81.6:2051 for 3600
>     -- Executing GotoIf("SIP/7602-b7b00ce8", "1?_76XX|5") in new stack
>     -- Goto (from-sip,_76XX,5)
>     -- Executing Set("SIP/7602-b7b00ce8",
> "_ALERT_INFO=http://10.116.4.8/ringtones/darth1.wav") in new stack
>     -- Executing Goto("SIP/7602-b7b00ce8", "_76XX|10") in new stack
>     -- Goto (from-sip,_76XX,10)
>     -- Executing NoOp("SIP/7602-b7b00ce8", "ready to connect to
> extension _76XX") in new stack
>     -- Executing Macro("SIP/7602-b7b00ce8",
> "transferReturn_sipdial|76XX|20|8901") in new stack
>     -- Executing GotoIf("SIP/7602-b7b00ce8", "0?s|20") in new stack
>     -- Executing GotoIf("SIP/7602-b7b00ce8", "0?s|20") in new stack
>     -- Executing Set("SIP/7602-b7b00ce8", "pointer=1") in new stack
>     -- Executing Set("SIP/7602-b7b00ce8", "called1=76XX") in new stack
>     -- Executing Set("SIP/7602-b7b00ce8", "called2=0") in new stack
>     -- Executing Dial("SIP/7602-b7b00ce8", "SIP/76XX|20") in new stack
> Jun 15 14:33:14 WARNING[26896]: chan_sip.c:1995 create_addr: No such host: 76XX
> Jun 15 14:33:14 NOTICE[26896]: app_dial.c:1089 dial_exec_full: Unable
> to create channel of type 'SIP' (cause 3 - No route to destination)
>   == Everyone is busy/congested at this time (1:0/0/1)
>     -- Executing Goto("SIP/7602-b7b00ce8", "s-CHANUNAVAIL|1") in new stack
>     -- Goto (macro-transferReturn_sipdial,s-CHANUNAVAIL,1)
>     -- Executing VoiceMail("SIP/7602-b7b00ce8", "76XX|ju") in new stack
>     -- SIP Seeding peer from astdb: '7602' at 7602 at 10.116.81.6:2051 for 3600
> Jun 15 14:33:14 WARNING[26896]: app_voicemail.c:2461 leave_voicemail:
> No entry in voicemail config file for '76XX'
>     -- Executing Playback("SIP/7602-b7b00ce8", "invalid") in new stack
>     -- Playing 'invalid' (language 'en')
>   == Spawn extension (macro-transferReturn_sipdial, s-CHANUNAVAIL,
> 102) exited non-zero on 'SIP/7602-b7b00ce8' in macro
> 'transferReturn_sipdial'
>   == Spawn extension (macro-transferReturn_sipdial, s-CHANUNAVAIL,
> 102) exited non-zero on 'SIP/7602-b7b00
> 
> 
> Is this something stupid im doing or is it a bug?
> 
> 




More information about the asterisk-dev mailing list