razametal wrote:
It is possible to make it work with freepbx 2.4 ?
I know now a little more about FreePBX than I did previously, and looking at this I'm sure it's possible without needing to directly modify either FreePBX or A2Billing. As described in
an unrelated trixbox thread, you can make use of the [macro-dialout-trunk-predial-hook] to accomplish exactly the same technique as
ChrisUK1978 first described, but without needing to re-apply the changes each time FreePBX or A2Billing is upgraded.
It turns out it's very simple:
Create a new custom trunk with 'Custom Dial String' set to 'A2B/1' and add the following to extensions_custom.conf:
Code:
[macro-dialout-trunk-predial-hook]
exten => s,1,GotoIf($["${OUT_${DIAL_TRUNK}:4:4}" = "A2B/"]?custom-freepbx-a2billing,${OUTNUM},1:2)
exten => s,2,MacroExit
[custom-freepbx-a2billing]
exten => _X.,1,DeadAGI(a2billing.php|${OUT_${DIAL_TRUNK}:8})
exten => _X.,n,Hangup()
You're done!
If you need to get clever, you can select which of A2B's [agi-confX] sections is used by changing the custom dial string, ie 'A2B/3' would use [agi-conf3].
I've only tested this on FreePBX 2.3.15, so let me know how you get on with other versions.