[Kamailio-Devel] t_relay

Daniel-Constantin Mierla miconda at gmail.com
Mon Sep 15 14:18:05 CEST 2008



On 09/15/08 15:04, Ovidiu Sas wrote:
> This info should be added to the tm README doc.
> It was asked several times.
>   
ok, I added a note about. Improvements are welcome.
> And maybe t_relay should no longer accept parameters.  This will avoid
> any future confusions.
>   
the parameter is converted in some pre-compiled destination address 
during fixup, so it should be faster at runtime if you have a static 
address. Perhaps better docs is the right solution, as always :-).

Cheers,
Daniel

>
> Regards,
> Ovidiu Sas
>
> On Mon, Sep 15, 2008 at 5:03 AM, Daniel-Constantin Mierla
> <miconda at gmail.com> wrote:
>   
>> 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
>>
>>
>> _______________________________________________
>> Devel mailing list
>> Devel at lists.kamailio.org
>> http://lists.kamailio.org/cgi-bin/mailman/listinfo/devel
>>
>>     

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




More information about the Devel mailing list