Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Tue Apr 16, 2024 7:37 am
Hosted Voice Broadcast


All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: CLID Sanitize
PostPosted: Tue Feb 28, 2012 2:24 am 
Offline

Joined: Thu Nov 03, 2011 11:12 pm
Posts: 18
Is this feature broken at the moment?

I'm using 1.9.4 my upstream provider allows me to set whatever CLID I wish. My problem is how do I stop my clients setting whatever CLID they like. I assumed this was what the CLID Sanitize feature did but it seems that even with it set to CID and with CID's attached to the customer account, it can be set to anything and goes through. Thats using SIP IP authentication BTW.

TIA

Daz


Top
 Profile  
 
 Post subject: Re: CLID Sanitize
PostPosted: Tue Feb 28, 2012 12:32 pm 
Offline

Joined: Thu Nov 03, 2011 11:12 pm
Posts: 18
Scratch that, don't know what setting I have changed but now it works absolutely perfectly :)


Top
 Profile  
 
 Post subject: Re: CLID Sanitize
PostPosted: Fri Mar 09, 2012 9:31 pm 
Offline

Joined: Thu Aug 25, 2011 9:03 pm
Posts: 8
I think it _is_ broken. At least, sanitizing on DID is. So here's my discovery:

cid_sanitize: DID

Is set in my database and a bunch of DIDs are nicely assigned to customers. However, when the call was being made it was presenting the card ID as the caller ID. Sure, I could add whatever I wanted under the SIP settings for each voip account but that defeats the object of an automated system. So debugging and verbosity galore, and I discovered that:

1. The Class.A2Billing.php script does spot that I'm sanitizing based on DID.
2. It does a query
3. It returns 0 in the array, not the DID assigned.

So MySQL commands and a long story short but there are two typos near each other in Class.A2Billing.php. In v1.9.4 the first is at line 2361 and the second just below on 2363.

The SQL to check the validity of the card as the 'greater than or equal to' symbol in its 'handwritten' not SQL format and there is a space missing for the 'ORDER by' bit. So...

original line 2361

Code:
" WHERE (cc_did.activated=1 OR cc_did.activated='t') AND cc_did_destination.activated=1 AND cc_did.startingdate <= NOW() AND cc_did.expirationdate => NOW()".


becomes

Code:
" WHERE (cc_did.activated=1 OR cc_did.activated='t') AND cc_did_destination.activated=1 AND cc_did.startingdate <= NOW() AND cc_did.expirationdate >= NOW()".


original line 2363

Code:
$QUERY .= "ORDER BY 1";


becomes

Code:
$QUERY .= " ORDER BY 1";


I hope this helps you all. Easiest thing in the world for someone to write a patch to. Or just do it manually.


cw


Top
 Profile  
 
 Post subject: Re: CLID Sanitize
PostPosted: Sun Aug 12, 2012 1:51 am 
Offline
User avatar

Joined: Fri Sep 18, 2009 5:46 pm
Posts: 132
Location: hhhhmmmmm
CID works without any change but DID after your patch still the same, it comes are unknow.


Top
 Profile  
 
 Post subject: Re: CLID Sanitize
PostPosted: Thu Jul 18, 2013 10:27 pm 
Offline

Joined: Thu Aug 25, 2011 9:03 pm
Posts: 8
OK for anyone still stuck with this problem...the code doesn't appear to set the caller id if no DID is found. So you can add it:

Code:
$agi->set_callerid("00000000000");
$this -> debug( DEBUG, $agi, __FILE__, __LINE__, "[CANNOT SetCallerID : cid_san is empty and set to unknown]");


I did the zeros as that was the only way I could get my carrier to give 'withheld/private number' status. Otherwise they were sending out a default number of theirs. I could have set the zeros in the config too, or one of my own numbers.

If your carrier treats blank strings as private numbers you should be fine with the code below.

Code:
$agi->set_callerid($cid_sanitized);
$this -> debug( DEBUG, $agi, __FILE__, __LINE__, "[CANNOT SetCallerID : cid_san is empty and set to unknown]");


This is all around line 2142 in v194


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 
Predictive Dialer


All times are UTC


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group