RE: [reSIProcate] How to set Via info in Header? and some issues with Cisco SIP server
Thanks Rob! Let me rephrase my question. Our client application is behind a
firewall, so it has both a local IP/port (10.180.4.241:10120) and a public
IP/port (12.154.24.179:58858). By default (as the code snippet in the
example), for some reason, the sip stack library puts in the local IP and
port, and the Via in our case looks like as this:
Via: SIP/2.0/UDP 10.180.4.241:10120;branch=z9hG4bk-******;rport
This works fine with Iptel's SIP server, but has some interoperability issue
for a Cisco SIP server - with the above Via, the Cisco SIP server won't
route the INVITE message to the callee. So we want to make the Via like
this:
Via: SIP/2.0/UDP 12.154.24.179:58858;branch=z9hG4bk-******;rport
We just can't figure out what is the right way to put in the public IP and
port as above. And does anybody here have experience with Cisco's SIP
server?
Thanks,
Wenwei
-----Original Message-----
From: Robert Mansfield [mailto:RJM@xxxxxxxxxxxxxxx]
Sent: Thursday, July 20, 2006 4:24 AM
To: Wenwei Xu; resiprocate-devel@xxxxxxxxxxxxxxxxxxx
Subject: RE: [reSIProcate] How to set Via info in Header?
Wenwei,
You can look in the source files for DUM for some examples.
DialogUsageManger.cxx has some examples of manipulating the Via header. In
most cases your application should just do the following when making a new
request;
Via via;
via.param(p_branch); // will create the branch
request->header(h_Vias).push_front(via);
This snippit was from Helper.cxx -> Helper::makeRequest(..)
The library takes care of setting the transport protocol (UDP, TCP etc) and
filling in the host portion of the address.
As an example you can access the methods for 'Via' using:-
msg.header(h_Vias).front().sentPort() = 5060;
Hope this answers your question.
Rob.
-----Original Message-----
From: Wenwei Xu [mailto:wxu@xxxxxxxxxxxxx]
Sent: 19 July 2006 23:31
To: resiprocate-devel@xxxxxxxxxxxxxxxxxxx
Subject: [reSIProcate] How to set Via info in Header?
Greetings,
When making a SIP message, how to explicitly specify parameters (e.g.
transport, sentHost) in the Via object for the header? Can anyone provide
some sample code?
Many thanks,
Wenwei Xu
_______________________________________________
resiprocate-devel mailing list resiprocate-devel@xxxxxxxxxxxxxxxxxxx
https://list.sipfoundry.org/mailman/listinfo/resiprocate-devel