[asterisk-users] Calls to sip extensions not defined

Mojo with Horan & Company, LLC mojo at horanappraisals.com
Mon Mar 24 19:24:05 CDT 2008


Ricardo B. wrote:
> Hi all, new to the list and this is probably a basic question and 
> couldn't find anything clear googling around but I don't know how to 
> handle calls to sip extensions not defined on sip.conf while using 
> pattern matching. On my example I have sip extensions 10, 11, 12, and 
> 13 on sip.conf. On a basic extension.conf I set up a pattern starting 
> with "1" and a second digit should dial the sip extension entered by 
> the user and if the user don't pick up or is unavailable  the call 
> goes to the user voicemail and then hangup. This basic setup can be 
> seen next:
>
> [default]
> exten => _1X,1,Dial(SIP/${EXTEN},10)
> exten => _1X,2,VoiceMail(${EXTEN}@default,u)
> exten => _1X,3,HangUp()
>
> Now, what happens if the user dials 15? Then the pattern is applied 
> and the asterisk tries to dial that sip extension that doesn't exist, 
> the next step that is the voicemail also fails as 15 is not defined on 
> voicemail.conf and finally reaches the last step where it hang ups. 
> This can be seen on the cli output copied below:
>
> astbox*CLI>
>     -- Executing [15 at default:1] Dial("SIP/10-0820d8e0", "SIP/15|10") 
> in new stack
> [Mar 21 19:57:48] WARNING[14321]: chan_sip.c:2860 create_addr: No such 
> host: 15
> [Mar 21 19:57:48] WARNING[14321]: app_dial.c:1111 dial_exec_full: 
> Unable to create channel of type 'SIP' (cause 3 - No route to destination)
>   == Everyone is busy/congested at this time (1:0/0/1)
>     -- Executing [15 at default:2] VoiceMail("SIP/10-0820d8e0", 
> "15 at default|u") in new stack
> [Mar 21 19:57:48] WARNING[14321]: app_voicemail.c:2808 
> leave_voicemail: No entry in voicemail config file for '15'
>     -- Executing [15 at default:3] Hangup("SIP/10-0820d8e0", "") in new stack
>   == Spawn extension (default, 15, 3) exited non-zero on 'SIP/10-0820d8e0'
> astbox*CLI>
>
>
> What I am looking for is to play Playback(pbx-invalid) if a user 
> enters a sip extension not created. I've been testing a few options 
> using DIALSTATUS, AVAILSTATUS and their values but without luck as if 
> the sip phone 11 is not registered the pbx-invalid message.
>
> Thansk for reading and any suggestion will be welcome.
>
> Richard
>
>
> -- 
> Want an e-mail address like mine?
> Get a *free e-mail *account today at www.mail.com 
> <http://www.mail.com/Product.aspx>!
> ------------------------------------------------------------------------
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
Not sure the scale of this job exactly, so this could be overkill - but 
for small setups with too-hefty-servers, I tend to grep the 
voicemail/sip config files with -c switch to test for presence of stuff 
like that
^\[15\]$
with a properly constructed expression one could determine if a peername 
like such is defined and not commented out

You could of course grep the cli output of "sip show peer 15" to see if 
the peer is reachable, if you use qualify...  or if it even exists :)

just some ideas.  These would probably kill a busy production box :)

Moj




More information about the asterisk-users mailing list