Well I've got it fixed.
The problem was with a2billing and not my dial plan.
The problem was that when I created a TRUNK in the GUI I added some additional parameters, and after removing it it went on ok.
Now I have two more problems.
One are local calls.
I call another number that is on the same installation, a2billing starts, goes through sends the call to the local trunk (127.0.0.1 over SIP) and then I get a Loop Detected message and a2billing is being run all over again.
I know I have to change my dial plan somehow, but I don't know how.
Second problems are incoming calls.
I.e. if I call my number that is on a2billing, then asterisk runs a2billing and a2billing at the end says to enter the pin number...
Oh and a2billing reports DNID unknown
I'm calling a2billing before the Dial command in asterisk dial plan...
Like so:
Code:
[macro-voice-dial]
exten => s,1,Set(LANGUAGE()=si)
exten => s,2,GotoIf($["${ARG2}" != "RING"] ?|4)
exten => s,3,Playtones(ring)
exten => s,4,GotoIf($["${CALLERID(num)}" != "9901"] ?|9)
exten => s,5,Set(regx="([a-zA-Z0-9:]+)") ; Nastavi regularni izraz - izlocitev stevilke s protokolom
exten => s,6,Set(cid2=$["${SIPURI}" : ${regx}]) ; Izloci klicno stevilko in protokol
exten => s,7,Set(cid3=${cid2:4}) ; Odrezi protokol, ki je sip:
exten => s,8,Set(CALLERID(number)=0${cid3}) ; Dodaj vodilno niclo
exten => s,9,Wait,2
exten => s,10,AGI,a2billing.php
exten => s,11,Wait,2
exten => s,12,Dial(${ARG1},90,r)
exten => s,13,Goto(s-${DIALSTATUS},1)
exten => s-NOANSWER,1,Goto(s-NOANSWER,101)
exten => s-NOANSWER,2,Hangup
exten => s-BUSY,1,Goto(s-BUSY,101)
exten => s-BUSY,2,Hangup
exten => s-CHANUNAVAIL,1,Goto(s-CHANUNAVAIL,101)
exten => s-CHANUNAVAIL,2,Hangup
exten => s-.,1,Goto(s-NOANSWER,1)
exten => s-CHANUNAVAIL,101,Playback(message-the-number-is-unavailable); Ni zasedena
exten => s-CHANUNAVAIL,102,Goto(s-FINISH,1) ; Na konec
exten => s-BUSY,101,Playback(message-the-number-is-busy) ; Ni zasedena
exten => s-BUSY,102,Goto(s-FINISH,1) ; Na konec
exten => s-NOANSWER,101,Playtones(info) ; Na konec
exten => s-NOANSWER,102,Goto(s-FINISH,1) ; Na konec
exten => s-FINISH,1,Wait,1 ; Malo pocakaj
exten => s-FINISH,2,Hangup ; Odlozi
exten => s,109,Goto(s-${DIALSTATUS},1)
Added after 58 minutes: Nevermind that. I was calling a2billing at the wrong point. Fixed it now.
Only now, incoming calls arent handled by a2billing, how would I fix that?