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

[reSIProcate] DUM: setting custom Contact in SIP messages


Hello.

Recently I've played with a device behind NAT and wanted DUM to properly set the Contact field of SIP header to the IP of NAT box.

I noticed that DUM correctly sets the field itself if INVITE is coming from wire, (i.e. it contains NAT IP address in proper places). But if I want to initiate invite session via DUM, I have to set the field manually, i.e. something like the following:

  SipMessage is_msg = dum->makeInviteSession(dstAor, aor, ua.sdp);
  NameAddr my_contact(MY_AOR);
  is_msg.header(h_Contacts).clear();
  is_msg.header(h_Contacts).push_back(my_contact);
  dum->send(is_msg);

because I have not found another way to tell DUM what Contact to use.

The above example works, but then I have to do the similar trick for
all the messages I want to send within this dialog. And the worst thing - DUM automatically sends ACK in response to 200 OK, so the Contact field in this ACK remains incorrect.

Could someone confirm that DUM does not provide simple way to use
own Contact, or point me to the right direction?
Thanks.


...Bye..Dmitry.