Let me first describe my problem. I use Sofia SIP for a telephony application, and the SIP proxy server that I use is behind NAT. This means that the incoming invitation from the proxy server has the internal proxy IP address (for example, 10.0.0.1) as the Contact header. This means that when I put off the phone from my application, Sofia automatically sets the destination for the message BYE IP 10.0.0.1, which, as you can imagine, is not routed, and as a result it fails.
So what I want to do is change the destination for the BYE message as the “external” proxy IP address. The problem is that Sofia does not seem to allow me to change the destination for the SIP message; he always uses the contact received when receiving INVITE. Here is what I tried:
Performing a hard-set value for SIPTAG_TO:
nua_bye (op-> op_handle, SIPTAG_TO (sip_to_make (ssc-> ssc_home, "sip: alice @ 54.15.123.11")), TAG_END ());
The result for this was that the To header was updated by the external ip, but the SIP message is still intended for the internal ip proxy
Performing hard coding for NUTAG_URL:
sip_to_t * to = sip_to_make (ssc-> ssc_home, "sip: alice @ 54.15.123.11");
ua_bye (op-> op_handle, NUTAG_URL (to-> a_url), TAG_END ());
It had no effect.
SIPTAG_REQUEST_STR:
nua_bye (op- > op_handle, SIPTAG_REQUEST_STR ( "BYE sip: alice@54.15.123.11 SIP/2.0" ), TAG_END());
.
, :
nua_set_hparams (op- > op_handle, SIPTAG_REQUEST_STR ( "BYE sip: alice @54.15.123.11 SIP/2.0" ), TAG_NULL());
nua_bye (op- > op_handle, TAG_END());
, , INVITE - , , , BYE, : nua_set_hparams nua_set_params.
, , , ( , NAT ), , ( nua_bye, - TAGS).
, API , NTA ( NUA), NUA API .
,