[asterisk-users] Recommendation / doubt about building of dialplan
Daniel Bareiro
daniel-listas at gmx.net
Sun Jun 28 11:54:18 CDT 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi all!
Now that I have a little more time, I was debugging my dialplan and it
was of the following way:
- -------------------------------------------------------------------------
; DGB - 20090615
[macro-dial]
exten => s,1,Dial(${ARG1},15)
exten => s,n,Goto(s-${DIALSTATUS},1)
exten => s-NOANSWER,1,Voicemail(${MACRO_EXTEN}@voicemail,u)
exten => s-NOANSWER,n,Hangup
exten => s-BUSY,1,Voicemail(${MACRO_EXTEN}@voicemail,b)
exten => s-BUSY,n,Hangup
exten => s-CHANUNAVAIL,1,Playback(pbx-invalid)
[from-internal]
; Call to SIP extensions
exten => _xxx,1,Macro(dial,SIP/${EXTEN})
exten => _xxx,n,Hangup
; Analog extension
exten => 402,1,Macro(dial,DAHDI/2)
exten => 402,n,Hangup
; Outgoing calls
exten => _9.,1,Dial(DAHDI/1/${EXTEN:1})
exten => _9.,n,Hangup
;exten => 9,1,Dial(DAHDI/1,20,tTr)
; Voicemail
exten => *100,1,Answer
exten => *100,n,Wait(1)
exten => *100,n,VoiceMailMain(${CALLERID(num)}@voicemail)
exten => *100,n,Hangup
; Echo test
exten => *200,1,Answer
exten => *200,n,Playback(demo-echotest)
exten => *200,n,Echo
exten => *200,n,Playback(demo-echodone)
exten => *200,n,Hangup
; Music on the hold
exten => *300,1,Answer
exten => *300,n,SetMusicOnHold(default)
exten => *300,n,WaitMusicOnHold(2000)
exten => *300,n,Hangup
; Dial-by-name directory
exten => *400,1,Directory(voicemail,from-internal)
;-----------------------------------
[from-pstn]
; incoming calls from FXO port are directed to this context
exten => s,1,Dial(DAHDI/2,15,tTrm)
exten => s,n,Background(if-u-know-ext-dial) ; Dial known extension
exten => s,n,WaitExten()
include => from-internal
- -------------------------------------------------------------------------
Although internally it works as I had thought in such a way that
Asterisk derives to the voicemail indicating the reason by which one
became (nonavailable person or busy extension) and to indicate that the
extension is not valid in case it does not exist or the extension is not
registered when to try to contact (if there is some situation that I'm
ignoring, make to me notice it, please), the problem that I am seeing
with this is that if I include from-iternal context in from-pstn in such
a way that the incoming calls from the PSTN can communicate with both
SIP or DAHDI extensions, I think (with my present knowledge of Asterisk)
that it will be not useful to me so that in case the extension is not
valid a Goto(s,2) of from-pstn are accomplished so that the person can
dial the extension again without having to make a new call.
I suppose that it would be possible to be done defining again the
extensions in context from-pstn, but I suppose that there will be one
more efficient way to obtain the behavior to which I made reference of
one better way, which can be especially useful if we have defined a lot
of extensions.
Thanks in advance for your reply.
Regards,
Daniel
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAkpHoKkACgkQZpa/GxTmHTeVegCfaZ2euXR2SNjcMAIYLFlNjjI0
0ckAn3xeBP3J+JypLLEPCv+bnDxJiWRO
=hCwL
-----END PGP SIGNATURE-----
More information about the asterisk-users
mailing list