Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Wed Sep 18, 2019 9:58 pm
Voice Broadcast System


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 
Offline

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.

Code:

$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
  $this->esTonoA='si';                               
}



In ClassRateEngine.php:

Code:

$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");
}else{
  // 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");
    }else{
        $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:

Code:
dialcommand_param="|45|rHL(%timeout%:61000:00000)%carcel%"


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]


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

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)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 26, 2009 1:32 pm 
Offline
Moderator
User avatar

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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2
Hosted Voice Broadcast


All times are UTC


Who is online

Users browsing this forum: No registered users and 4 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group