Play Audio Message

Place for developers to chat about the code
AviMarcus
Posts: 153
Joined: Sun May 16, 2010 7:07 am

Play Audio Message

Post by AviMarcus » Mon May 17, 2010 8:05 pm

Hi. I've been setting up VoIP for my parents, and I think I'm switching them from the callcentric $30 wold unlimited plan to... custom dialing. GV for US calls, and some carrier for my local Israel calls.
Anyway - we have cell phones which include 11 hours of IN calling each month - cell phone in Israel is expensive, because you pay the mobile user's receiver's fee. So I want to gently remind my parents "Please use your cell phone to call that number." then hang up on them - where can I host a MP3 at a sip address or something similar? I'd much rather not use an annoying busy signal, and make sure they remember what that means.

Another option was to use a sip account with free voicemail (e.g. callcentric), set it to pick up immediately, and record that as the message. But that's really a hack - is there a more direct route?
Help document SIP Sorcery on the wiki!
If you solved an issue you were having or figured out how to do something, please share on the wiki! It will save everyone lots of time and frustration.

MikeTelis
Posts: 1581
Joined: Wed Jul 30, 2008 6:48 am

Re: Play Audio Message

Post by MikeTelis » Mon May 17, 2010 8:21 pm

Tropo.com can do the magic :-)

AviMarcus
Posts: 153
Joined: Sun May 16, 2010 7:07 am

Re: Play Audio Message

Post by AviMarcus » Mon May 17, 2010 9:47 pm

ooh it can. Is "personal" still considered development?
I'm check them out. Aaron mentioned it before, but I dismissed it from my list of things to look into.
Anything out there that's just free, and doesn't require me to run my own hardware?
I'm thinking long term it may be worth getting a hosted PBX in america, or running one here in Israel. Depends on how that affects ping times...
Help document SIP Sorcery on the wiki!
If you solved an issue you were having or figured out how to do something, please share on the wiki! It will save everyone lots of time and frustration.

User avatar
Aaron
Site Admin
Posts: 4569
Joined: Thu Jul 12, 2007 12:13 am

Re: Play Audio Message

Post by Aaron » Tue May 18, 2010 12:50 am

I've been working away with tropo.com for probably about two years now and to date haven't been given a hurry up to move from development into production, although that being said the production option has only been there for a couple of months. I will be switching to a production app eventually but as with all things software it always takes longer than anticipated.

Tropo may be overkill to play an mp3 especially if you do have to go into production and get charged 3 cents per minute. I'm sure you'd be able to find somewhere to play an mp3 for free or at least much cheaper than 3c per minute. Cloudvox.com run a hosted Asterisk server and while their calls are also charged at 3c per minute they don't seem to bill for SIP-to-SIP calls, I'm not sure if that's intentional or an anomaly. I did ask about it but they didn't seem to sure either. You also might be able to do something creative with podlinez.net.

If none of those offer you a solution here's a list of all the SIP application servers I have come across in my travels http://sipsorcery.wordpress.com/2009/12 ... -services/.

Regards,
Aaron

AviMarcus
Posts: 153
Joined: Sun May 16, 2010 7:07 am

Re: Play Audio Message

Post by AviMarcus » Tue May 18, 2010 1:45 am

Tropo is really cool! But yeah - they charge for all calls to pay for their platform. But it's supposedly open source (except for advanced voice recognition and skype gateway that has licensing fees) but they haven't packaged it up to be user friendly.

Not exactly sure how to set up cloudvox.. but they seem pretty explicit on the website that sip & soft phones are free.

So, does this http://sipsorcery.wordpress.com/2010/01 ... transfers/ still work? Cause I'm getting something wrong. I basically copied the code. It works to say, I get the music.. but I'm waiting for it to transfer back to sipsorcery. The sipsorcery logs show nothing.

That's supposed to have sipsorcery yank back the RTP foward to tropo, and then take control of the call again, cutting tropo out of the loop?
Help document SIP Sorcery on the wiki!
If you solved an issue you were having or figured out how to do something, please share on the wiki! It will save everyone lots of time and frustration.

User avatar
Aaron
Site Admin
Posts: 4569
Joined: Thu Jul 12, 2007 12:13 am

Re: Play Audio Message

Post by Aaron » Tue May 18, 2010 2:09 am

Yes it still works for me. You're better off using the tropo server address of sip-noproxy.voxeo.net to get access to the original SIP headers.

To troubleshoot the Application Debugger page on the tropo web site is very handy.

Regards,
Aaron

AviMarcus
Posts: 153
Joined: Sun May 16, 2010 7:07 am

Re: Play Audio Message

Post by AviMarcus » Thu May 20, 2010 2:35 am

I switched servers, but it's still not working. I got:
00127 6ca4 02:35:45 AM Call[avimar->9991430528] : Call-ID=114FAD27468B2CBBF3E0A99A6126E423-4322939@vx0sip005.orl.voxeo.net
00128 6ca4 02:35:45 AM Call[avimar->9991430528] : javaURL created
00129 6ca4 02:35:45 AM Call[avimar->9991430528] : <string xmlns="http://schemas.microsoft.com/2003/10/Se ... on/">Sorry no matching user was found, the transfer was not initiated.</string>

Does that explain anything?
Help document SIP Sorcery on the wiki!
If you solved an issue you were having or figured out how to do something, please share on the wiki! It will save everyone lots of time and frustration.

User avatar
Aaron
Site Admin
Posts: 4569
Joined: Thu Jul 12, 2007 12:13 am

Re: Play Audio Message

Post by Aaron » Thu May 20, 2010 2:42 am

Yes it means you've almost got it working.

The error message you're getting is coming back from the sipsorcery server so the hard part, the integration between tropo and sipsorcery, is functioning.

What's the URL you are using in your Tropo script?

In particular on the line below make sure you have substituted your real username.

Code: Select all

svcURL = "https://www.sipsorcery.com/callmanager.svc/blindtransfer?user=username&callid=#{$currentCall.getHeader("x-sbc-call-id")}&destination=hold";
Regards,
Aaron

AviMarcus
Posts: 153
Joined: Sun May 16, 2010 7:07 am

Re: Play Audio Message

Post by AviMarcus » Sat May 22, 2010 11:08 pm

I set it to the server, and I got a denied message in my log. Progress!

Here's some logs and code so you can tell me what I'm screwing up:

Code: Select all

... then sys.Dial("sip:9991442708@sip-noproxy.voxeo.net")

Code: Select all

log "Call-ID=" + $currentCall.getHeader("x-sbc-call-id")
svcURL = "https://www.sipsorcery.com/callmanager.svc/blindtransfer?user=[b]avi***_tropo[/b]&callid=#{$currentCall.getHeader("x-sbc-call-id")}&destination=some_info";
url= java.net.URL.new svcURL
conn = url.openConnection
log "javaURL created"
stm = conn.getInputStream
transferResult = org.apache.commons.io.IOUtils.toString(stm)
log transferResult
say "http://202.6.74.107:8060/triplej.mp3" # Play some audio while transfer is being carried out.
avi***_tropo's in-dial plan reads:

Code: Select all

if sys.In then 
sys.log("Call just came back as #{req.URI.User}")
sys.Dial("sip:9991430527@sip-noproxy.voxeo.net")
end
the app plays an mp3

now for the traces:
Call out log is fine:

Code: Select all

DialPlan 23:03:24:274 sip1: New call from udp:79.178.184.125:5061 successfully authenticated by digest.
DialPlan 23:03:24:415 sip1: Using dialplan !Avi for Out call to sip:12@sipsorcery.com.
NewCall 23:03:24:462 sip1: Executing script dial plan for call to 12.
DialPlan 23:03:24:493 sip1: starting dialplan...
DialPlan 23:03:24:509 sip1: Call placed by  Avi Marcus at avi***@sipsorcery.com
DialPlan 23:03:24:509 sip1: Commencing Dial with: sip:9991442708@sip-noproxy.voxeo.net.
DialPlan 23:03:24:509 sip1: Attempting to locate a provider for call leg: sip:9991442708@sip-noproxy.voxeo.net.
DialPlan 23:03:24:509 sip1: ForkCall commencing call leg to sip:9991442708@sip-noproxy.voxeo.net.
DialPlan 23:03:24:509 sip1: Switching to sip:9991442708@sip-noproxy.voxeo.net:5060 via udp:10.249.142.143:5060.
DialPlan 23:03:24:509 sip1: SDP on UAC call had RTP socket mangled from 192.168.1.2:16390 to 79.178.184.125:16390.
DialPlan 23:03:24:790 sip1: Information response 100 Trying for sip:9991442708@sip-noproxy.voxeo.net.
DialPlan 23:03:24:790 sip1: Information response 180 Ringing for sip:9991442708@sip-noproxy.voxeo.net.
DialPlan 23:03:24:790 sip1: UAS call progressing with Ringing.
DialPlan 23:03:25:134 sip1: Response 200 OK for sip:9991442708@sip-noproxy.voxeo.net.
DialPlan 23:03:25:134 sip1: SDP on UAC response had public IP not mangled, RTP socket 66.193.54.6:10880.
DialPlan 23:03:25:134 sip1: Cancelling all call legs for ForkCall app.
DialPlan 23:03:25:134 sip1: Answering client call with a response status of 200.
DialPlan 23:03:25:540 sip1: Dial command was successfully answered in 1.03s.
DialPlan 23:03:25:837 sip1: Dial plan execution completed with normal clearing.
I get the transfer music and all.

Tropo tells me:

Code: Select all

00691   	376c   	11:03:31 PM   	Call[avi**->9991442708] : Call-ID=[b]2cfcf216fe684fa7b4db4756298567ac[/b]
00692   	376c   	11:03:31 PM   	Call[avi**->9991442708] : javaURL created
00693   	376c   	11:03:32 PM   	Call[avi**->9991442708] : <string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">Sorry no matching user was found, the transfer was not initiated.</string>
00694   	376c   	11:03:32 PM   	Call[avi**->9991442708]->prompt("http://202.6.74.107:8060/triplej.mp3",true,"","",0.3,any,30000)
Now let's see if that call-ID is correct..

Seems to be:
SIPTransaction=> Received Response udp:10.249.142.143:5070<-udp:10.249.142.143:5060
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.249.142.143:5070;branch=z9hG4bK9629a632e8a748afa2e133e017d4674d;rport
To: <sip:9991442708@sip-noproxy.voxeo.net>;tag=0-13c4-4bf862bb-27ba695d-10ff
From: "Avi Marcus" <sip:avi**@sipsorcery.com>;tag=2129309609
Call-ID: 2cfcf216fe684fa7b4db4756298567ac
CSeq: 1 INVITE
Contact: <sip:9991442708@66.193.54.6:5060>
Content-Length: 200
Content-Type: application/sdp
Proxy-ReceivedFrom: udp:66.193.54.6:5060
Proxy-ReceivedOn: udp:10.249.142.143:5060
x-sid: 86564c0ccefdd7fd0a6aadf7b922376c

v=0
o=voxeo.8.0.307.0 0 0 IN IP4 66.193.54.6
s=voxeo
c=IN IP4 66.193.54.6
t=0 0
m=audio 10880 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
I tried setting the username to my main account name- oh, something changed:
DialPlan 23:09:11:917 sip1: Web transfer rejected as no transfer dialplan exists.
But that account has an In plan... and I don't want it on the main, anyway - so.. what do I do?
Help document SIP Sorcery on the wiki!
If you solved an issue you were having or figured out how to do something, please share on the wiki! It will save everyone lots of time and frustration.

User avatar
Aaron
Site Admin
Posts: 4569
Joined: Thu Jul 12, 2007 12:13 am

Re: Play Audio Message

Post by Aaron » Sat May 22, 2010 11:19 pm

You need to create a dialplan called transfer. The reason you need a separate dialplan is so that users can't inadvertently have their calls transferred the logic being that if you've created a dialplan called transfer you are aware of the risks and have taken approriate measures.

Regards,
Aaron

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest