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
if you are lusing xml cdr, set the logging to both not just a or b legs, this will generate cdrs for all legs individually Ken Sent from my iPad On May 27, 2013, at 11:01, Jon Schøpzinsky <jos@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@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Funny, forkcdr.... Guess who made that ;) That was my early solution to billing problems that I later solved by writing FS! Yes ken is right, log the B legs too and you will see both ends of the call. Also look at xml cdrs and custom cdr bindings. On May 27, 2013 11:31 AM, "Ken Rice" <krice@freeswitch.org> wrote:
if you are lusing xml cdr, set the logging to both not just a or b legs, this will generate cdrs for all legs individually
Ken Sent from my iPad
On May 27, 2013, at 11:01, Jon Schøpzinsky <jos@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@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
My primary problem is that the legs inbetween the A leg and the C leg isnt actually bridged calls, but all done in dialplan, which makes the second scenario especially difficult. But I am going to try and code my way out if it, using api hooks and lua. That way i can get exactly what i need for the billing. /Jon ________________________________________ Fra: freeswitch-users-bounces@lists.freeswitch.org [freeswitch-users-bounces@lists.freeswitch.org] På vegne af Anthony Minessale [anthony.minessale@gmail.com] Sendt: 27. maj 2013 19:07 Til: FreeSWITCH Users Help Emne: Re: [Freeswitch-users] Splitting CDRs on call forward Funny, forkcdr.... Guess who made that ;) That was my early solution to billing problems that I later solved by writing FS! Yes ken is right, log the B legs too and you will see both ends of the call. Also look at xml cdrs and custom cdr bindings. On May 27, 2013 11:31 AM, "Ken Rice" <krice@freeswitch.org<mailto:krice@freeswitch.org>> wrote: if you are lusing xml cdr, set the logging to both not just a or b legs, this will generate cdrs for all legs individually Ken Sent from my iPad On May 27, 2013, at 11:01, Jon Schøpzinsky <jos@firstcom.dk<mailto:jos@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@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<mailto:FreeSWITCH-users@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.
This is a major can of worms. I have an comericial carrier softswitch based on FS, and what I did to be able to imlment billing the right legs to the right account was the following: Have a flag on your gateways so you can mark them as "pstn-uplink", or whatever you want to call it. This way you know that it's the "other" leg's endpoint is the entity you want to bill. Next, in your directory, make sure you set a variable for the user that has it's billing identity for example "myapp_user" or "myapp_account". If you use account then you can associate more then one user to the same account, if that's the way you're billing works. Now, if you make sure all calls to users, use the user/username@domain form of the dial string, you will also have the variable set on calls terminating to that user. Now you can bill, on normal calls both incoming calls (charge for DID usage) and outbound calls. When you get any inbound call from a gateway that's marked as "PSTN" then set a variable on that leg, when it calls a user, that indicates it's the PAID inbound leg for that user, before bridging to the "user" channel. To implment forwarding, in your processing of a call to a user, before bridging to the "user" channel, see if the users is forwarding, if so all you have to do, in your dialplan, or external code handling the dialplan is: "set_user to the user they called", then "transfer to: ${Forwarding_number} XML ${user_context}". Because you did the "set_user" first, the call will go back to CS_ROUTING, but look like it's from the user that did the forwarding. This way, if the call is from a gateway that isn't in the right context to dial the forwarding number, it won't matter, and the B-LEG will go through your dialplan logic, like the call is made form the user, and you can set a variable on the B_LEG in the dial string to tell it who the call is on behalf of, if it goes out a gateway that is marked as "PSTN". This way the same logic of how you tag the PSTN leg as being called from a user, is the same for a call made from the user, or forwared by the user. Since any users in the middle that are forwarding to internal numbers, it doesn't matter how many forwarding hops you go through, the original A-LEG if PSTN will get billed to the user it called, and the final B-LEG will get biled to the user that did the forwarding, that caused the call to leave your switch. --Dave _____ From: Jon Schøpzinsky [mailto:jos@firstcom.dk] To: FreeSWITCH Users Help [mailto:freeswitch-users@lists.freeswitch.org] Sent: Mon, 27 May 2013 09:01:49 -0700 Subject: [Freeswitch-users] Splitting CDRs on call forward 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@freeswitch.org http://www.freeswitchsolutions.com FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Hello Dave, The main problem isnt really the first scenario, as only the last leg needs to be billed. The biggest issue is with the second scenario, since both calls need to be billed, as theres two billing entities involved. I am also not using the FreeSWITCH directory, as the authentication and registration are handled by an upstream OpenSIPS instead. But thank you for the very thorough description. Its definitely inspiring working towards a solution. Right now im leaning towards using hooks, and taking care of the billing in lua, instead of using the internal CDR system. That way i can get it exactly as i want it :) /Jon ________________________________________ Fra: freeswitch-users-bounces@lists.freeswitch.org [freeswitch-users-bounces@lists.freeswitch.org] På vegne af Dave R. Kompel [drk@drkngs.net] Sendt: 27. maj 2013 18:58 Til: FreeSWITCH Users Help Emne: Re: [Freeswitch-users] Splitting CDRs on call forward This is a major can of worms. I have an comericial carrier softswitch based on FS, and what I did to be able to imlment billing the right legs to the right account was the following: Have a flag on your gateways so you can mark them as "pstn-uplink", or whatever you want to call it. This way you know that it's the "other" leg's endpoint is the entity you want to bill. Next, in your directory, make sure you set a variable for the user that has it's billing identity for example "myapp_user" or "myapp_account". If you use account then you can associate more then one user to the same account, if that's the way you're billing works. Now, if you make sure all calls to users, use the user/username@domain<mailto:user/username@domain> form of the dial string, you will also have the variable set on calls terminating to that user. Now you can bill, on normal calls both incoming calls (charge for DID usage) and outbound calls. When you get any inbound call from a gateway that's marked as "PSTN" then set a variable on that leg, when it calls a user, that indicates it's the PAID inbound leg for that user, before bridging to the "user" channel. To implment forwarding, in your processing of a call to a user, before bridging to the "user" channel, see if the users is forwarding, if so all you have to do, in your dialplan, or external code handling the dialplan is: "set_user to the user they called", then "transfer to: ${Forwarding_number} XML ${user_context}". Because you did the "set_user" first, the call will go back to CS_ROUTING, but look like it's from the user that did the forwarding. This way, if the call is from a gateway that isn't in the right context to dial the forwarding number, it won't matter, and the B-LEG will go through your dialplan logic, like the call is made form the user, and you can set a variable on the B_LEG in the dial string to tell it who the call is on behalf of, if it goes out a gateway that is marked as "PSTN". This way the same logic of how you tag the PSTN leg as being called from a user, is the same for a call made from the user, or forwared by the user. Since any users in the middle that are forwarding to internal numbers, it doesn't matter how many forwarding hops you go through, the original A-LEG if PSTN will get billed to the user it called, and the final B-LEG will get biled to the user that did the forwarding, that caused the call to leave your switch. --Dave ________________________________ From: Jon Schøpzinsky [mailto:jos@firstcom.dk] To: FreeSWITCH Users Help [mailto:freeswitch-users@lists.freeswitch.org] Sent: Mon, 27 May 2013 09:01:49 -0700 Subject: [Freeswitch-users] Splitting CDRs on call forward 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@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com<http://www.freeswitchsolutions.com/> FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com<http://www.cudatel.com/> Official FreeSWITCH Sites http://www.freeswitch.org<http://www.freeswitch.org/> http://wiki.freeswitch.org<http://wiki.freeswitch.org/> http://www.cluecon.com<http://www.cluecon.com/> FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org<http://www.freeswitch.org/> -- This message has been scanned for viruses and dangerous content, and is believed to be clean.
Yes, I understand that. The method I gave you works for all cases, and you don't have to have a lot of special code for each case. It's much easier to have the logic once, and that way as your application grows, and needs to be changed, it's a lot easier. --Dave _____ From: Jon Schøpzinsky [mailto:jos@firstcom.dk] To: FreeSWITCH Users Help [mailto:freeswitch-users@lists.freeswitch.org] Sent: Mon, 27 May 2013 11:29:10 -0700 Subject: Re: [Freeswitch-users] Splitting CDRs on call forward Hello Dave, The main problem isnt really the first scenario, as only the last leg needs to be billed. The biggest issue is with the second scenario, since both calls need to be billed, as theres two billing entities involved. I am also not using the FreeSWITCH directory, as the authentication and registration are handled by an upstream OpenSIPS instead. But thank you for the very thorough description. Its definitely inspiring working towards a solution. Right now im leaning towards using hooks, and taking care of the billing in lua, instead of using the internal CDR system. That way i can get it exactly as i want it :) /Jon ________________________________________ Fra: freeswitch-users-bounces@lists.freeswitch.org [freeswitch-users-bounces@lists.freeswitch.org] På vegne af Dave R. Kompel [drk@drkngs.net] Sendt: 27. maj 2013 18:58 Til: FreeSWITCH Users Help Emne: Re: [Freeswitch-users] Splitting CDRs on call forward This is a major can of worms. I have an comericial carrier softswitch based on FS, and what I did to be able to imlment billing the right legs to the right account was the following: Have a flag on your gateways so you can mark them as "pstn-uplink", or whatever you want to call it. This way you know that it's the "other" leg's endpoint is the entity you want to bill. Next, in your directory, make sure you set a variable for the user that has it's billing identity for example "myapp_user" or "myapp_account". If you use account then you can associate more then one user to the same account, if that's the way you're billing works. Now, if you make sure all calls to users, use the user/username@domain<mailto:user/username@domain> form of the dial string, you will also have the variable set on calls terminating to that user. Now you can bill, on normal calls both incoming calls (charge for DID usage) and outbound calls. When you get any inbound call from a gateway that's marked as "PSTN" then set a variable on that leg, when it calls a user, that indicates it's the PAID inbound leg for that user, before bridging to the "user" channel. To implment forwarding, in your processing of a call to a user, before bridging to the "user" channel, see if the users is forwarding, if so all you have to do, in your dialplan, or external code handling the dialplan is: "set_user to the user they called", then "transfer to: ${Forwarding_number} XML ${user_context}". Because you did the "set_user" first, the call will go back to CS_ROUTING, but look like it's from the user that did the forwarding. This way, if the call is from a gateway that isn't in the right context to dial the forwarding number, it won't matter, and the B-LEG will go through your dialplan logic, like the call is made form the user, and you can set a variable on the B_LEG in the dial string to tell it who the call is on behalf of, if it goes out a gateway that is marked as "PSTN". This way the same logic of how you tag the PSTN leg as being called from a user, is the same for a call made from the user, or forwared by the user. Since any users in the middle that are forwarding to internal numbers, it doesn't matter how many forwarding hops you go through, the original A-LEG if PSTN will get billed to the user it called, and the final B-LEG will get biled to the user that did the forwarding, that caused the call to leave your switch. --Dave ________________________________ From: Jon Schøpzinsky [mailto:jos@firstcom.dk] To: FreeSWITCH Users Help [mailto:freeswitch-users@lists.freeswitch.org] Sent: Mon, 27 May 2013 09:01:49 -0700 Subject: [Freeswitch-users] Splitting CDRs on call forward 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@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com<http://www.freeswitchsolutions.com/> FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com<http://www.cudatel.com/> Official FreeSWITCH Sites http://www.freeswitch.org<http://www.freeswitch.org/> http://wiki.freeswitch.org<http://wiki.freeswitch.org/> http://www.cluecon.com<http://www.cluecon.com/> FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org<http://www.freeswitch.org/> -- This message has been scanned for viruses and dangerous content, and is believed to be clean. _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
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@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@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
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@lists.freeswitch.org [freeswitch-users-bounces@lists.freeswitch.org] På vegne af Cal Leeming [Simplicity Media Ltd] [cal.leeming@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@firstcom.dk<mailto:jos@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@freeswitch.org<mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org<mailto:FreeSWITCH-users@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.
Hi Jon, I've just finished part #1 of my write up on ways to make multi-tenant SIP testing less tedious. Have a read over at; http://blog.simplicitymedialtd.co.uk/533/quick-and-easy-approach-for-multi-t... If you haven't got time to read, just take a look at this instead; http://i.imgur.com/e9kUdxg.jpg Hope this helps Cal On Mon, May 27, 2013 at 5:01 PM, Jon Schøpzinsky <jos@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@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (5)
-
Anthony Minessale
-
Cal Leeming [Simplicity Media Ltd]
-
Dave R. Kompel
-
Jon Schøpzinsky
-
Ken Rice