[Freeswitch-dev] How to enable Call Waiting on Freeswitch UA???

trixter aka Bret McDanel trixternospam at 0xdecafbad.com
Wed Dec 26 09:50:13 EST 2007


On Wed, 2007-12-26 at 08:04 -0600, Brian West wrote:
> You really don't.  That option isn't in FreeSWITCH someone will have  
> to write it.
> 
> /b
> 
> On Dec 26, 2007, at 3:19 AM, Irshad Ahamed wrote:
> 
> > So where should I configure/enable Call Waiting option to generate  
> > Call Waiting tone at Freeswitch UA.

You could fake it, there are a few ways.

Smoke and Mirrors method #1 
This is probably the simpliest.  An event socket app that would play a
tone to the proper leg of a call that the caller is in, the caller could
signal they want to switch to the new person and you do all the transfer
magic to make that happen. 

The problem with this is if you want call waiting presumably you have an
analog device, which would be like a FXS/FXO card (an ATA for example
generally would handle this internally).  To get the flash event
requires that the signalling layer support that.  Some ATAs will pass
this as key '16' via rfc2833, since that is defined as 'flash'.

You can monitor event socket and see if that is being passed into the FS
core (I really dont know offhand) if it is that can be used, if not you
may have to use something like * or # or whatever to signal that you
want to switch calls.  There are event socket script examples in
SRC/scripts/contrib/trixter (see the README) some of which do DTMF but I
do not recall if that was only in a conf or not, but it gives you
example (perl) framework which will monitor for heartbeats, reconnect if
it doesnt get one, etc.


Smoke and Mirrors method #2
You could have an app, say javascript that a user is directed to if the
caller is busy (say that have max-channels set to 1).  Then you could
execute api commands, which include the aforementioned playback (or
possibly rig up something to use teletone, perhaps a media bug and use
TGML to express the tone instead, although static files are less cpu
intensive, and how often does the tone need to be dynamic? :)

For an example of processing the XML responses from things like 'show
channels' and hunting down the channel, getting its UUID and all of that
goodness, I have an example from last summer on my blog at 
http://www.0xdecafbad.com/index.php/2007/06/08/get-sample-rate-of-the-current-call-in-freeswitch  granted I havent tested that since I wrote that blog article, so if it doesnt work lemme know and I will fix it up (I know the xml subsystem has changed somewhat and I know that javascript *hates* the <?xml ...?> tag, basically it chokes and dies if it sees one, I dont know if that got added to the 'as xml' part of the apiexec stuff).



At any rate, either of these smoke and mirrors methods would give the
illusion of call waiting without actually implementing call waiting.


-- 
Trixter http://www.0xdecafbad.com     Bret McDanel
Belfast +44 28 9099 6461        US +1 516 687 5200
http://www.trxtel.com the phone company that pays you!




More information about the Freeswitch-dev mailing list