How to have IVRS played in IP network

I could handle inbound call from PSTN using IVRS. However, I would like to have the possibility to provide the IVRS functions to others who call from SIP phone. :stuck_out_tongue:

Is there a way when people called in from SIP say to a SIP number, the IVRS will played and the users could select different options from the SIP phone. :question:

in sip.conf in the [general] section you have a ‘context=’ option … this defines where unknown SIP callers enter your dialplan. for other users and peers, you also have a ‘context=’ option, again, defining where the user/peer enters the dialplan. customise these so they start in the IVR.

Baconbuttie,

Thanks for your informaiton. I have tried this and the following is my setting for two SIP ext:

[200]
username=200
type=friend
record_out=Adhoc
record_in=Adhoc
qualify=no
port=5060
nat=never
mailbox=200@device
host=dynamic
dtmfmode=rfc2833
context=outboundmsg1
canreinvite=no
callerid=Peter <200>

[201]
username=201
type=friend
record_out=Adhoc
record_in=Adhoc
qualify=no
port=5060
nat=never
mailbox=201@device
host=dynamic
dtmfmode=rfc2833
context=outboundmsg1
canreinvite=no
callerid=walter <201>

However, when I am trying to call to 201 from 200. There is nothing played and then it goes to the voice mail box.

you also need to define the extensions in extensions.conf, if you’re calling 201 from 200, then in [outboundmsg1] you need something likeexten => 201,1,Dial(SIP/201|30|TtWw) as a very minimum.

can you define exactly what you want the dialplan to do ? your first post talked about ‘others’ calling in from a SIP UA, which i took to be unknown callers. if you mean local or registered users then it’s different, and you need to separate them from unknown callers to prevent abuse of your dialplan.

The following is the setting in SIP general:

; Note: If your SIP devices are behind a NAT and your Asterisk
; server isn’t, try adding “nat=1” to each peer definition to
; solve translation problems.

[general]

port = 5060 ; Port to bind to (SIP is 5060)
bindaddr = 0.0.0.0 ; Address to bind to (all addresses on machine)
disallow=all
allow=ulaw
allow=alaw
; If you need to answer unauthenticated calls, you should change this
; next line to ‘from-trunk’, rather than ‘from-sip-external’.
; You’ll know this is happening if when you call in you get a message
; saying "The number you have dialed is not in service. Please check the
; number and try again."
context = from-sip-external ; Send unknown SIP callers to this context
callerid = Unknown
tos=0x68

context = outboundmsg1
callerid = 200
tos=0x68

; #, in this configuration file, is NOT A COMMENT. This is exactly
; how it should be.
#include sip_nat.conf
#include sip_custom.conf
#include sip_additional.conf

so why have you defined ‘context=’ twice ?

what is it you’re trying to do exactly ? for both internal and external (SIP) callers.

[quote=“baconbuttie”]you also need to define the extensions in extensions.conf, if you’re calling 201 from 200, then in [outboundmsg1] you need something likeexten => 201,1,Dial(SIP/201|30|TtWw) as a very minimum.

can you define exactly what you want the dialplan to do ? your first post talked about ‘others’ calling in from a SIP UA, which i took to be unknown callers. if you mean local or registered users then it’s different, and you need to separate them from unknown callers to prevent abuse of your dialplan.[/quote]

Dear baconbuttie,

What I want to do is to have one IVRS that could play the options to anyone who could call from any SIP number or external PSTN phone.

I have tried this and only succeed for PSTN calling in Asterisk.

However, I could not succed for the SIP call. I don’t know what to do this function with SIP.

Thanks.
fly_sun

[quote=“fly_sun”]What I want to do is to have one IVRS that could play the options to anyone who could call from any SIP number or external PSTN phone.
I have tried this and only succeed for PSTN calling in Asterisk.
[/quote]
in sip.conf, set your ‘context=’ to the same as you have defined in zapata.conf. then inbound calls for either technology will enter your dialplan in the same context.

[quote=“baconbuttie”][quote=“fly_sun”]What I want to do is to have one IVRS that could play the options to anyone who could call from any SIP number or external PSTN phone.
I have tried this and only succeed for PSTN calling in Asterisk.
[/quote]
in sip.conf, set your ‘context=’ to the same as you have defined in zapata.conf. then inbound calls for either technology will enter your dialplan in the same context.[/quote]

Could you please advise the whole configuration that I need to do? Because I still could not succeed.

Thank you.
fly_sun

how not ? if incoming Zap calls go to the IVR, and you’ve copied the ‘context=’ line from zapata.conf to the [general] section of sip.conf, then you should be good to go.

if you’re still struggling, post the sections from zapata.conf, sip.conf and extensions.conf, and a verbose Asterisk log fragment for a failed incoming call.

[quote=“baconbuttie”]how not ? if incoming Zap calls go to the IVR, and you’ve copied the ‘context=’ line from zapata.conf to the [general] section of sip.conf, then you should be good to go.

if you’re still struggling, post the sections from zapata.conf, sip.conf and extensions.conf, and a verbose Asterisk log fragment for a failed incoming call.[/quote]

Hi baconbuttie,

The following is my question:

In zapata.conf I could set the channel ID, the context name for which the incoming call could be handled. Then in the extension.conf, I define the context what action to do. Then I attached the PSTN line (say: 12345678) to the FXO channel defined in zapata.conf. When people call in 12345678, they will be handled by the IVRS defined in the context in the extension.conf.

However, for the SIP cases, If I want to call from SIP extension 200 to SIP extension 201 and people in SIP200 to hear the options of IVRS. How to configure it? Assume I have the following in the extension.conf:

[outboundmsg1]
exten => s,1,DigitTimeout,5 ; Set Digit Timeout to 5 seconds
exten => s,2,ResponseTimeout,10 ; Set Response Timeout to 10 seconds
exten => s,3,Answer
exten => s,4,Wait(1)
exten => s,5,Background(outboundmsgs/msg1) ; "play outbound msg"
exten => s,6,Background(outboundmsgs/susan) ; "play outbound msg"
exten => s,7,Background(outboundmsgs/happybirthday) ; "play outbound msg"
exten => s,8,Background(outboundmsgs/how_to_ack) ; "Press 1 to replay or 2 to acknowledge receiving this message"
exten => 1,1,Goto(s,5) ; replay message
exten => 2,1,Goto(msgack,s,1) ; acknowledge message
exten => t,1,Playback(outboundmsgs/vm-goodbye)
exten => t,2,Hangup
; at this point we could do something like reschedule the call to try again later
; or send an email saying the msg was not received,
; or …

[msgack]
exten => s,1,Playback(outboundmsgs/thankyou)
exten => s,2,Playback(outboundmsgs/vm-goodbye)
exten => s,3,Hangup
; at this point we might want to log the message acknowledgement somewhere
; and perhaps trigger some additional processing

and in the sip.conf:

[general]

port = 5060 ; Port to bind to (SIP is 5060)
bindaddr = 0.0.0.0 ; Address to bind to (all addresses on machine)
disallow=all
allow=ulaw
allow=alaw
; If you need to answer unauthenticated calls, you should change this
; next line to ‘from-trunk’, rather than ‘from-sip-external’.
; You’ll know this is happening if when you call in you get a message
; saying “The number you have dialed is not in service. Please check the
; number and try again.”
;context = from-sip-external ; Send unknown SIP callers to this context
context = outboundmsg1
callerid = Unknown
tos=0x68
; #, in this configuration file, is NOT A COMMENT. This is exactly
; how it should be.
#include sip_nat.conf
#include sip_custom.conf
#include sip_additional.conf

I have tried to add something in the ext 200 and ext 201 defined in the sip_additional.conf as well:

[200]
username=200
type=friend
record_out=Adhoc
record_in=Adhoc
qualify=no
port=5060
nat=never
mailbox=200@device
host=dynamic
dtmfmode=rfc2833
context=outboundmsg1
canreinvite=no
callerid=Peter <200>

[201]
username=201
type=friend
record_out=Adhoc
record_in=Adhoc
qualify=no
port=5060
nat=never
mailbox=201@device
host=dynamic
dtmfmode=rfc2833
context=outboundmsg1
canreinvite=no
callerid=walter <201>

However, I could not achieve my desired result. Please help!

Thanks a lot.

fly_sun

if caller 200 is going to dial 201 and you want them to get the IVR then in extensions.conf [outboundmsg1] just add exten => 201,1,Goto(s,1)

i can’t see much in the way of practical use for this though, as 200 can’t actually call 201 in your setup, only get to an IVR !! just because you’ve defined a user in sip.conf, it doesn’t mean they are dial-able.