[asterisk-users] Dial plan flow control

James B. Byrne byrnejb at harte-lyne.ca
Fri Jul 26 08:05:32 CDT 2013


Arch = x86_64
OS = CentOS-6.4 (freepbx)
Asterisk = 11.4
FreePBX = 2.11.0.4

I am trying to understand flow control in Asterisk dial plans and not
having very much luck.  I have read the Asterisk book from O'Rielly,
or at least those parts I believe might apply, but that has not helped
me much on this particular issue.

What I wish is to set three distinct ring tones on our Snom phones for
external, internal and transferred calls.  The first is accomplished
simply enough by setting the ALERT_INFO setting on the inbound route
for all phones. Done.

The second was much more complicated but I found a recipe which
demonstrated how to do that using extensions_override_freepbx.conf and
eventually got it working.   Done.

However, in my ignorance I believed that I could use the same
technique, indeed the same code, to check whether the call was
internal or a transfer.  In this belief I appear sadly mistaken.

So, I am left with trying to understand the nature of flow control in
Asterisk dial plans and specifically those distributed with FreePBX.

In FreePBX I see this in extensions.conf:

;---------------------------------------------------------------------
; from-internal:
;
; Internal dialplan that most internal phones have access to
;
[from-internal]
include => from-internal-noxfer
include => from-internal-xfer
include => bad-number ; auto-generated
;---------------------------------------------------------------------

;---------------------------------------------------------------------
; from-internal-noxfer:
;
; Place to put internal dialplan that should not be accessible during
; a blind transfer, this context will not be visible during such.
;
[from-internal-noxfer]
include => from-internal-noxfer-custom
include => from-internal-noxfer-additional ; auto-generated
;---------------------------------------------------------------------

;---------------------------------------------------------------------
; from-internal-xfer:
;
; Place to put most internal dialplan, will be visible during
: normal calls and blind transfers.
;
[from-internal-xfer]
include => from-internal-custom
include => from-internal-additional ; auto-generated
exten => s,1,Macro(hangupcall)
exten => h,1,Macro(hangupcall)
;---------------------------------------------------------------------


What I would like to do is to add checks for whether or not a call is
internal or transferred between extensions in the
[from-internal-custom] context, which is presumably best placed in the
file named /etc/asterisk/extensions_custom.conf.  To begin testing I
did this

[from-internal-custom]
include => set-snom-ringtone-variables

[set-snom-ringtone-variables]
exten => _X.,1,Noop(CALLERID_ALL=${CALLERID(all)})
exten => _X.,n,Set(CallerIDNum=${CALLERID(num)})

Which simply does not work at all.  The effect is that the extensions
stop working.   So, clearly I misunderstand something very basic about
flow control and thus my question.  How do I return from my
from-internal-custom context back to the from-internal-xfer context at
the point following the include => from-internal-custom statement?

Thank you.

-- 
***          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




More information about the asterisk-users mailing list