[Freeswitch-users] Problem accessing channel variables

Richard Gration richgration at gmail.com
Thu Nov 29 14:58:58 MSK 2012


Hi,

Thanks for your reply. I was wondering ...

> If you listen to events then you should be able to reliably receive a hangup
> event containing the variables if you are still connected at that time.

... how I listen for these events. Is it just a case of polling the
socket for them at frequent enough intervals?

> If you want a 100% reliable method use CDRs.
>
> mod_xml_cdr can submit call CDRs to a webserver just after call hangup. The
> XML is verbose and will contain a full call history and all channel
> variables. Because it's submitted ASAP you get the results in real time and
> reliable. If the module can't submit the CDRs it writes them to an error
> folder on disk where you can resubmit them.
>
> Real time seems useful for your use-case, as your script would just need to
> check your DB whether the CDR had been submitted yet. The channel UUID can
> either be captured from events or specified in advance in the originate
> (originate_uuid). There's a uuid api call to generate them for you. I'd
> suggest looking at this method.

This is all great info, thanks :-) I'm capturing the uuid from the
response from the originate command, that's no problem.

The box I'm doing this on is being a B2BUA for us at the moment. The
CDRs are already being HTTP POSTed to a URL, I can't change that as
our billing depends on it. I can see the channel variable coming
though in the POST content, so maybe I can frob the CDR script to give
me what I want.

Thanks again for the info.

Cheers,
Rich

-- 
Once our basic material needs are met - in my utopia, anyway - life
becomes a perpetual celebration in which everyone has a talent to
contribute. But we cannot levitate ourselves into that blessed
condition by wishing it. We need to brace ourselves for a struggle
against terrifying obstacles, both of our own making and imposed by
the natural world. And the first step is to recover from the delusion
that is positive thinking.
       -- Barbara Ehrenreich



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