Ticket #188 (new defect)

Opened 10 months ago

Last modified 6 months ago

Possible bug in Class.RateEngine.php

Reported by: asiby Assigned to: areski
Priority: minor Milestone: milestone Version 1.3
Component: AGI Version: Stable 1.3.2 (Yellowjacket)
Keywords: Cc:

Description

In Class.RateEngine?.php, the following code is being used in v1.3.2

		if(($A2B->mode == 'cid-callback') || ($A2B->mode == 'all-callback')){
			$callbackrate['rateinitial']=$rateinitial;
			$callbackrate['initblock']=$initblock;
			$callbackrate['billingblock']=$billingblock;
			$callbackrate['connectcharge']=$connectcharge;
			$callbackrate['disconnectcharge']=$disconnectcharge;
			$callbackrate['stepchargea']=$stepchargea;
			$callbackrate['timechargea']=$timechargea;
			$callbackrate['stepchargeb']=$stepchargeb;
			$callbackrate['timechargeb']=$timechargeb;
			$callbackrate['stepchargec']=$stepchargec;
			$callbackrate['timechargec']=$timechargec;
		}

The keys of the $callbackrate array have been changed to a longer format. They used to be:

		if($A2B->mode == 'cid-callback'){
			$callbackrate['ri'] = $rateinitial;
			$callbackrate['ib'] = $initblock;
			$callbackrate['bb'] = $billingblock;
			$callbackrate['cc'] = $connectcharge;
			$callbackrate['dc'] = $disconnectcharge;
			$callbackrate['sc_a'] = $stepchargea;
			$callbackrate['tc_a'] = $timechargea;
			$callbackrate['c_a'] = $chargea;
			$callbackrate['bb_a'] = $billingblocka;
			$callbackrate['sc_b'] = $stepchargeb;
			$callbackrate['tc_b'] = $timechargeb;
			$callbackrate['c_b'] = $chargeb;
			$callbackrate['bb_b'] = $billingblockb;
			$callbackrate['sc_c'] = $stepchargec;
			$callbackrate['tc_c'] = $timechargec;
			$callbackrate['c_c'] = $chargec;
			$callbackrate['bb_c'] = $billingblockc;
		}

I would like to draw your attention not on the number of keys, but on their length (a few letters vs human readable whole word).

I have tested noticed confirmed that the total length of the variable string is limited and maybe cause problems when it reaches 250.

Check my comment here: http://voip-info.org/wiki/index.php?page=Asterisk%20Manager%20API%20Action%20Originate

I thought I would let you know just in case people start noticing things in the future.

Change History

01/28/08 00:56:48 changed by areski

yes true, I experienced the same issue! we can also do a concatenation of all the $callbackrate in 1 single variable $callbackraterateinitial?."|".$callbackrateinitblock?."|".$callbackrateinitblock?."|". etc...

that will prevent us to use the key inside VARIABLE string.

thoughts ?

01/28/08 08:45:47 changed by asiby

I know what you mean Areski, and it sounds good. But the field separator in the single variable must be different than | cause this one is used by asterisk. We can use something unusual like or & or && or &&&

01/28/08 08:50:34 changed by areski

that s work for me ;-)

04/28/08 06:23:57 changed by areski

did we clear this bug ?

04/29/08 03:54:11 changed by areski

any updates ?

06/02/08 06:39:37 changed by stavros

Asiby, have you made any progress with this?



Google