Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] Calls to sip extensions not defined


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
ragb at mail.com
Guest





PostPosted: Fri Mar 21, 2008 4:13 pm    Post subject: [asterisk-users] Calls to sip extensions not defined Reply with quote

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!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080321/59f6e528/attachment.htm
Back to top
asterisk.org at sedwar...
Guest





PostPosted: Fri Mar 21, 2008 5:12 pm    Post subject: [asterisk-users] Calls to sip extensions not defined Reply with quote

On Fri, 21 Mar 2008, Ricardo B. wrote:

Quote:
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.

What I am looking for is to play Playback(pbx-invalid) if a user enters a
sip extension not created.

While I didn't take the time to test it, the following should be close:

[default]
exten = _1[1-3],1, dial(sip/${EXTEN},10)
exten = _1[1-3],n, voicemail(${EXTEN}@default,u)
exten = _1[1-3],n, hangup
exten = i,1, playback(pbx-invalid)
exten = i,n, hangup

Thanks in advance,
------------------------------------------------------------------------
Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST
Newline Fax: +1-760-731-3000
Back to top
ragb at mail.com
Guest





PostPosted: Sat Mar 22, 2008 12:26 pm    Post subject: [asterisk-users] Calls to sip extensions not defined Reply with quote

Thanks Steve, your solution works but I am looking for is something more
general. The example I posted is a simplified one and on the real one I
am using extensions on the 5XXX scenario so I can have 5000 to 5999
range. You answer for just 10 extension is great but for a 1000 and when
not all extensions on the 5XXX are set up then it is not optimal to
define each extension manually or add exceptions manually and I was
looking to see if there a command or state that I could use like
DIALSTATUS, etc to see if the dialled extension doesn't exist and then
jump to the invalid prompt.

Regards
Richard

----- Original Message -----
From: "Steve Edwards"
To: "Asterisk Users Mailing List - Non-Commercial Discussion"
Subject: Re: [asterisk-users] Calls to sip extensions not defined
Date: Fri, 21 Mar 2008 15:12:43 -0700 (PDT)
On Fri, 21 Mar 2008, Ricardo B. wrote:

Quote:
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
Quote:
"1" and a second digit should dial the sip extension entered by the
user
Quote:
and if the user don't pick up or is unavailable the call goes to
the
Quote:
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
Quote:
the asterisk tries to dial that sip extension that doesn't exist,
the
Quote:
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.

What I am looking for is to play Playback(pbx-invalid) if a user
enters a
Quote:
sip extension not created.

While I didn't take the time to test it, the following should be
close:

[default]
exten = _1[1-3],1, dial(sip/${EXTEN},10)
exten = _1[1-3],n, voicemail(${EXTEN}@default,u)
exten = _1[1-3],n, hangup
exten = i,1, playback(pbx-invalid)
exten = i,n, hangup

Thanks in advance,
------------------------------------------------------------------------
Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST
Newline Fax: +1-760-731-3000

_______________________________________________
-- 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

--
Want an e-mail address like mine?
Get a free e-mail account today at www.mail.com!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080322/834309b7/attachment.htm
Back to top
asterisk.org at sedwar...
Guest





PostPosted: Sat Mar 22, 2008 2:03 pm    Post subject: [asterisk-users] Calls to sip extensions not defined Reply with quote

On Sat, 22 Mar 2008, R. B. wrote:

Quote:
[default]
exten = _1[1-3],1, dial(sip/${EXTEN},10)
exten = _1[1-3],n, voicemail(${EXTEN}@default,u)
exten = _1[1-3],n, hangup
exten = i,1, playback(pbx-invalid)
exten = i,n, hangup

Quote:
Thanks Steve, your solution works but I am looking for is something more
general. The example I posted is a simplified one and on the real one I
am using extensions on the 5XXX scenario so I can have 5000 to 5999
range. You answer for just 10 extension is great but for a 1000 and when
not all extensions on the 5XXX are set up then it is not optimal to
define each extension manually or add exceptions manually and I was
looking to see if there a command or state that I could use like
DIALSTATUS, etc to see if the dialled extension doesn't exist and then
jump to the invalid prompt.

This really isn't my "field of expertise," but nobody else is chiming in.
Will the following help?

; test for availability
exten = _5xxx,1, verbose(1,Testing for availability)
exten = _5xxx,n, chanisavail(sip/${EXTEN})
exten = _5xxx,n, verbose(${AVAILCHAN})
exten = _5xxx,n, verbose(${AVAILORIGCHAN})
exten = _5xxx,n, verbose(${AVAILSTATUS})
exten = _5xxx,n, voicemail(${EXTEN}@default,u)
exten = _5xxx,103, playback(pbx-invalid)
exten = _5xxx,n, hangup

If you took an "AGI/database" approach, you wouldn't be constrained to
"the extension is numeric and has to match the stanza in sip.conf" and
would allow more features like a web page to "check-in" or whatever.

Thanks in advance,
------------------------------------------------------------------------
Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST
Newline Fax: +1-760-731-3000
Back to top
sst at sil.at
Guest





PostPosted: Sat Mar 22, 2008 6:16 pm    Post subject: [asterisk-users] Calls to sip extensions not defined Reply with quote

hello,

why do you build a realtime configuration loading the sip users and
extensions from a database?

if you want to use the username as extension it would be quit simple
looking like this:

exten => _X.,1,Select user from DB which has ${EXTEN}
exten => _X.n,GotoIf(Uservar = ""?nouser)
exten => _X.n,Dial(SIP/${EXTEN} or userval from db,60)
exten => _X.,n,Voicemail(${EXTEN} or userval from db)
exten => _X.,n,Hangup

exten => _X.,n(nouser),Playback(no_user_found)
exten => _X.,hangup

i am using this system on several servers serving more than 7000 active
users which more functionality than voicemail and sip dialing.

if you are interested in this solution give me a mail and i could send
you a copy of the config files and db structure you need.

best regards

steve smith

R. B. schrieb:
Quote:
Thanks Steve, your solution works but I am looking for is something more
general. The example I posted is a simplified one and on the real one I
am using extensions on the 5XXX scenario so I can have 5000 to 5999
range. You answer for just 10 extension is great but for a 1000 and when
not all extensions on the 5XXX are set up then it is not optimal to
define each extension manually or add exceptions manually and I was
looking to see if there a command or state that I could use like
DIALSTATUS, etc to see if the dialled extension doesn't exist and then
jump to the invalid prompt.

Regards
Richard
Back to top
eric at fnords.org
Guest





PostPosted: Sun Mar 23, 2008 7:50 am    Post subject: [asterisk-users] Calls to sip extensions not defined Reply with quote

exten => i is for IVRs.

You would need a wildcard catchall extension like the one below.
Unfortunately you are doing the classic newbie mistake of thinking you
can have a simple dialplan by making the SIP user/account ID be the same
as the extension. Eventually you will realize this is a bad idea.

If you think you have to use wildcards (you don't) then you would want
to check the value of DIALSTATUS or HANGUPCAUSE after the Dial, before
the Voicemail and handle the exception using a Goto.

[default]
exten = _1[1-3],1, dial(sip/${EXTEN},10)
exten = _1[1-3],n, voicemail(${EXTEN}@default,u)
exten = _1[1-3],n, hangup

exten = _XXX,1, playback(pbx-invalid)
exten = _XXX,n, hangup
Steve Edwards wrote:
Quote:
On Sat, 22 Mar 2008, R. B. wrote:

Quote:
[default]
exten = _1[1-3],1, dial(sip/${EXTEN},10)
exten = _1[1-3],n, voicemail(${EXTEN}@default,u)
exten = _1[1-3],n, hangup
exten = i,1, playback(pbx-invalid)
exten = i,n, hangup

--
Consulting for Asterisk, Polycom, Sangoma, Digium, Cisco, LAN, WAN, QoS,
T-1, PRI, Frame Relay, Linux, and network design. Based near
Birmingham, AL. Now accepting clients worldwide.
Back to top
ragb at mail.com
Guest





PostPosted: Sun Mar 23, 2008 1:42 pm    Post subject: [asterisk-users] Calls to sip extensions not defined Reply with quote

Thanks all, I will follow the recommendation of moving my sip extensions
to a db or use perl to check if the extension exists. I run tests with
dialstatus, hangupcase, chanisavail and the return codes are the same if
the extension doesn't exist on sip.conf or if the extension is not
registered.

Regards
Richard

----- Original Message -----
From: "Eric Wieling"
To: "Asterisk Users Mailing List - Non-Commercial Discussion"
Subject: Re: [asterisk-users] Calls to sip extensions not defined
Date: Sun, 23 Mar 2008 07:50:21 -0500
exten => i is for IVRs.

You would need a wildcard catchall extension like the one below.
Unfortunately you are doing the classic newbie mistake of thinking
you
can have a simple dialplan by making the SIP user/account ID be the
same
as the extension. Eventually you will realize this is a bad idea.

If you think you have to use wildcards (you don't) then you would
want
to check the value of DIALSTATUS or HANGUPCAUSE after the Dial,
before
the Voicemail and handle the exception using a Goto.

[default]
exten = _1[1-3],1, dial(sip/${EXTEN},10)
exten = _1[1-3],n, voicemail(${EXTEN}@default,u)
exten = _1[1-3],n, hangup

exten = _XXX,1, playback(pbx-invalid)
exten = _XXX,n, hangup


Steve Edwards wrote:
Quote:
On Sat, 22 Mar 2008, R. B. wrote:

Quote:
[default]
exten = _1[1-3],1, dial(sip/${EXTEN},10)
exten = _1[1-3],n, voicemail(${EXTEN}@default,u)
exten = _1[1-3],n, hangup
exten = i,1, playback(pbx-invalid)
exten = i,n, hangup

--
Consulting for Asterisk, Polycom, Sangoma, Digium, Cisco, LAN, WAN,
QoS,
T-1, PRI, Frame Relay, Linux, and network design. Based near
Birmingham, AL. Now accepting clients worldwide.

_______________________________________________
-- 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

--
Want an e-mail address like mine?
Get a free e-mail account today at www.mail.com!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080323/ee2e9838/attachment.htm
Back to top
Guest






PostPosted: Mon Mar 24, 2008 7:24 pm    Post subject: [asterisk-users] Calls to sip extensions not defined Reply with quote

Ricardo B. wrote:
Quote:
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 Smile

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

Moj
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services