[Kamailio-Users] Functions that don't accept pvars.

Alex Balashov abalashov at evaristesys.com
Fri Oct 2 06:13:16 CEST 2009


The reason I need to do this, by the way, is because I have a host 
with 5 network interfaces and depending on where the media is going 
the source IP of the media needs to be different.  But there are too 
many possible combinations for me to just put all of the possible 
scenarios statically into the configuration, and it's not clean;  I 
need it to be dynamic and query a database so it can be changed on the 
fly.

Any suggestions for workarounds that allow me to use rtpproxy are welcome!

Thanks,

Alex Balashov wrote:

> It's very frustrating that some functions don't accept pseudovariables 
> and there's no workaround.
> 
> For example, in this case I need rtpproxy_offer() and rtpproxy_answer() 
> to accept an IP address argument that is retrieved from a database. 
> However, this won't work.
> 
>    rtpproxy_offer("", $var(src_ip));   # Config compilation error
> 
>    rtpproxy_offeR("", "$var(src_ip)"); # Results in $var(src_ip)
>                        # literally being placed in the
>                        # SDP body.
> 
> I understand it is difficult to go back and update all legacy functions 
> to accept PVs everywhere.  But isn't it possible to provide a 
> wrapper/compatibility function in the core that will parse a PV and 
> generate as a result something that other functions can see as a string 
> literal?
> 


-- 
Alex Balashov - Principal
Evariste Systems
Web     : http://www.evaristesys.com/
Tel     : (+1) (678) 954-0670
Direct  : (+1) (678) 954-0671



More information about the Users mailing list