[Freeswitch-users] Call with failover

Stanisław Pitucha viraptor at gmail.com
Sun Jul 10 01:11:13 MSD 2011


Hi all,
I've got a simple problem to solve that doesn't seem to be so simple
to execute. For some incoming call, I'd like to call one destination,
then if it fails (user not registered / busy / any other failure) call
another destination. Both destinations should be arbitrary, but for
now I'm ok with the first being set to a `user/...`. Second needs to
be sent through the dialplan (might need setting billing details,
etc.), or might be another user.

At the moment, I'm sending the call to "user/...|loopback/.../..." -
which often results in the call being simply hungup right after
loopback answers.
>From #freeswitch I learned that loopback can do that (still don't
understand it, didn't find any related bug either) and I should use
xml_curl or event sockets - but no real examples. So after doing a bit
of research, I run into the following problems:

- If I use dialplan via xml curl, I would either need to pass the
control back to some other context (using loopback seems to be the
only option), or compute all parameters in one go and do a transfer to
the final set of destinations (not possible in every case)

- If I use eventsocket, how can I react to the connection failure? It
seems that I will only get an event about the hangup and the channel
will disappear on its own. Is there even a way to do a "on hangup, do
this before anything else happens"?

Are there any examples of a similar scenario on the web? Any links /
longer explanations would be appreciated.

PS. is it defined somewhere why/when does loopback destroy the call on
accepted connection?

-- 
KTHXBYE,

Stanisław Pitucha



More information about the FreeSWITCH-users mailing list