James B. Byrne
2013-Jul-03 18:24 UTC
[asterisk-users] Custom dial plan for internal transfers of external calls
Arch = x86_64
OS = CentOS-6.4 (freepbx)
Asterisk = 11.4.0
FreePBX = 2.11.0.2
We use Snom870 handsets with firmware v.8.7.3.19.
I am trying to develop a custom dial plan to invoke a distinctive
ring-tone when an external call is transferred internally. Based on
an earlier solution I discovered I am attempting this:
[from-internal]
include => set-alert-if-local
[from-internal-original]
include => from-internal-xfer
include => bad-number
[set-alert-if-local]
. . .
exten => _417XX,n,GotoIf($["${CALLERID(num)}" >
"SIP/41799"]?notfromlocal)
exten => _417XX,n,GotoIf($["${CALLERID(num)}" <
"SIP/41710"]?notfromlocal)
;If we reach here then the caller is within the upper and lower bounds
exten => _417XX,n,Set(__ALERT_INFO=${AlertSnom}${AlertInternalTransfer})
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 context appears to be entered only when the call originates from
another extension. When a transfer of an external call is attempted
theis context does not seem to be entered.
The following abstracted asterisk trace log shows this for an incoming
call answered on 41712 and then transferred to 41720.
-- SIP/41711-00000165 is ringing
-- SIP/41713-00000167 is ringing
-- SIP/41712-00000166 is ringing
-- SIP/41720-00000169 is ringing
-- SIP/41718-00000168 is ringing
== Extension Changed 41712[ext-local] new state InUse for Notify
User 41710
== Extension Changed 41712[ext-local] new state InUse for Notify
User 41711
-- SIP/41712-00000166 connected line has changed. Saving it until
answer for DAHDI/1-1
-- SIP/41712-00000166 answered DAHDI/1-1
== Extension Changed 41712[ext-local] new state InUse for Notify
User 41715
== Extension Changed 41712[ext-local] new state InUse for Notify
User 41717
== Extension Changed 41712[ext-local] new state InUse for Notify
User 41718
-- Executing [s at macro-auto-blkvm:1] Set("SIP/41712-00000166",
"__MACRO_RESULT=") in new stack
-- Executing [s at macro-auto-blkvm:2] Macro("SIP/41712-00000166",
"blkvm-clr,") in new stack
At this point the original incoming call is answered.
. . .
-- Executing [s at macro-auto-blkvm:3]
ExecIf("SIP/41712-00000166",
"0?Set(MASTER_CHANNEL(CONNECTEDLINE(num))=41712)") in new stack
And then transferred to 41720
[2013-07-03 13:43:03] WARNING[7954][C-00004685]: res_srtp.c:406
ast_srtp_unprotect: SRTP unprotect failed with: authentication failure
110
-- Stopped music on hold on DAHDI/1-1
== Extension Changed 41712[ext-local] new state Idle for Notify User
41710
== Extension Changed 41712[ext-local] new state Idle for Notify User
41711
== Extension Changed 41712[ext-local] new state Idle for Notify User
41715
== Spawn extension (from-internal-xfer, 41720, 1) exited non-zero on
'DAHDI/1-1' in macro 'dial'
== Spawn extension (from-internal-xfer, 41720, 1) exited non-zero on
'DAHDI/1-1'
-- Executing [41720 at from-internal-xfer:1] Set("DAHDI/1-1",
"__RINGTIMER=20") in new stack
And finally answered on 41720
[2013-07-03 13:43:16] DEBUG[29747][C-00004685]: sip/sdp_crypto.c:310
sdp_crypto_offer: Crypto line: a=crypto:1 AES_CM_128_HMAC_SHA1_80
inline:5D038u88tI6PLyruDovyQIku9PH7exEAL3Qolc9m
== Extension Changed 41720[ext-local] new state InUse for Notify
User 41711
== Extension Changed 41720[ext-local] new state InUse for Notify
User 41715
-- SIP/41720-0000016a answered DAHDI/1-1
It is evident from the trace that the context [set-alert-if-local] is
not entered on internal transfers and I lack the experience to
understand why. Can someone here enlighten me as to what is going on
in this instance and how I should change my contexts in order to check
for internal transfers of external calls?
--
*** E-Mail is NOT a SECURE channel ***
James B. Byrne mailto:ByrneJB at Harte-Lyne.ca
Harte & Lyne Limited http://www.harte-lyne.ca
9 Brockley Drive vox: +1 905 561 1241
Hamilton, Ontario fax: +1 905 561 0757
Canada L8E 3C3
Rusty Newton
2013-Jul-05 21:06 UTC
[asterisk-users] Custom dial plan for internal transfers of external calls
On Wed, Jul 3, 2013 at 1:24 PM, James B. Byrne <byrnejb at harte-lyne.ca>wrote:> > It is evident from the trace that the context [set-alert-if-local] is > not entered on internal transfers and I lack the experience to > understand why. Can someone here enlighten me as to what is going on > in this instance and how I should change my contexts in order to check > for internal transfers of external calls? > >Without complete log of the calls involved, and no DEBUG type messages it's a little hard to tell exactly whats going on. Upon initiating a SIP transfer, Asterisk should look for the extension dialed in the context of the peer/user that initiated the transfer. Look at the SIP configuration for the peer/user doing the transfer, look at the context configured for it and see if that context includes the context you are wanting execution to happen in. If that still doesn't answer the problem, then turn up DEBUG messages to level 5 and see where the call is going at the moment of transfer. -- Rusty Newton Digium, Inc. | Community Support Manager445 Jan Davis Drive NW - Huntsville, AL 35806 - US Check us out at: http://digium.com & http://asterisk.org -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20130705/08777f85/attachment.htm>