Question here: Im also having problem re: billing when call is transferred. The 2nd Leg or the transferred call is not being billed and reflected to CDR. My question is, how can i call this to my dial plan? If say, i already connected to the first call, how can i or what should i dial to transfer the call to other number?
:mrgreen: I've thought of a possible workaround, but beware! It is so ugly and kludgey you may go blind just by looking at it.
Merge this into Asterisk's features.conf:
Code:
[general]
featuredigittimeout = 1000
[applicationmap]
xferone => #201,peer/callee,Set,AGIXFER=201
xfertwo => #202,peer/callee,Set,AGIXFER=202
xferthree => #203,peer/callee,Set,AGIXFER=203
And modify how you are already launching A2Billing in your Asterisk dialplan:
Code:
[custom-a2billing]
exten => _X.,1,Set(DYNAMIC_FEATURES=xferone#xfertwo#xferthree)
exten => _X.,2,Answer
exten => _X.,3,Wait(0.25)
exten => _X.,4,Set(AGIXFER="")
exten => _X.,5,DeadAGI(a2billing.php|1)
exten => _X.,6,Wait(0.25)
exten => _X.,7,GotoIf(${AGIXFER}?${AGIXFER},4)
exten => _X.,8,Hangup
To do a blind transfer dial #201 and hangup. I can't think of a way to easily support attended transfer.
You may need to set 'answer_call=no' in a2billing.conf. This is totally untested. If it breaks (or is already broken) please realise I may not have enough glue to fix it for you.
Added after 13 minutes: I forgot to mention this method should give one CDR for each leg answered, and supports being transferred more than once. The drawback is that I think each CDR will be billed from the moment the first call was answered, leading to incorrect billing. I guess this is better than hanging-up on clients.
As you've guessed, transfer=no should do the trick.
regards