Ticket #179 (new defect)

Opened 11 months ago

Last modified 11 months ago

The way callbacks queued in cc_callback_spool prevent a2billing from going "at large"

Reported by: asiby Assigned to: areski
Priority: blocker Milestone: milestone Version 1.4
Component: AGI Version: Trunk 1.4
Keywords: large deployment bug callback Cc:

Description

By going at large, I mean for instance, having many A2Billing AGI on different boxes connected to a main box containing a2billing and the database. When scheduling a callback from any of the remote host, the a2billing AGI does is in a way that consider the IP of the server as being 'localhost'. This will instruct the main box to trigger the callback locally instead of sending it to the proper server who has requested the callback in a first place.

The guilty code has been identified in A2Billing's AGI script at line 511

$server_ip = 'localhost';

I believe that the variable $server_ip should get his value from a configured parameter. This way, it would be set to a string (host name, IP, or domain name) that can be effectively used to contact the box from another server.

Change History

01/08/08 08:18:14 changed by areski

no worries to have !

this is what we do in the AGI :

$QUERY = " INSERT INTO cc_callback_spool (uniqueid, status, server_ip, num_attempt, channel, exten, context, priority, variable, id_server_group, callback_time, account, callerid, timeout ) VALUES ('$uniqueid', '$status', '$server_ip', '$num_attempt', '$channel', '$exten', '$context', '$priority', '$variable', '$id_server_group', ADDDATE( CURRENT_TIMESTAMP, INTERVAL $sec_wait_before_callback SECOND ), '$account', '$callerid', '$timeout')";

we keep the server_ip, this is not used by the daemon.

the daemon retrieve the asterisk to use from get_server

@server_manager = &get_server($dbh_child, $id_server_group);

if (!(@server_manager)){

print LOGFILE " server_manager not find for the id_server_group= $id_server_group \n"; $QUERY = "UPDATE cc_callback_spool SET status='ERROR', last_attempt_time=now() WHERE id='$id'"; print LOGFILE "\n".$QUERY."\n"; $sth2 = $dbh_child->prepare($QUERY);

$sth2 -> execute(); $sth2 -> finish; #next; exit(0);

} $timestamp = &longfmt(); print LOGFILE "$timestamp\n";

$astman->user($server_manager[3]); $astman->secret($server_manager[4]); $astman->host($server_manager[1]);

but u made a point !!! $server_ip = 'localhost';

should contain the correct hostname to appear correctly in the Webcallback request list ;-)

Cheers, Areski

01/08/08 08:24:52 changed by areski

  • version changed from Stable 1.3.0 (Yellowjacket) to Trunk 1.4.
  • milestone changed from milestone Version 1.3 to milestone Version 1.4.

Indeed, we should remove server_ip from the trunk !!! this is not needed anymore :D

Rgds, Areski



Google