RE: [reSIProcate] Contact: field getting over-written
Try using of setOverrideHostAndPort () method of Profile class (see
Profile.cxx/hxx).
It stores your Contact header in Master profile and uses it in all
appropriate cases.
//* Set Contact's fields
Uri ContactUri;
ContactUri.scheme () = Symbols::DefaultSipScheme;
ContactUri.host () = your address
ContactUri.port () = your port
ContactUri.user () = your user
and so on
Profile->setOverrideHostAndPort (ContactUri);
Don't forget to create an instance of MasterProfile that is inherited
from UserProfile and Profile classes.
Sasha.
-----Original Message-----
From: resiprocate-devel-bounces@xxxxxxxxxxxxxxxxxxx
[mailto:resiprocate-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of John
Draper
Sent: Monday, December 12, 2005 11:18 AM
To: Resip Devel
Subject: [reSIProcate] Contact: field getting over-written
Hi,
When I Register, resip initially sets my "Contact" field as such...
Contact: <sip:u354>
So, I need my contact to look like this, so I do the following code...
// create our register message
SipMessage & regMessage = clientDum->makeRegistration(*from, new
RegisterAppDialogSet(*clientDum));
// NEW: Must add the contact here.
// NameAddr contact = regMessage.header(h_Contacts).front();
regMessage.header(h_Contacts).front().uri().host() =
mInfoServer->getExtIP();
// CHANGE: mDisplayName - an IV, init from [sipController
displayName];
regMessage.header(h_Contacts).front().displayName() =
[sipController displayName];
Now, my Contact looks like this:
Contact: "TestUser5"<sip:u354@xxxxxxxxxxxxx>
Which now seems to work. But, after I've registered, and want to do
an INVITE
request, but I noticed the header got changed back to...
Contact: <sip:u354>
Then, it re-populates it back to....
Contact: "TestUser5"<sip:u354@xxxxxxxxxxx>
Which is exactly correct. So our server now seems to recognize the fact
that the machine next to me is getting called... KEWL... So my network
analysis code works.
However, when I ACCEPT the call, I still have problems...
I get:
Got an INVITE or SUBSCRIBE that doesn't have exactly one contact..
I do get the 100 trying, 180 ringing, and 200 ok, but I get more then
one of them. Am I suppose to do something after getting the first 200
ok?
would that be in the onSucess callback, or the onConnected callback I
would
have to do whatever this is....
John
_______________________________________________
resiprocate-devel mailing list
resiprocate-devel@xxxxxxxxxxxxxxxxxxx
https://list.sipfoundry.org/mailman/listinfo/resiprocate-devel