Bom dia Mike,<br><br>Estou com dificuldade para fazer a bilhetagem dos ramais do Elastix.<br><br>Fiz as seguintes configurações no Elastix/Asterisk:<br><br><b>1. Incluí os contextos abaixo no arquivo extensions_custom.conf.</b><br>
<br><i>[macro-dialout-trunk-predial-hook]<br>exten => s,1,GotoIf($["${OUT_${DIAL_TRUNK}:4:4}" = "A2B/"]?custom-freepbx-a2billing,${OUTNUM},1:2)<br>exten => s,2,MacroExit<br><br>[custom-freepbx-a2billing]<br>
exten => _X.,1,DeadAGI(a2billing.php|${OUT_${DIAL_TRUNK}:8})<br>exten => _X.,n,Hangup()</i><br><br clear="all"><b>2. Fiz os includes abaixo:</b><br><br><i>echo '#include extensions_a2billing.conf' >> extensions_custom.conf<br>
echo '#include additional_a2billing_iax.conf' >> iax_custom.conf<br>echo '#include additional_a2billing_sip.conf' >> sip_custom.conf</i><br><br><b>3. Criei os seguintes trunks:</b><br><br>SIP Trunk<br>
<i>Trunk Description<span>: TELLFREE</span></i><br><br>Custom Trunk<br><i>Trunk Description<span>: A2B</span><br>Custon Dial String: Local/$OUTNUM$@a2billing/n</i><br><br><b>4. Criei uma Outbound Route:</b><br><br><i>Dial Patterns: X.</i><br>
Trunk Sequence: <i>Local/$OUTNUM$@a2billing/n<br><br></i>Obs.: Se eu mudar o Trunk Sequence para TELLFREE (SIP TRUNK) as ligações são efetuadas normalmente.<i><br><br></i><b>5. Crieu um ramal, com accountcode igual ao Card Number do Costumer que criei no A2Billing.</b><br>
<br>Fiz as segunites configurações no A2Billing:<br><br>1. Criei um Trunk;<br>2. Criei um RateCard;<br>3. Criei um Rate;<br>4. Criei um Call Plan;<br>5. Criei um Costumer.<br><br>Segue abaixo o log de uma chamada:<br><br>
mirage*CLI> <br> == Using SIP RTP TOS bits 184<br> == Using SIP RTP CoS mark 5<br> -- Executing [06892093094@from-internal:1] Macro("SIP/1001-00000002", "user-callerid,SKIPTTL,") in new stack<br>
-- Executing [s@macro-user-callerid:1] Set("SIP/1001-00000002", "AMPUSER=1001") in new stack<br> -- Executing [s@macro-user-callerid:2] GotoIf("SIP/1001-00000002", "0?report") in new stack<br>
-- Executing [s@macro-user-callerid:3] ExecIf("SIP/1001-00000002", "1?Set(REALCALLERIDNUM=1001)") in new stack<br> -- Executing [s@macro-user-callerid:4] Set("SIP/1001-00000002", "AMPUSER=1001") in new stack<br>
-- Executing [s@macro-user-callerid:5] Set("SIP/1001-00000002", "AMPUSERCIDNAME=1001") in new stack<br> -- Executing [s@macro-user-callerid:6] GotoIf("SIP/1001-00000002", "0?report") in new stack<br>
-- Executing [s@macro-user-callerid:7] Set("SIP/1001-00000002", "AMPUSERCID=1001") in new stack<br> -- Executing [s@macro-user-callerid:8] Set("SIP/1001-00000002", "CALLERID(all)="1001" <1001>") in new stack<br>
-- Executing [s@macro-user-callerid:9] ExecIf("SIP/1001-00000002", "0?Set(CHANNEL(language)=)") in new stack<br> -- Executing [s@macro-user-callerid:10] GotoIf("SIP/1001-00000002", "1?continue") in new stack<br>
-- Goto (macro-user-callerid,s,19)<br> -- Executing [s@macro-user-callerid:19] NoOp("SIP/1001-00000002", "Using CallerID "1001" <1001>") in new stack<br> -- Executing [06892093094@from-internal:2] Set("SIP/1001-00000002", "_NODEST=") in new stack<br>
-- Executing [06892093094@from-internal:3] Macro("SIP/1001-00000002", "record-enable,1001,OUT,") in new stack<br> -- Executing [s@macro-record-enable:1] GotoIf("SIP/1001-00000002", "1?check") in new stack<br>
-- Goto (macro-record-enable,s,4)<br> -- Executing [s@macro-record-enable:4] ExecIf("SIP/1001-00000002", "0?MacroExit()") in new stack<br> -- Executing [s@macro-record-enable:5] GotoIf("SIP/1001-00000002", "0?Group:OUT") in new stack<br>
-- Goto (macro-record-enable,s,15)<br> -- Executing [s@macro-record-enable:15] GotoIf("SIP/1001-00000002", "0?IN") in new stack<br> -- Executing [s@macro-record-enable:16] ExecIf("SIP/1001-00000002", "1?MacroExit()") in new stack<br>
-- Executing [06892093094@from-internal:4] Macro("SIP/1001-00000002", "dialout-trunk,3,06892093094,,") in new stack<br> -- Executing [s@macro-dialout-trunk:1] Set("SIP/1001-00000002", "DIAL_TRUNK=3") in new stack<br>
-- Executing [s@macro-dialout-trunk:2] GosubIf("SIP/1001-00000002", "0?sub-pincheck,s,1") in new stack<br> -- Executing [s@macro-dialout-trunk:3] GotoIf("SIP/1001-00000002", "0?disabletrunk,1") in new stack<br>
-- Executing [s@macro-dialout-trunk:4] Set("SIP/1001-00000002", "DIAL_NUMBER=06892093094") in new stack<br> -- Executing [s@macro-dialout-trunk:5] Set("SIP/1001-00000002", "DIAL_TRUNK_OPTIONS=tr") in new stack<br>
-- Executing [s@macro-dialout-trunk:6] Set("SIP/1001-00000002", "OUTBOUND_GROUP=OUT_3") in new stack<br> -- Executing [s@macro-dialout-trunk:7] GotoIf("SIP/1001-00000002", "1?nomax") in new stack<br>
-- Goto (macro-dialout-trunk,s,9)<br> -- Executing [s@macro-dialout-trunk:9] GotoIf("SIP/1001-00000002", "0?skipoutcid") in new stack<br> -- Executing [s@macro-dialout-trunk:10] Set("SIP/1001-00000002", "DIAL_TRUNK_OPTIONS=") in new stack<br>
-- Executing [s@macro-dialout-trunk:11] Macro("SIP/1001-00000002", "outbound-callerid,3") in new stack<br> -- Executing [s@macro-outbound-callerid:1] ExecIf("SIP/1001-00000002", "0?Set(CALLERPRES()=)") in new stack<br>
-- Executing [s@macro-outbound-callerid:2] ExecIf("SIP/1001-00000002", "0?Set(REALCALLERIDNUM=1001)") in new stack<br> -- Executing [s@macro-outbound-callerid:3] GotoIf("SIP/1001-00000002", "1?normcid") in new stack<br>
-- Goto (macro-outbound-callerid,s,6)<br> -- Executing [s@macro-outbound-callerid:6] Set("SIP/1001-00000002", "USEROUTCID=") in new stack<br> -- Executing [s@macro-outbound-callerid:7] Set("SIP/1001-00000002", "EMERGENCYCID=") in new stack<br>
-- Executing [s@macro-outbound-callerid:8] Set("SIP/1001-00000002", "TRUNKOUTCID=") in new stack<br> -- Executing [s@macro-outbound-callerid:9] GotoIf("SIP/1001-00000002", "1?trunkcid") in new stack<br>
-- Goto (macro-outbound-callerid,s,12)<br> -- Executing [s@macro-outbound-callerid:12] ExecIf("SIP/1001-00000002", "0?Set(CALLERID(all)=)") in new stack<br> -- Executing [s@macro-outbound-callerid:13] ExecIf("SIP/1001-00000002", "0?Set(CALLERID(all)=)") in new stack<br>
-- Executing [s@macro-outbound-callerid:14] ExecIf("SIP/1001-00000002", "0?Set(CALLERID(all)=)") in new stack<br> -- Executing [s@macro-outbound-callerid:15] ExecIf("SIP/1001-00000002", "0?Set(CALLERPRES()=prohib_passed_screen)") in new stack<br>
-- Executing [s@macro-dialout-trunk:12] ExecIf("SIP/1001-00000002", "0?AGI(fixlocalprefix)") in new stack<br> -- Executing [s@macro-dialout-trunk:13] Set("SIP/1001-00000002", "OUTNUM=06892093094") in new stack<br>
-- Executing [s@macro-dialout-trunk:14] Set("SIP/1001-00000002", "custom=AMP") in new stack<br> -- Executing [s@macro-dialout-trunk:15] ExecIf("SIP/1001-00000002", "0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^))") in new stack<br>
-- Executing [s@macro-dialout-trunk:16] Macro("SIP/1001-00000002", "dialout-trunk-predial-hook,") in new stack<br> -- Executing [s@macro-dialout-trunk-predial-hook:1] GotoIf("SIP/1001-00000002", "0?custom-freepbx-a2billing,06892093094,1:2") in new stack<br>
-- Goto (macro-dialout-trunk-predial-hook,s,2)<br> -- Executing [s@macro-dialout-trunk-predial-hook:2] MacroExit("SIP/1001-00000002", "") in new stack<br> -- Executing [s@macro-dialout-trunk:17] GotoIf("SIP/1001-00000002", "0?bypass,1") in new stack<br>
-- Executing [s@macro-dialout-trunk:18] GotoIf("SIP/1001-00000002", "1?customtrunk") in new stack<br> -- Goto (macro-dialout-trunk,s,22)<br> -- Executing [s@macro-dialout-trunk:22] Set("SIP/1001-00000002", "pre_num=AMP:Local/") in new stack<br>
-- Executing [s@macro-dialout-trunk:23] Set("SIP/1001-00000002", "the_num=OUTNUM") in new stack<br> -- Executing [s@macro-dialout-trunk:24] Set("SIP/1001-00000002", "post_num=@a2billing/n") in new stack<br>
-- Executing [s@macro-dialout-trunk:25] GotoIf("SIP/1001-00000002", "1?outnum:skipoutnum") in new stack<br> -- Goto (macro-dialout-trunk,s,26)<br> -- Executing [s@macro-dialout-trunk:26] Set("SIP/1001-00000002", "the_num=06892093094") in new stack<br>
-- Executing [s@macro-dialout-trunk:27] Dial("SIP/1001-00000002", "Local/06892093094@a2billing/n,300,") in new stack<br> -- Couldn't call 06892093094@a2billing/n<br> == Everyone is busy/congested at this time (0:0/0/0)<br>
-- Executing [s@macro-dialout-trunk:28] NoOp("SIP/1001-00000002", "Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 0") in new stack<br> -- Executing [s@macro-dialout-trunk:29] Goto("SIP/1001-00000002", "s-CHANUNAVAIL,1") in new stack<br>
-- Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)<br> -- Executing [s-CHANUNAVAIL@macro-dialout-trunk:1] Set("SIP/1001-00000002", "RC=0") in new stack<br> -- Executing [s-CHANUNAVAIL@macro-dialout-trunk:2] Goto("SIP/1001-00000002", "0,1") in new stack<br>
-- Goto (macro-dialout-trunk,0,1)<br> -- Executing [0@macro-dialout-trunk:1] Goto("SIP/1001-00000002", "continue,1") in new stack<br> -- Goto (macro-dialout-trunk,continue,1)<br> -- Executing [continue@macro-dialout-trunk:1] GotoIf("SIP/1001-00000002", "1?noreport") in new stack<br>
-- Goto (macro-dialout-trunk,continue,3)<br> -- Executing [continue@macro-dialout-trunk:3] NoOp("SIP/1001-00000002", "TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 0 - failing through to other trunks") in new stack<br>
-- Executing [continue@macro-dialout-trunk:4] Set("SIP/1001-00000002", "CALLERID(number)=1001") in new stack<br> -- Executing [06892093094@from-internal:5] Macro("SIP/1001-00000002", "outisbusy,") in new stack<br>
-- Executing [s@macro-outisbusy:1] Progress("SIP/1001-00000002", "") in new stack<br> -- Executing [s@macro-outisbusy:2] GotoIf("SIP/1001-00000002", "0?emergency,1") in new stack<br>
-- Executing [s@macro-outisbusy:3] GotoIf("SIP/1001-00000002", "0?intracompany,1") in new stack<br> -- Executing [s@macro-outisbusy:4] Playback("SIP/1001-00000002", "all-circuits-busy-now&pls-try-call-later, noanswer") in new stack<br>
-- <SIP/1001-00000002> Playing 'all-circuits-busy-now.gsm' (language 'en')<br> -- <SIP/1001-00000002> Playing 'pls-try-call-later.gsm' (language 'en')<br> -- Executing [s@macro-outisbusy:5] Congestion("SIP/1001-00000002", "20") in new stack<br>
== Spawn extension (macro-outisbusy, s, 5) exited non-zero on 'SIP/1001-00000002' in macro 'outisbusy'<br> == Spawn extension (from-internal, 06892093094, 5) exited non-zero on 'SIP/1001-00000002'<br>
-- Executing [h@from-internal:1] Macro("SIP/1001-00000002", "hangupcall") in new stack<br> -- Executing [s@macro-hangupcall:1] GotoIf("SIP/1001-00000002", "1?noautomon") in new stack<br>
-- Goto (macro-hangupcall,s,3)<br> -- Executing [s@macro-hangupcall:3] NoOp("SIP/1001-00000002", "TOUCH_MONITOR_OUTPUT=") in new stack<br> -- Executing [s@macro-hangupcall:4] GotoIf("SIP/1001-00000002", "1?skiprg") in new stack<br>
-- Goto (macro-hangupcall,s,7)<br> -- Executing [s@macro-hangupcall:7] GotoIf("SIP/1001-00000002", "1?skipblkvm") in new stack<br> -- Goto (macro-hangupcall,s,10)<br> -- Executing [s@macro-hangupcall:10] GotoIf("SIP/1001-00000002", "1?theend") in new stack<br>
-- Goto (macro-hangupcall,s,12)<br> -- Executing [s@macro-hangupcall:12] Hangup("SIP/1001-00000002", "") in new stack<br> == Spawn extension (macro-hangupcall, s, 12) exited non-zero on 'SIP/1001-00000002' in macro 'hangupcall'<br>
== Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/1001-00000002'<br>mirage*CLI> <br><br>Desde já agradeço pela ajuda.<br><br>Abs,<br>Andrey Smith<br>