[Freeswitch-users] Splitting CDRs on call forward

Jon Schøpzinsky jos at firstcom.dk
Mon May 27 22:35:40 MSD 2013


A certain amount of banging heads against walls has already happened, because as you said, its actually pretty basic, but theres so many scenarios to consider that it gets advanced, fast.

But at least its fun with FreeSWITCH :)

/Jon
________________________________________
Fra: freeswitch-users-bounces at lists.freeswitch.org [freeswitch-users-bounces at lists.freeswitch.org] På vegne af Cal Leeming [Simplicity Media Ltd] [cal.leeming at simplicitymedialtd.co.uk]
Sendt: 27. maj 2013 19:16
Til: FreeSWITCH Users Help
Emne: Re: [Freeswitch-users] Splitting CDRs on call forward

You have to identify the correct headers dependent on the call context (i.e. which leg did the bridge/forward, the originatee/originator etc).

Personally I've found that attaching custom headers onto each leg is the best way to keep track things - but like Dave said, this really is a can of worms.

It took me approx 6 months of various code iterations to eventually figure out a way to do this that was suitable for our use case. Several people have said to me "Cal, it's harder than it looks"... tbh it isn't, it's just that the variables and API aren't exposed in a typically sane fashion, and there is no definitive guide on the patterns to look for or best practices. In short, it isn't complex, but it might make you bang your head off a wall out of sheer frustration.

You need to ensure you compensate for both blind and attended transfers, and consider what happens if a transfer goes between two domains.. that's when things get really sticky :)

Cal

On Mon, May 27, 2013 at 5:01 PM, Jon Schøpzinsky <jos at firstcom.dk<mailto:jos at firstcom.dk>> wrote:
Hi List,

I am implementing call forwarding on a multi tenant system, and therefore
need to split CDR's when the call forward happens, so that if the
receiving user also has his account call forwarded, he pays for his part
of the call.

A calls B
B forwards to C
C forwards to an external mobile phone.

B has a free call from B to C, but C needs to pay for the forwarding to
the mobile phone. Therefore i need a separate CDR for the C to Mobile
phone call.

Another example would be this

A works in Company A, and B works in Company B
They are both users on our system, and therefore is on the same freeswitch.

A calls B
B Forwards to an external mobile phone.

Here A needs to pay for the call from A to B, and B needs to pay for the
call being forwarded to his mobile phone.

Do anybody have an idea as to how to implement this in freeswitch. Back in
my Asterisk days, this would be done by the ForkCDR command.


Venlig hilsen/kind regards

Jon Leren Schøpzinsky


_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting at freeswitch.org<mailto:consulting at freeswitch.org>
http://www.freeswitchsolutions.com




Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com

FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org<mailto:FreeSWITCH-users at lists.freeswitch.org>
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


--
This message has been scanned for viruses and dangerous content, and is believed to be clean.



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