Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Wed Feb 19, 2020 4:26 pm
Auto Dialer Software

All times are UTC

Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: Sun Feb 08, 2009 9:51 pm 

Joined: Mon Jan 28, 2008 1:58 pm
Posts: 9
Location: Buenos Aires, Argentina
Hola !

I just want to show how this "patch" was finally done in case somebody has something similar to do.

Class.A2Billing.php file:

In the A2Billing Class the public var $conTonoA was added in order to be read from ClassRateEngine.php.


$Q = "SELECT ani FROM Anis where ani='".$ani."' AND tipo='TonoA'";

if ($this->agiconfig['debug']>=1) $agi->verbose($Q);
$resultadoa = $this->instance_table -> SQLExec ($this->DBHandle, $Q);

if ($this->agiconfig['debug']>=1) $agi->verbose($result);
$this->write_log("Debug info:  TonoA query {$Q}:  $resultadoa");

if($resultadoa != 0){
  $this->write_log("DTMF A has to be sended");
  // The following var is going to be read in  Clase RateEngine

In ClassRateEngine.php:


$prefix                 = $this -> ratecard_obj[$k][$usetrunk+1];
$tech                   = $this -> ratecard_obj[$k][$usetrunk+2];
$ipaddress              = $this -> ratecard_obj[$k][$usetrunk+3];
$removeprefix   = $this -> ratecard_obj[$k][$usetrunk+4];
$timeout                = $this -> ratecard_obj[$k]['timeout'];
$musiconhold    = $this -> ratecard_obj[$k][39];
$failover_trunk = $this -> ratecard_obj[$k][40+$usetrunk_failover];
$addparameter   = $this -> ratecard_obj[$k][42+$usetrunk_failover];

if (strncmp($destination, $removeprefix, strlen($removeprefix)) == 0)
  $destination= substr($destination, strlen($removeprefix));

$dialparams = str_replace("%timeout%", $timeout *1000, $A2B->agiconfig['dialcommand_param']);

// Dial() Modification either for Jail originated calls or Calls where DTMF A // has to be played. Matias Rollan Patch

$paracarcel = $A2B->escarcel;
if($paracarcel == 'pacific'){ // Jail msg
$stringdial = "A($paracarcel)";
$A2B -> write_log("Debug: StringDial $stringdial");
$dialparams = str_replace("%carcel%", $paracarcel, $dialparams);
$A2B->write_log("Debug: Parameter: $dialparams");
  // DTMF A to be played
   $mitonoA = $A2B->esTonoA;
   if($mitonoA == 'si'){
      $A2B -> write_log("Debug: DTMF A is going to be added to Dial()");
      $tono = "D(wAA:wAA)";   // DTMF As
      $dialparams = str_replace("%carcel%", $tono, $dialparams);
      $A2B->write_log("Debug: Dialparams $dialparams");
        $dialparams = str_replace("%carcel%", '', $dialparams);
        $A2B->write_log("Debug: Regular Dial() : $dialparams");


And as in my first post regarding the Jail message I change the /etc/asterisk/a2billing.conf the Dial() line:


So everytime a call is originated from the CallerIDs listed in Anis table with tipo field equal to:

- 'carcel' the A(audio_file_for_jail) is replaced in the Dial
- 'TonoA' the D(wAA:wAA) is concatenated in the Dial

The coding is ugly but is working perfectly well in my platform I just wanted to share it.

Matias Rollan
<[email protected]> || <[email protected]>[/code][/quote]

 Post subject: Question about the A(audio_file)
PostPosted: Thu Mar 26, 2009 6:59 am 

Joined: Thu Nov 06, 2008 7:09 pm
Posts: 37
Is there a simple way to assign a:
dialcommand_param = "|60|HRrgL(%timeout%:61000:30000)A(audio_file)"

To a specific Rate card or even trunk? (would work best prob by rate card)

 Post subject:
PostPosted: Thu Mar 26, 2009 1:32 pm 
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
Yes, but it involves writing some PHP.

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2
Auto Dialer Software

All times are UTC

Who is online

Users browsing this forum: No registered users and 3 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