Bogdan-Andrei Iancu wrote:
hello,
indeed, a small possibility is by setting a script route to be executed just before cpl forwards a request: http://www.openser.org/docs/modules/1.1.x/cpl-c.html#AEN111 it will help you to make last changes on the request - adding headers, etc. But the remaining problem is to actually set the URI to be billed during cpl execution. Each time the cpl does a serial fork, it will have to update that URI...I thing this is the missing piece.
adding a header is all i need to do as only calls to the pstn are accounted and the cdrs are written on the pstn-gateway.
my initial plan was the following: 1) on an incoming call add an AVP which contains the callee 2) execute the CPL interpreter 3) in proxy_route check if the actual callee is equal to the AVP. if this is not the case there was a forward -> put the value from the AVP into the From header (or the rpid header).
although the whole logic is in the CPL module the user who should be accounted is always the same one - the owner of the script. or do i miss something?
if a@local has setup a forward to b@local the cpl interpreter is first executed for user a@local and then relays the call to b@local which starts a new transaction (for the incoming call to b@local) so that i have the chance to put the new callee (b@local) in the AVP again. is this right?
if the above isn't possible i could try to add the missing functionality to the CPL module myself. how hard do you assume is it for someone who doesn't know the internal structure of openser but who has c programming experience to add the missing code?
bye, /gst