Mike Telis (aka Magician Mike – in keeping with the sorcery theme) whipped up a Tropo ruby script to act as a call announcement handler to work in conjunction with an incoming call to sipsorcery. Since sipsorcery does not do any media handling at all it’s necessary to use a different platform such as Tropo to do things like call announcement. Mike originally sent me the script in Jun 2010 after which I duly forgot to post about it until a recent subtle reminder.
The way the call announcement works is that a new call arrives at sipsorcery and is forwarded directly to a Tropo application that is configured with the call announcement ruby script. Straight forward so far. Now it gets a little bit tricky. The call announcement script initiates a call from Tropo back to a configurable sipsorcery account. When the call from Tropo back to sipsorcery is answered an announcement is played which informs the callee that there is a pending call for them and they can press 1 to accept or 2 to reject. Hopefully you’re still with me. If the callee presses 2 the original call gets rejected and the caller will hear an engaged tone or whatever their phone or provider does for a rejection. If the callee presses 1 then some magic is done between Tropo and sipsorcery so that the original call leg and the leg between the callee (who just pressed 1) are transferred together and they can chat away. The magic in this case is an attended transfer but since Tropo doesn’t support attended transfers it’s initiated by a HTTP request from Tropo to sipsorcery. I won’t go into the details of that as it all happens under the hood in Mike’s call announcement script.
For anyone feeling brace enough to try it out the steps are:
1. Create a new Tropo application using Mike’s call announcement script which can be found on github. At the top of the script you will need to enter your sipsorcery username, the sipsorcery SIP account you want Tropo to announce the call to and your name to play to callers. You’ll see those parameters clearly labelled,
2. In your sipsorcery configuration forward whichever incoming provider or SIP account you want to get call announcements on to the Tropo application. When you create a Tropo application you’ll see a Phone numbers section under which there is a SIP Voice number which is the one to use.
That should be it. There’s a few things that could go wrong but the great thing about sipsorcery and Tropo is that they both provide a console so you can see exactly what’s going on. If you do get stuck and the console messages don’t make any sense feel free to post on the sipsorcery forums.