| 1222 | | $rate_cur = $rate / $mycur; |
|---|
| 1223 | | $cents = intval($rate_cur); |
|---|
| 1224 | | $units = round(($rate_cur - $cents) * 1E4); |
|---|
| 1225 | | while ($units != 0 && $units % 10 == 0) $units /= 10; |
|---|
| 1226 | | |
|---|
| 1227 | | // say 'the rate is' |
|---|
| 1228 | | //$agi->stream_file('the-rate-is'); |
|---|
| 1229 | | |
|---|
| 1230 | | $agi->say_number($cents); |
|---|
| 1231 | | if ($units > 0) { |
|---|
| 1232 | | $agi->stream_file('point'); |
|---|
| 1233 | | $agi->say_digits($units); |
|---|
| 1234 | | } |
|---|
| 1235 | | $agi->stream_file('cents-per-minute'); |
|---|
| | 1221 | $credit_cur = $rate / $mycur; |
|---|
| | 1222 | |
|---|
| | 1223 | list($units,$cents)=split('[.]', $credit_cur); |
|---|
| | 1224 | if (strlen($cents)>2) $cents=substr($cents,0,2); |
|---|
| | 1225 | if ($units=='') $units=0; |
|---|
| | 1226 | if ($cents=='') $cents=0; |
|---|
| | 1227 | elseif (strlen($cents)==1) $cents.= '0'; |
|---|
| | 1228 | |
|---|
| | 1229 | if (isset($this->agiconfig['currency_association_internal'][strtolower($this->currency)])){ |
|---|
| | 1230 | $unit_audio = $this->agiconfig['currency_association_internal'][strtolower($this->currency)]; |
|---|
| | 1231 | }else{ |
|---|
| | 1232 | $unit_audio = $this->agiconfig['currency_association_internal']['all']; |
|---|
| | 1233 | } |
|---|
| | 1234 | $cent_audio = 'prepaid-cents'; |
|---|
| | 1235 | |
|---|
| | 1236 | |
|---|
| | 1237 | // say 'the cost of the call is ' |
|---|
| | 1238 | $agi-> stream_file('prepaid-cost-call', '#'); |
|---|
| | 1239 | |
|---|
| | 1240 | if ($units==0 && $cents==0){ |
|---|
| | 1241 | $agi -> say_number(0); |
|---|
| | 1242 | $agi -> stream_file($unit_audio, '#'); |
|---|
| | 1243 | } else { |
|---|
| | 1244 | if ($units >= 1){ |
|---|
| | 1245 | $agi -> say_number($units); |
|---|
| | 1246 | $agi -> stream_file($unit_audio, '#'); |
|---|
| | 1247 | } |
|---|
| | 1248 | |
|---|
| | 1249 | if ($units > 0 && $cents > 0){ |
|---|
| | 1250 | $agi -> stream_file('vm-and', '#'); |
|---|
| | 1251 | } |
|---|
| | 1252 | if ($cents>0){ |
|---|
| | 1253 | $agi -> say_number($cents); |
|---|
| | 1254 | $agi -> stream_file($cent_audio, '#'); |
|---|
| | 1255 | } |
|---|
| | 1256 | } |
|---|
| | 1257 | // say 'per minutes' |
|---|
| | 1258 | $agi-> stream_file('prepaid-per-minutes', '#'); |
|---|