< Previous by Date Date Index Next by Date >
  Thread Index  

[reSIProcate] Adding a local via


I am running a single instance of the reciprocate stack, listening to multiple ports.  Each port is added as a new transport.

 

<code>

            stack.addTransport(resip::UDP, 5065, resip::V4, resip::StunEnabled);

            stack.addTransport(resip::UDP, 5060, resip::V4, resip::StunEnabled);

</code>

 

My proxy adds a local via to the SIP message before it is delivered.

 

<code>

void addLocalVia( resip::SipMessage& msg )

{

            msg.header(resip::h_Vias).push_front(resip::Via());

}

</code>

 

However, the stack does not choose the correct transport when creating the new via.  This is obviously because I am not specifying one in the code.  Is there a way to specify on which transport to create the local Via?

 

When the SIP message comes in on port 5060, I want to mark the top-via as if it came from port 5060, and respectively for 5065.

 

Thanks in advance,

Michael Baj