[asterisk-users] CHANUNAVAIL

Peder @ NetworkOblivion peder at networkoblivion.com
Sat Jan 26 07:55:55 CST 2008


I've got a setup where we have 100 DID's.  Our default dialplan has one 
line that calls a macro:

exten => _22XX,1,Macro(STDEXT,${EXTEN})


The macro is pretty basic:

[macro-STDEXT]
exten => s,1,NoOp
exten => s,2,Dial(SIP/${ARG1},15,Tt)
exten => s,3,Goto(s-${DIALSTATUS},1)
exten => s-NOANSWER,1,Voicemail(${ARG1}|u)
exten => s-NOANSWER,n,Hangup
exten => s-BUSY,1,Voicemail(${ARG1}|b)
exten => s-BUSY,n,Hangup
exten => s-CHANUNAVAIL,1,Voicemail(${ARG1}|b)
exten => s-CHANUNAVAIL,n,Hangup
exten => s-CONGESTION,1,Voicemail(${ARG1}|b)
exten => s-CONGESTION,n,Hangup


My issue is that there are probably only about 50 numbers active at one 
point in time and the numbers change frequently.  I used the 22XX so 
that I didn't have to update the dialplan all the time.  The issue is 
that if someone calls an invalid number, the system hangs up on them. 
It tries to ring their extension, gets a SIP No Route and then goes to 
CHANUNAVAIL where it tries voicemail and hangs up.

What I want to happen is if someone calls in and hits an invalid number, 
it always goes to the operator.  I thought I could just use CHANUNAVAIL 
to send them there, but the problem is that if a phone isn't registered 
and someone calls it, it goes to CHANUNAVAIL as well.  This may seem 
like the same thing, but it is different.  If there is an extension 
built and it isn't registered, I want it to go to their voicemail.  It 
is only if someone calls an extension that isn't built that I want it to 
go to the operator.

Any ideas on how to achieve this?




More information about the asterisk-users mailing list