[OpenSIPS-Users] [PATCHes] support for text message billing	with callcontrol
    Adrian Georgescu 
    ag at ag-projects.com
       
    Tue Oct 16 10:54:20 CEST 2012
    
    
  
Hi Paul,
I have reviewed the patch but is not going to be included the way it is currently written. The patch mixes in the same code path audio calls with text messages while the logic for them are completely different. In case of a message, there is nothing to start or to stop, no MaxSessionTime needs to be called in the rating engine either, is just a one shot DebitBalance operation.
OpenSIPS configuration 
It should read something like:
if (is_method("MESSAGE")) {
    debit_sms_balance();
    switch ($retcode) {
    case -1:
        xlog("L_INFO", "Call control: not enough credit for debit balance\n");
        sl_send_reply("402", "Not enough credit");
        exit;
    else allow message
       ...
Communication with Rating Engine
This should be a single debit balance function call instead of doing call_control_start() and call_control_sop() immediately after each other, which makes little to no sense.  CDRTool already implements this SMS debit interface and is able to debit the balance based on its rating tables. 
DebitBalance To=user at Domain  From=number at domain application=SMS
If you are willing to modify it the patch along these lines we can advise further how and then we shall include it.
Regards,
Adrian
On Oct 14, 2012, at 8:53 AM, Paul Wise wrote:
> Hi all,
> 
> At my last job we developed text messaging via SIP and OpenSIPS,
> including billing with callcontrol. The company is now defunct and my
> ex-boss has asked that I contribute these patches to OpenSIPS and
> callcontrol. I've updated our patches so they apply to OpenSIPS SVN
> trunk and callcontrol darcs head. The patches are attached, hopefully
> they are useful to someone. To use them you want something like this:
> 
> if (is_method("MESSAGE")) {
> 	your SMS sending function here
> 	if( $avp(s:sms_status) == "accepted" ){
> 		call_control_start();
> 		call_control_stop();
> 		t_reply("200", "OK");
> 		exit;
> 	} else {
> 		call_control_stop();
> 		t_reply("500", "Error sending SMS");
> 		exit;
> 	}
> }
> 
> -- 
> bye,
> pabs
> 
> http://bonedaddy.net/pabs3/
> <callcontrol-text-billing.patch><opensips-text-billing.patch>_______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20121016/06e726db/attachment.htm>
    
    
More information about the Users
mailing list