[asterisk-dev] Strangeness modifying EXTEN
Philip Prindeville
philipp_subx at redfish-solutions.com
Fri Nov 20 18:51:29 CST 2009
[outbound-freenum]
exten => _**X.*X.,1,NoOp(EXTEN ${EXTEN})
exten => _**X.*X.,n,Set(TIMEOUT(absolute)=10800)
; drop prefix
exten => _**X.*X.,n,Set(EXTEN=${EXTEN:2})
exten => _**X.*X.,n,NoOp(Number to Call: ${EXTEN})
exten => _**X.*X.,n,Set(isnresult=${ENUMLOOKUP(${EXTEN},sip,,1,freenum.org)})
exten => _**X.*X.,n,GotoIf($["${isnresult}"!=""]?:notfound)
exten => _**X.*X.,n,Dial(SIP/${isnresult},40,r)
exten => _**X.*X.,n(notfound),Background(ss-noservice)
exten => _**X.*X.,n,Congestion
exten => _**X.*X.,n,Hangup
Ok, so trying it...
pbx*CLI>
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Executing [**102*1122 at redfish-internal:1] NoOp("SIP/office_1-084b7a18", "EXTEN **102*1122") in new stack
-- Executing [**102*1122 at redfish-internal:2] Set("SIP/office_1-084b7a18", "TIMEOUT(absolute)=10800") in new stack
Channel will hangup at 2009-11-20 20:34:24.698 ???.
-- Executing [**102*1122 at redfish-internal:3] Set("SIP/office_1-084b7a18", "EXTEN=102*1122") in new stack
-- Executing [**102*1122 at redfish-internal:4] NoOp("SIP/office_1-084b7a18", "Number to Call: **102*1122") in new stack
== ast_get_enum(num='**102*1122', tech='sip', suffix='freenum.org', options='', record=1
== ENUM options(): pos=1, options='2'
== ISN ENUM: left=, middle='*102*1122.'
== ast_get_enum() profiling: FAIL, *102*1122.freenum.org, 53 ms
-- Executing [**102*1122 at redfish-internal:5] Set("SIP/office_1-084b7a18", "isnresult=") in new stack
-- Executing [**102*1122 at redfish-internal:6] GotoIf("SIP/office_1-084b7a18", "0?:notfound") in new stack
-- Goto (redfish-internal,**102*1122,8)
-- Executing [**102*1122 at redfish-internal:8] BackGround("SIP/office_1-084b7a18", "ss-noservice") in new stack
-- <SIP/office_1-084b7a18> Playing 'ss-noservice.ulaw' (language 'en')
pbx*CLI>
So we do the:
Set(EXTEN=${EXTEN:2})
which results in:
-- Executing [**102*1122 at redfish-internal:3] Set("SIP/office_1-084b7a18", "EXTEN=102*1122") in new stack
ok, fine... then on the next line:
exten => _**X.*X.,n,NoOp(Number to Call: ${EXTEN})
results in:
-- Executing [**102*1122 at redfish-internal:4] NoOp("SIP/office_1-084b7a18", "Number to Call: **102*1122") in new stack
WTF????
Why didn't ${EXTEN} get updated? Why is it acting like it's read-only?
More information about the asterisk-dev
mailing list