I am looking to setup A2 billing and playing with what i can do with CDRs. Basically we have a setup like
CLIENTPBX <> SIPSWITCH <> Provider
We manage the sipswitch in the middle and sometimes the client pbx, sometimes clients will byo pbx. There will be no extensions on the sipswitch, only trunks and routing to the clients, A2 will be on the sipswitch.
I have been reading some other forums where guys have added the X-AccountCode to the sip header frrom the remote PBX but since i wont always have the access or ability ( or might not be Asterisk ).
In each case the client will have a trunk named Client_ERT, Client_TSV etc what i would like to be able to do is any calls that originate via each trunk use that code as the accountcode thats written to the CDRS, ERT, TSV etc
You want to probably do custom dialplan in dialout-trunk-predial-hook You can then add whatever info you need. with something like Set(CDR(accountcode)=value)