send 180 response when receiving webcallback

New features you'd like see on SIP Sorcery
Post Reply
jvwelzen
Posts: 716
Joined: Thu Sep 11, 2008 1:56 pm

send 180 response when receiving webcallback

Post by jvwelzen » Wed Jan 20, 2010 9:20 pm

Would it be possible to send a 180 response back when the first call leg was successful so you would here a ring tone

Aaron
Site Admin
Posts: 4652
Joined: Thu Jul 12, 2007 12:13 am

Post by Aaron » Wed Jan 20, 2010 10:18 pm

No it wouldn't work because the first call has already been answered and ringing responses will be ignored once a SIP call is answered.

Regards,

Aaron

Aaron
Site Admin
Posts: 4652
Joined: Thu Jul 12, 2007 12:13 am

Post by Aaron » Fri Jan 22, 2010 12:58 am

I've found a clever (excuse the hubris) way to make this work. While the 180 Ringing response is no good once the first call is set up it's still possible to take advantage of 183 Session Progress responses. With 183 responses there is an associated audio stream which carries a progress indication. While the 183 reponse itself can't be passed through to the first call the audio stream can be directed to it. Once the second call is answered the progress indication audio must be told to stop otherwise there's a chance of two audio streams being sent to the first phone which won't sound good.

I've updated the sipsorcery.com servers and here's a way you can test it out:

Code: Select all

sys.Callback("1234@provider1", "4567@provider2&early_music@iptel.org")
The new piece is the early_music@iptel.org call leg. Placing a call to that SIP URI results in a 183 Session Progress response and some pleasant call on hold music being generated. As soon as the real call leg, in this case 4567@provider2, is answered the early_music@iptel.org call is automatically cancelled. So the next effect is that the first call leg, in this case 1234@provider1, gets music on hold while waiting for the second call leg to answer.

The next question you will have is can you customise the audio (progress indication) that's played. The answer is yes but you'll need a media server or to find another service like iptel.org's somewhere that offers a public SIP URI with early media.

Regards,

Aaron

jvwelzen
Posts: 716
Joined: Thu Sep 11, 2008 1:56 pm

Post by jvwelzen » Fri Jan 22, 2010 7:23 pm

Hi Aaron

I have tested it and it works great

Thanks again

btw is it also included in the next local release

jvwelzen
Posts: 716
Joined: Thu Sep 11, 2008 1:56 pm

Post by jvwelzen » Fri Jan 22, 2010 8:13 pm

it's really neat that it also works on your incoming calls when using sys.Dial()

Now it would be possible to make a kind of hunting system

atoo
Posts: 4
Joined: Mon Mar 22, 2010 11:17 pm

Re:

Post by atoo » Tue Mar 23, 2010 7:23 pm

Hi all,
Aaron wrote:

Code: Select all

sys.Callback("1234@provider1", "4567@provider2&early_music@iptel.org")
Aaron
I am new to this. I got all my incoming and outgoing working. I am now trying to learn how to
write dial plans. Can you please elaborate on that piece of code specially the 1234 and 4567 numbers.

I need to do the following if possible,
A person calls my DID from a PSTN Line. My dial plan in Sip Sorcery gives him a beep or some kind of
a message to enter a two digit number. My dial plan then redirects the call conditionally to a destination
of his choosing but using a different provider.

Assume
provider 1 : callcentric-------my DID # 1 709 456 7890
provider 2 : mywebcalls------my DID# 1 709 456 3421

Call originated from PSTN line : 1 703 546 1234
call going to PSTN Line : 00 1 444 234 5678
Two digits response : 55

Thanks...

atoo
Posts: 4
Joined: Mon Mar 22, 2010 11:17 pm

Re: send 180 response when receiving webcallback

Post by atoo » Mon Mar 29, 2010 6:06 pm

I did all the above using the 3CX PBX system on my home computer. My next try will be
to do the same on a web based PBX or a switch like this one. A digital receptionist is
a must have for the setup I am after.

Post Reply