Ola.<br /><br />Pessoal tem ocorrido uma coisa bem estranha comigo com a2billing.<br />Em outro server nosso tudo ok, mas nesse que instalamos o asterisk svn e a2billing 1.7.1 ocorre que, após criado os rates, etc ele  funciona perfeito..<br />Mas ele bilheta somente quando aparece na grid a Terminete Cause (TC) 0 answar, busy, cancel, etc..<br /><br />Se não aparecer, ele lista a chamada sem o TC e o valor juntamnte com a duração da chamada aparecem zerados.<br />Vou alongar o email para ter maiores detalhes a voces.<br />O que me deixa grilada Ã© que isso ocorre em 5 chamadas, depois uma dá certo.. e depois 5 erradas, duas certas.. etc.. :P<br /><br />Pude observar tambem no debug que quando ele da certo Ã© porque aparentemente quando desligo a chamada ainda ele continua executando o restante do script do agi. <br /><br />Veja que na 4. não bilhetou e não marcou a duração Â mesmo eu ficando 1 minuto ao telefone.<br /><br />
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr onmouseover="bgColor='#C4FFD7'" onmouseout="bgColor='#FFFFFF'" bgcolor="#ffffff">
<td class="tableBody">4. </td>
<td class="tableBody" align="center" valign="top">2010-08-27 02:51:00</td>
<td class="tableBody" align="center" valign="top">53377</td>
<td class="tableBody" align="center" valign="top">00551183344485</td>
<td class="tableBody" align="center" valign="top">Brazil</td>
<td class="tableBody" align="center" valign="top">00:00</td>
<td class="tableBody" align="center" valign="top"> </td>
<td class="tableBody" align="center" valign="top">STANDARD</td>
<td class="tableBody" align="center" valign="top">0.000 USD</td>
<td class="tableBody" align="center" valign="top"> </td>
</tr>
<tr onmouseover="bgColor='#C4FFD7'" onmouseout="bgColor='#F2F8FF'" bgcolor="#f2f8ff">
<td class="tableBody">5. </td>
<td class="tableBody" align="center" valign="top">2010-08-27 02:50:36</td>
<td class="tableBody" align="center" valign="top">53377</td>
<td class="tableBody" align="center" valign="top">00551183344485</td>
<td class="tableBody" align="center" valign="top">Brazil</td>
<td class="tableBody" align="center" valign="top">00:07</td>
<td class="tableBody" align="center" valign="top">ANSWER</td>
<td class="tableBody" align="center" valign="top">STANDARD</td>
<td class="tableBody" align="center" valign="top">0.185 USD</td>
</tr>
</tbody>
</table>
<br /><br />E quando da errado ele não executa o restante.<br />Vou colocar abaixo o debug de quando fica certo e quando fica errado.<br /><br />Copiei o a2billing.php (agi) do servidor que funciona no outro servidor para este mas mesmo assim ocorre o erro.<br />Ja mechi no dial do agi deixando como no outro servidor e nada tb.<br />As rotas existem e esta tudo criado corretamente pois hora bileta a mesma chamada hora não.<br /><br />Nos dial ficou assim todos:<br />|60|iL(3600000:61000:30000)<br />|60|HiL(%timeout%:61000:30000) <br /><br />Quando mesmo atendida aparecem zeradas a duração e consequentemente o valor da chamda.<br /><br />...<br /><br />  a2billing.php: file:Class.RateEngine.php - line:1253 - uniqueid:1282930529.132 - app_callingcard: CIDGROUPID='-1' OUTBOUND CID SELECTED IS '0'.<br />  a2billing.php: file:Class.RateEngine.php - line:1148 - uniqueid:1282930529.132 - [TRUNK STATUS UPDATE : UPDATE cc_trunk SET inuse=inuse+1 WHERE id_trunk='4']<br />  Â
   -- AGI Script Executing Application: (DIAL) Options: (sip/provedor/00551183344485|60|HiL(2760000:61000:30000))<br />    -- Limit Data for this call:<br />       &gt; timelimit      = 2760000<br />       &gt; play_warning   = 61000<br />       &gt; play_to_caller = yes<br />       &gt; play_to_callee = no<br />       &gt; warning_freq   = 30000<br />       &gt; start_sound    =<br />       &gt; warning_sound  = timeleft<br />       &gt; end_sound      =<br />    -- Called provedor/00551183344485<br />    -- SIP/provedorcall-00000085 is making progress passing it to SIP/53377-00000084<br />  == Spawn extension (a2billing, 551183344485, 3) exited non-zero on 'SIP/53377-00000084'<br /><br /><strong>Sendo assim quando desligo ele para por aqui não ocorrendo mais nada! Não ocorre mais nada.</strong><br />---------------------------------------------------------------------------<br /><br />AQUI Ã‰ QUAN
 DO DA CERTO.. VEJA QUE DEPOIS QUE DESLIGO A CHAMADA ELE ACABA O AGI<br />a2billing.php: file:Class.RateEngine.php - line:1148 - uniqueid:1282931233.136 - [TRUNK STATUS UPDATE : UPDATE cc_trunk SET inuse=inuse+1 WHERE id_trunk='2']<br />    -- AGI Script Executing Application: (DIAL) Options: (sip/provedor/00551183344485|60|HiL(2760000:61000:30000))<br />    -- Limit Data for this call:<br />       &gt; timelimit      = 2760000<br />       &gt; play_warning   = 61000<br />       &gt; play_to_caller = yes<br />       &gt; play_to_callee = no<br />       &gt; warning_freq   = 30000<br />       &gt; start_sound    =<br />       &gt; warning_sound  = timeleft<br />       &gt; end_sound      =<br />    -- Called provedor/00551183344485<br />    -- SIP/provedor-00000089 is ringing<br />    -- SIP/provedor-00000089 is making progress passing it to SIP/53377-00000088<br />    -- SIP/provedor-00000089 
 answered SIP/53377-00000088<br />abratel*CLI&gt;<br />  a2billing.php: file:Class.RateEngine.php - line:1262 - uniqueid:1282931233.136 - DIAL sip/provedor/00551183344485|60|HiL(2760000:61000:30000)<br />  a2billing.php: file:Class.RateEngine.php - line:1148 - uniqueid:1282931233.136 - [TRUNK STATUS UPDATE : UPDATE cc_trunk SET inuse=inuse-1 WHERE id_trunk='2']<br />  a2billing.php: file:Class.RateEngine.php - line:1411 - uniqueid:1282931233.136 - -&gt; dialstatus : ANSWER, answered time is 8<br />  a2billing.php:<br />  a2billing.php: file:Class.RateEngine.php - line:1415 - uniqueid:1282931233.136 - [USEDRATECARD=0]<br />  a2billing.php: file:Class.RateEngine.php - line:953 - uniqueid:1282931233.136 - :[sessiontime:8 - id_cc_package_offer:-1 - package2apply:]<br />  a2billing.php:<br />  a2billing.php:<br />  a2billing.php:<br />  a2billing.php:<br />  a2billing.php:<br />  a2billing.php:<br />  a2billing.php:<br />  a2billing.php:<br />  a2billing.php: file:C
 lass.RateEngine.php - line:730 - uniqueid:1282931233.136 - [CC_RATE_ENGINE_CALCULCOST: K=0 - CALLDURATION:8 - freetimetocall_used=0]<br />  a2billing.php: file:Class.RateEngine.php - line:808 - uniqueid:1282931233.136 - [TEMP - CC_RATE_ENGINE_CALCULCOST: 1. COST: -0.18538]:[ (60/60) * 0.18538 ]<br />  a2billing.php: file:Class.RateEngine.php - line:893 - uniqueid:1282931233.136 - [CC_RATE_ENGINE_CALCULCOST: K=0 - BUYCOST:-0.01065 - SELLING COST:-0.18538]<br />  a2billing.php: file:Class.RateEngine.php - line:1036 - uniqueid:1282931233.136 - [CC_RATE_ENGINE_UPDATESYSTEM: usedratecard K=0 - (sessiontime=8 :: dialstatus=ANSWER :: buycost=0.01065 :: cost=-0.18538 : signe_cc_call=+: signe=-)]<br />  a2billing.php: file:Class.RateEngine.php - line:1098 - uniqueid:1282931233.136 - [CC_asterisk_stop : SQL: DONE : result=1]<br />  a2billing.php: file:Class.RateEngine.php - line:1099 - uniqueid:1282931233.136 - [CC_asterisk_stop : SQL: INSERT INTO cc_call (uniqueid, sessionid, ca
 rd_id, nasipaddress, starttime, sessiontime, real_sessiontime, calledstation,  terminatecauseid, stoptime, sessionbill, id_tariffgroup, id_tariffplan, id_ratecard,  id_trunk, src, sipiax, buycost, id_card_package_offer, dnid, destination) VALUES ('1282931233.136', 'SIP/53377-00000088', '19', '', SUBDATE(CURRENT_TIMESTAMP, INTERVAL 8 SECOND) , '8', '8', '00551183344485', 1, now() , '+0.18538',  '7', '7', '16397', '2', '53377', '0',  '0.01065', NULL, '00551183344485', '55')]<br />  a2billing.php: file:Class.RateEngine.php - line:1123 - uniqueid:1282931233.136 - [CC_asterisk_stop 1.2: SQL: UPDATE cc_card SET credit= credit-0.18538 ,  lastuse=now(), nbused=nbused+1 WHERE username='53377']<br />  a2billing.php: file:Class.RateEngine.php - line:1128 - uniqueid:1282931233.136 - UPDATE cc_trunk SET secondusedreal = secondusedreal + 8 WHERE id_trunk='2'<br />  a2billing.php: file:Class.RateEngine.php - line:1132 - uniqueid:1282931233.136 - UPDATE cc_tariffplan SET secondusedr
 eal = secondusedreal + 8 WHERE id='7'<br />  a2billing.php: file:a2billing.php - line:328 - uniqueid:1282931233.136 - [a2billing account stop]<br />  a2billing.php: file:a2billing.php - line:189 - uniqueid:1282931233.136 - [CHANNEL STATUS : 6 = Line is up]<br />  a2billing.php: [CREDIT : 8.45286][CREDIT MIN_CREDIT_2CALL : 0]<br />  a2billing.php: file:a2billing.php - line:218 - uniqueid:2282931233.14 - TARIFF ID -&gt; 7<br />  a2billing.php: file:Class.A2Billing.php - line:803 - uniqueid:2282931233.14 - use_dnid:0 &amp;&amp; (!in_array:) &amp;&amp; len_dnid:(12 || len_exten:12 ) &amp;&amp; (try_num:1)<br />[Aug 27 14:47:35] WARNING[22500]: file.c:765 ast_readaudio_callback: Failed to write frame<br />    -- &lt;SIP/53377-00000088&gt; Playing 'prepaid-enter-dest' (language 'br')<br />  a2billing.php: file:Class.A2Billing.php - line:815 - uniqueid:2282931233.14 - RES DTMF : -1<br />  a2billing.php: file:Class.A2Billing.php - line:870 - uniqueid:2282931233.14 - [CALL 
 2 DID]<br />  a2billing.php: file:Class.A2Billing.php - line:879 - uniqueid:2282931233.14 - SELECT cc_did.id, iduser FROM cc_did, cc_card  WHERE cc_card.status=1 and cc_card.id=iduser  and cc_did.activated=1 and did='-1'  AND cc_did.startingdate&lt;= CURRENT_TIMESTAMP AND (cc_did.expirationdate &gt; CURRENT_TIMESTAMP OR cc_did.expirationdate IS NULL OR cc_did.expirationdate = '0000-00-00 00:00:00')<br />  a2billing.php: file:Class.A2Billing.php - line:885 - uniqueid:2282931233.14 - DESTINATION ::&gt; -1<br />  a2billing.php: file:Class.A2Billing.php - line:892 - uniqueid:2282931233.14 - RULES APPLY ON DESTINATION ::&gt; -1<br />    -- Playing 'prepaid-invalid-digits' (escape_digits=#) (sample_offset 0)<br />[Aug 27 14:47:35] WARNING[22500]: file.c:765 ast_readaudio_callback: Failed to write frame<br /><br /><strong>Aqui ele bilheta normal</strong>