[asterisk-users] Catch all undefined numbers to play a nice messageand resta

Yuan LIU yliu11 at hotmail.com
Thu Apr 12 22:01:00 MST 2007


>From: pedro noticioso <cucnews at yahoo.com>
>Date: Thu, 12 Apr 2007 12:02:52 -0700 (PDT)
>
>Hi there list!
>
>I want to catch all numbers that don't exist, play a
>nice message and restart operator, this is different
>from dial i because that is for incorrect extensions,
>an undefined number will give a busy signal, something
>I don't like

May be you can explain what is the difference between an undefined extention 
(number) and an extention (number) that doesn't exist.  You can certainly 
use extension i to catch wrong numbers and play nice messages instead of 
busy.

If you only want to catch numbers that matches a certain pattern but don't 
exist in your system, and want to give busy signal to all other dialed 
numbers, you can match the pattern and transfer to another context, then use 
i in that context.  For example, suppose your extensions should start with 
2,3,4 and must be 3 digits, but you have only defined 200-242, 320-350, and 
400-420, you can do (untested)

[incoming]
exten => _[2-4]XX,1,Goto(valid,${EXTEN},1)
exten => i,1,Congestion; give busy to any other dialed number

[valid]
exten => _2[0-4]X,1,Dial(SIP/${EXTEN})
exten => _24[12],1,Dial(SIP/${EXTEN})
exten => _3[2-4]X,1,Dial(SIP/${EXTEN})
exten => _4[0-1]X,1,Dial(SIP/${EXTEN})
exten => 420,1,Dial(SIP/${EXTEN})
exten => 350,1,Dial(SIP/${EXTEN})
exten => i,1,Answer(); if
exten => i,n,Playback(nice-message)
exten => i,n,DISA(nopassword,incoming)

Hope this helps.

Yuan Liu

>You can search for the word irc to see my comments,
>the line above is my latest unsuccessful test, thanks!




More information about the asterisk-users mailing list