[Kamailio-Users] Get send_socket if I have no new branch

Daniel-Constantin Mierla miconda at gmail.com
Wed May 13 11:59:25 CEST 2009


Hello,

On 05/13/2009 12:40 PM, catalina oancea wrote:
> Thanks for your answer Daniel,
>
> I want to replace the contact header with the IP that kamailio uses to
> send the message. Is there any other way to do this?
>   
internally it is. The mechanism is used by conditional lump when adding 
second record route (when you do network bridging or transport protocol 
gatewaying.

Do you just relay the INVITE or you set the outgoing socket as well? Is 
the mhomed parameter set?

Cheers,
Daniel

>
>
>
> 2009/5/13 Daniel-Constantin Mierla <miconda at gmail.com>:
>   
>> Hello,
>>
>> On 05/13/2009 11:05 AM, catalina oancea wrote:
>>     
>>> Hello all
>>>
>>> In my kamailio.cfg I don't use append_branch at all and I listen on
>>> multiple addresses. Before running t_relay I need to know on which
>>> socket will the request be sent. I don't want to change the socket,
>>> but I want to know which socket is chosen. I tried
>>> $(branch(send_socket)[0]) and $(branch(send_socket)) but I got error
>>> "ERROR:pv:pv_get_branchx: error accessing branch [0]"
>>> Does anybody know how I can get this info?
>>>
>>>       
>> send socket is set if you do force_send_socket() or assignment to $fs.
>>
>> It is a bit hard to get outgoing socket while processing the incoming
>> message. As a rule, if it can be routed from same socket as the message
>> arrived, then that one is used.
>>
>> You get the error above as you didn't added the branch, so the branch index
>> was not updated and it is out of range what you want to access. Use $fs to
>> get the send socket from the sip message structure.
>>
>> Anyhow, not sure it really helps, as it might not be the used value at the
>> end, can you give more details of what you look for?
>>
>> In the very close future, you can get it via using the send_route with
>> kamailio 3.0.
>>
>> Cheers,
>> Daniel
>>
>> --
>> Daniel-Constantin Mierla
>> http://www.asipto.com/
>>
>>
>>     

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




More information about the Users mailing list