[Asterisk-Users] Disa dialplan

Mark Hulber asterisk-admin at hulber.com
Fri Nov 11 20:27:51 MST 2005


You can pass a context to DISA for dialing outbound.  Do you have a 
dialplan that works like this for non-DISA calls?  You can use the same 
one.  Otherwise, I do this with nested dialplans by putting the most 
specific and longest rules first.  By nesting, you only enter an 
included context if none of the extensions are satisfied on the current 
context.  You'll have to ignore all the macros and just assume for the 
most part that you would Dial there.

exten => 9999,n,DISA(no-password|dialout)

[dialout]
  
   include => dialout2
   include => check-voicemail
   include => getparked
  
   ; Emergency
   exten => 911,1,Goto(nineoneone,s,1)

   ; City Services
   exten => 311,1,Set(CALLEDNUMBER=${EXTEN})
   exten => 311,n,Macro(dialHC,Zap/3/${EXTEN},30)

   ; Information
   exten => _1NXX5551212,1,Set(CALLEDNUMBER=${EXTEN})
   exten => _1NXX5551212,n,Macro(dialHC,Zap/3/${EXTEN},30)

   exten => _NXX5551212,1,Set(CALLEDNUMBER=${EXTEN})
   exten => _NXX5551212,n,Macro(dialHC,Zap/3/1${EXTEN},30)

   exten => _5551212,1,Set(CALLEDNUMBER=${EXTEN})
   exten => _5551212,n,Macro(dialHC,Zap/3/${EXTEN},30)

   exten => 411,1,Set(CALLEDNUMBER=${EXTEN})
   exten => 411,n,Macro(dialHC,Zap/3/${EXTEN},30)

   exten => 611,1,Set(CALLEDNUMBER=${EXTEN})
   exten => 611,n,Macro(dialHC,Zap/3/${EXTEN},30)

   ; Timeout
   exten => t,1,Playback(vm-goodbye)
   exten => t,n,Macro(rhangup)

   ; Invalid Entry
   exten => i,1,Macro(badentry,${INVALID_EXTEN})
   exten => i,n,Macro(rhangup)

   ; Hangup
   exten => h,1,Macro(rhangup)

[dialout2]

   include => dialout3
   include => onex
   ; Local
   exten => _1212NXXXXXX,1,Macro(sddial-defid,${EXTEN})
  
   exten => _212NXXXXXX,1,Macro(sddial-defid,1${EXTEN})
  
   exten => _1646NXXXXXX,1,Macro(sddial-defid,${EXTEN})
  
   exten => _646NXXXXXX,1,Macro(sddial-defid,1${EXTEN})
  
   exten => _1917NXXXXXX,1,Macro(sddial-defid,${EXTEN})
  
   exten => _917NXXXXXX,1,Macro(sddial-defid,1${EXTEN})
  
   ; Toll-Free
   exten => _1800NXXXXXX,1,Macro(sddial-tf-defid,${EXTEN})
   exten => _1866NXXXXXX,1,Macro(sddial-tf-defid,${EXTEN})
   exten => _1877NXXXXXX,1,Macro(sddial-tf-defid,${EXTEN})
   exten => _1880NXXXXXX,1,Macro(sddial-tf-defid,${EXTEN})
   exten => _1881NXXXXXX,1,Macro(sddial-tf-defid,${EXTEN})
   exten => _1882NXXXXXX,1,Macro(sddial-tf-defid,${EXTEN})
   exten => _1888NXXXXXX,1,Macro(sddial-tf-defid,${EXTEN})

   exten => _800NXXXXXX,1,Macro(sddial-tf-defid,1${EXTEN})
   exten => _866NXXXXXX,1,Macro(sddial-tf-defid,1${EXTEN})
   exten => _877NXXXXXX,1,Macro(sddial-tf-defid,1${EXTEN})
   exten => _880NXXXXXX,1,Macro(sddial-tf-defid,1${EXTEN})
   exten => _881NXXXXXX,1,Macro(sddial-tf-defid,1${EXTEN})
   exten => _882NXXXXXX,1,Macro(sddial-tf-defid,1${EXTEN})
   exten => _888NXXXXXX,1,Macro(sddial-tf-defid,1${EXTEN})

   ; Toronto
   exten => _1289NXXXXXX,1,Macro(set647cid)
   exten => _1289NXXXXXX,n,Macro(lddial-availCDN,${EXTEN:1})

   exten => _289NXXXXXX,1,Macro(set647cid)
   exten => _289NXXXXXX,n,Macro(lddial-availCDN,${EXTEN})

   exten => _416NXXXXXX,1,Macro(set647cid)
   exten => _416NXXXXXX,n,Macro(lddial-availCDN,${EXTEN})

   exten => _1416NXXXXXX,1,Macro(set647cid)
   exten => _1416NXXXXXX,n,Macro(lddial-availCDN,${EXTEN:1})

   exten => _1647NXXXXXX,1,Macro(set647cid)
   exten => _1647NXXXXXX,n,Macro(lddial-availCDN,${EXTEN:1})

   exten => _647NXXXXXX,1,Macro(set647cid)
   exten => _647NXXXXXX,n,Macro(lddial-availCDN,${EXTEN})

   exten => _905NXXXXXX,1,Macro(set647cid)
   exten => _905NXXXXXX,n,Macro(lddial-availCDN,${EXTEN})

   exten => _1905NXXXXXX,1,Macro(set647cid)
   exten => _1905NXXXXXX,n,Macro(lddial-availCDN,${EXTEN:1})

   ; California
   exten => _415NXXXXXX,1,Macro(set916cid)
   exten => _415NXXXXXX,n,Macro(lddial-avail,1${EXTEN})

   exten => _1415NXXXXXX,1,Macro(set916cid)
   exten => _1415NXXXXXX,n,Macro(lddial-avail,${EXTEN})

   exten => _707NXXXXXX,1,Macro(set916cid)
   exten => _707NXXXXXX,n,Macro(lddial-avail,1${EXTEN})

   exten => _1707NXXXXXX,1,Macro(set916cid)
   exten => _1707NXXXXXX,n,Macro(lddial-avail,${EXTEN})

   exten => _1831NXXXXXX,1,Macro(set916cid)
   exten => _1831NXXXXXX,n,Macro(lddial-avail,${EXTEN})

   exten => _831NXXXXXX,1,Macro(set916cid)
   exten => _831NXXXXXX,n,Macro(lddial-avail,1${EXTEN})

   exten => _916NXXXXXX,1,Macro(set916cid)
   exten => _916NXXXXXX,n,Macro(lddial-avail,1${EXTEN})

   exten => _1916NXXXXXX,1,Macro(set916cid)
   exten => _1916NXXXXXX,n,Macro(lddial-avail,${EXTEN})

   ; WestVirginia

   exten => _304NXXXXXX,1,Macro(set304cid)
   exten => _304NXXXXXX,n,Macro(lddial-avail,1${EXTEN})

   exten => _1304NXXXXXX,1,Macro(set304cid)
   exten => _1304NXXXXXX,n,Macro(lddial-avail,${EXTEN})

[dialout3]
  
#include <ldrates.conf>

   include => onex
  
   ; Assume 212
   exten => _NXXXXXX,1,Macro(sddial-defid,*821212${EXTEN})


**ldrates.conf**
[onex]

include => twox

[twox]

include => threex

[threex]

include => fourx

[fourx]

include => fivex

[fivex]

include => anyx

[anyx]

   exten => _011.,1,Macro(setdefcallid)
   exten => _011.,n,Macro(lddial-avail,${EXTEN})

   exten => _NXXNXXXXXX,1,Macro(setdefcallid)
   exten => _NXXNXXXXXX,n,Macro(lddial-avail,1${EXTEN})

   exten => _1NXXNXXXXXX,1,Macro(setdefcallid)
   exten => _1NXXNXXXXXX,n,Macro(lddial-avail,${EXTEN})


Benjamin Lawetz wrote:
> I have a dialplan entry that currently when you call, sets some variables
> and then calls DISA. 
>
> I'm having a bit of a "unnatural" timeout from there.
>
> I would want from the DISA to match certain patterns to know when the number
> is complete
> A 311 or 911 call would be dial as soon as the third digit is dialled, a
> NXXNXXXXXX number would be dialled after the 10th digit. A 1NXXNXXXXXX
> number would be dialled after the 11th digit and a 011XXX number would be
> dialed after a timeout.
>
> Sort of trying to replicate a Sipura's dialplan.
> I figure I can do this reading one digit at a time, and comparing to
> patterns and when the pattern is complete send the call to the correct
> context/extension.
>
> But I'm guessing I'm not the first one to want to do this. Has anyone done
> this? Is there an easier way ?
>
> thanks
>
>
> _______________________________________________
> --Bandwidth and Colocation sponsored by Easynews.com --
>
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
>   



More information about the asterisk-users mailing list