[Freeswitch-users] Hangup hooks on B legs

Isaac Jurado ijurado at econcept.es
Thu Aug 4 00:00:57 MSD 2011


On Wed, Aug 3, 2011 at 9:36 PM, Michael Collins <msc at freeswitch.org> wrote:
>
> Just remember that once the call ends, the "session" object you have
> is read-only.

Good to know.

> You can still do interesting things, but you cannot alter CDRs after
> the call ends, at least not in a session hangup hook.

These days we are trying to modify other channels variables from the
hangup hook (channels like the ones involved in whatever kind of
transfer).

> You are better off with XML CDRs and post-call logic. With all of the
> screwy transfer scenarios you have to account for you will absolutely
> need to do some post-processing logic. Sounds like lots of "fun". :P

Fun indeed.  Our ideal target would be to have each CDR self-contained.
In general, we only want to bill the A-leg CDRs as they are the
originators.  However, some B-leg CDRs need to be billed if they were
created by a transfer and some A-leg CDRs can be discarded if they
participated in an attended transfer.

As you rightfully mentioned, when transfers are chained is where the
obscure scenarios arise.

If our experiments provide a working proof of concept, we have two
choices left:

    1. Subscribe to CHANNEL_STATE events in order to catch transfer
       directly from event socket.  But we would be mixing mod_xml_cdr,
       mod_xml_curl and event socket altogether, so we want to avoid
       that.

    2. Forget about stateless CDRs and pray (or inspect the source code)
       for mod_xml_cdr generating originator CDRs last, always.

If anybody is interested, I can keep him/her informed.

Cheers.

-- 
Isaac Jurado
Internet Busines Solutions eConcept



Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list