Let's say i have a network of * boxes connected via IAX, one of them is a "switch", one or more are the "gateways". - An IAX[2] "customer" register himself on the "switch" (and gets an accountcode for te purpose of cdr) - The customer places a call to the "switch", the switch does some magic and decides which "gateway" the call should be forwarded - The switch authenticates the call with the "gateway" and then performs a transfer effectively connecting the "customer" directly with the "gateway" (which is something I specifically want, this rules out a notransfer=yes solution) - The "gateway" does something expensive (= calls the PSTN) I want to be billed From a CDR standpoint, i have a cdr record from the "switch" containing the accountcode for the user, but useless billing informations since the call has been transferred, The "gateway" has, of course, useful billing information, but doesn't have the original "accountcode" for the user, since the call was coming from the "switch" Given that I can't trust the callerid, and I can't set it to something else (i must accept from "customer" any callerid and pass it to the PSTN), I would like to bill the calls based on the "accountcode" for the user. Here comes the trouble: since neither the accountcode nor the uniqueid are preserved during the transfer, i do not see anything to safely correlate the accountcode with the billing records on the gateway. I can "guess" at it based on the call specific callerid, the time of day and such. But it would be guessing. A few thoughts on it: * one could pass via IAX a uniqueid when i transfer the call, and have this unique id logged in the CDR records. This way any call segment pertaining to the same phone call can be correlated for cdr purpose. * one could have the gateway allow trusted sources (the "switch") to set via IAX the "accountcode" when transferring the call, and log it as an "originalaccountcode" or even the "accountcode" itself in the cdr. This way every cdr record in the network will have a reference to the actual customer that made that event happen. * one could devise some way to give back from the "gateway" to the transferrer (the "switch") an indication that the call has ended, with that many billable_seconds. (can this be done? i do not see it that simple...) This way the switch would have all the cdr info in one cdr row. Anybody has suggestions on this? thanks lele
Brancaleoni Matteo
2003-Sep-18 14:36 UTC
[Asterisk-Users] CDR of calls transferred via IAX[2]
Ciao lele. that's a good question. Of course I don't know an answer (yet). anyone does? anyway, here's some comments:> * one could pass via IAX a uniqueid when i transfer the call, and have this > unique id logged in the CDR records. This way any call segment pertaining to > the same phone call can be correlated for cdr purpose.nice, but that way we have to join 2 records for a real name... what happens when the switch & gateway are 'very remote'> * one could have the gateway allow trusted sources (the "switch") to set via > IAX the "accountcode" when transferring the call, and log it as an > "originalaccountcode" or even the "accountcode" itself in the cdr. > This way every cdr record in the network will have a reference to the actual > customer that made that event happen.I would stay on that, but without adding another cdr field (originalaccountcode), but simply, since we don't mind 'bout the user as we authenticate from the switch statement, just get the accountcode from the originating switch,so I agree with you. Seems also the simplest way to do that. I would add a sort of @switch in the accountcode, so my user 'caller' will be added to the cdr (of the gateway) as 'caller@<switch_name>' in order to be able to know that the user originated from a remote machine. if the accountcode hasn't the @<swicth_name> part, means that the user is local.> * one could devise some way to give back from the "gateway" to the transferrer > (the "switch") an indication that the call has ended, with that many > billable_seconds. (can this be done? i do not see it that simple...) > This way the switch would have all the cdr info in one cdr row.that means a connection back. I would discard that> thanks > leleof course, only my 2 cents ;) -- Brancaleoni Matteo <mbrancaleoni@espia.it> Espia - Emmegi Srl