[Users] Re: cpl scripts and pstn gateway authentication

Günther Starnberger gst at sysfrog.org
Wed Nov 16 00:21:50 CET 2005

Bogdan-Andrei Iancu wrote:


 > 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 

if a at local has setup a forward to b at local the cpl interpreter is first 
executed for user a at local and then relays the call to b at local which 
starts a new transaction (for the incoming call to b at local) so that i 
have the chance to put the new callee (b at 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?


More information about the Users mailing list