Arch = x86_64
OS = CentOS-6.4 (freepbx)
Asterisk = 11.4.0
FreePBX = 2.11.0.2
I am trying to implement a distinctive ringtone for internal calls and I am following the guide provided below.
The code of interest is this:
ALERTINTEXT => alert-internal ;You can use the following comparison operators in these lines: = != < > <= >= ;To use pattern matching preface the target extension values with _ exten => _417XX,1,GotoIf($["${CALLERID(num)}" > 41799]?notfromlocal) exten => _417XX,n,GotoIf($["${CALLERID(num)}" < 41700]?notfromlocal) ;If we reach here then the caller is within the upper and lower bounds exten => _417XX,n,Set(__ALERT_INFO=${ALERTINTEXT}) exten => _417XX,n(notfromlocal),Goto(from-internal-original,${EXTEN},1) ;The following three lines must not be changed! exten => _.,1,Goto(from-internal-original,${EXTEN},1) exten => s,1,Goto(from-internal-original,s,1) exten => h,1,Macro(hangupcall)
This does not seem to work in Asterisk 11. When I put this code in /etc/asterisk/extensions_override_freepbx.conf, modified for my own situation, I see this when an extension is called internally.
-- Executing [41712@from-internal:1] GotoIf("SIP/41714-00000003", "0?notfromlocal") in new stack -- Executing [41712@from-internal:2] GotoIf("SIP/41714-00000003", "1?notfromlocal") in new stack -- Goto (from-internal,41712,4) -- Executing [41712@from-internal:4] Goto("SIP/41714-00000003", "from-internal-original,41712,1") in new stack -- Goto (from-internal-original,41712,1) -- Executing [41712@from-internal-original:1] Set("SIP/41714-00000003", "__RINGTIMER=20") in new stack -- Executing [41712@from-internal-original:2] Macro("SIP/41714-00000003", "exten-vm,41712,41712,0,0,0") in new stack
Now, I have zero experience programming asterisk configs however, it seems to me that:
-- Executing [41712@from-internal:1] GotoIf("SIP/41714-00000003", "0?notfromlocal") in new stack
is this line:
exten => _417XX,1,GotoIf($["${CALLERID(num)}" > 41799]?notfromlocal)
and
-- Executing [41712@from-internal:2] GotoIf("SIP/41714-00000003", "1?notfromlocal") in new stack -- Goto (from-internal,41712,4)
is this line
exten => _417XX,n,GotoIf($["${CALLERID(num)}" < 41700]?notfromlocal)
And it appears that this
-- Executing [41712@from-internal:4] Goto("SIP/41714-00000003", "from-internal-original,41712,1") in new stack
is this line:
exten => _417XX,n(notfromlocal),Goto(from-internal-original,${EXTEN},1)
it is readily apparent that “SIP/41714-00000003” is not comparing well with either 41700 or 41799 and so we branching to this line:
exten => _417XX,n(notfromlocal),Goto(from-internal-original,${EXTEN},1)
The questions are: How should I construct the comparison values to work in this situation. How much of “SIP/41714-00000003” changes besides the extension number?