[Kamailio-Devel] t_relay

Daniel-Constantin Mierla miconda at gmail.com
Mon Sep 15 11:03:06 CEST 2008



On 09/15/08 11:50, Henning Westerholt wrote:
> On Thursday 11 September 2008, Jason Penton wrote:
>   
>> AFAIK t_relay only accepts literals, like,
>> t_relay("udp:xxx.xxx.xxx.xxx:5060").
>>
>> Would it not be better (more flexible) that t_relay could take an AVP for
>> the host part so that it can be generically configured from DB, or alike?
>>
>> I am happy to submit a patch.
>>     
>
> Hi Jason,
>
> one reason that t_relay accept only literals is that this parameter can be 
> fixed during the server startup to a "proxy" struct from the
> "fixup_phostport2proxy" function. This parameter can be evaluated on runtime 
> without that much overhead. If you want to replace this with an AVP, it will 
> be printed and converted to a proxy for every invocation of t_relay. 
>
> If you want to relay a message to a changing target, normally you just rewrite 
> the URI and call t_relay without the destination parameter, as you surely 
> know. Do you have another requirement that can't be achived this way?
>
> If you need this functionality, and implement it in a way that don't break the 
> existing t_relay, i'd would welcome a patch that change this.
>   
if you need to keep the R-URI intact, you can set the destination uri - 
$du. Instead of

t_relay("proto:address:port");

do

$du = "sip:address:port;transport=proto";
t_relay();

In the assignment for $du you can use other variables with + operation 
to build the value you need there.

Cheers,
Daniel


-- 
Daniel-Constantin Mierla
http://www.asipto.com




More information about the Devel mailing list