asterisk2billing.org
http://forum.asterisk2billing.org/

callback.php trimming wrong
http://forum.asterisk2billing.org/viewtopic.php?f=16&t=4926
Page 1 of 1

Author:  hellbound [ Thu Feb 26, 2009 4:01 am ]
Post subject:  callback.php trimming wrong

Hi,


using ereg_replace will replace any 00 in any part of dialed or caller number which will result failure. changing line 50 to following will solve it:


Code:
   if ((substr($called,0,2))=="00") {
      $called=substr($called,2);
   }
   
   if ((substr($calling,0,2))=="00") {
      $calling=substr($calling,2);
   }


good luck

Author:  stavros [ Thu Feb 26, 2009 3:15 pm ]
Post subject: 

You need to brush up on your regexes: the '^' limits matches to the start of the string.

Author:  hellbound [ Thu Feb 26, 2009 6:05 pm ]
Post subject: 

stavros wrote:
You need to brush up on your regexes: the '^' limits matches to the start of the string.


I tried it and it will take it from end of it


try a number like : 00123232300

see what happens

Author:  stavros [ Thu Feb 26, 2009 6:28 pm ]
Post subject: 

It works as expected for me:
Code:
$ php -a
Interactive shell

php > $calling = "00123232300";
php > print $calling;
00123232300

php > $calling=ereg_replace("^00","011",$calling);
php > print $calling;
011123232300

Author:  hellbound [ Thu Feb 26, 2009 6:50 pm ]
Post subject: 

nope,
not the line that is replacing 011,
try the line that is replacing 00 to nothing,
I tried form callback.php and i had the bug for sure.

thanks

Author:  stavros [ Thu Feb 26, 2009 8:12 pm ]
Post subject: 

In A2BCustomer_UI/callback.php (current branches/1.3 version) I can't see anything which rewrites '00' to ''. Which file and version are you referring to please?

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/