Ok, so still using 1.12.4
SIPTAG_FROM_STR and SIPTAG_CONTACT_STR have no effect in nua_set_hparams().
No problem, I can set them in the nua_handle() call.
Still have a problem with the handles that come from incoming requests. Can't set the contact there either, but it doesn't seem to matter since it would not be used for responses.
I think I found out why the default contact header gets sent in responses.
It appears:
nua_registration_for_response() uses the sip->sip_to as the AOR.  This gets looked up with nua_registration_by_aor(). The problem is the To: header may not contain the AOR.
For example,
INVITE sip:[EMAIL PROTECTED] SIP/2.0
To: sip:[EMAIL PROTECTED]
...
Here the proxy is generating this request with the same To: header that come in from the original request to the proxy.
I think the fix is to use the URL on the request line. This should be the AOR.
What do you think ?
It's not a straight forward fix since the request is not available in nua_registration_for_response(), but it should be available up a few functions in: nh_make_response()



Pekka Pessi wrote:
On 11/7/06, Colin Whittaker <[EMAIL PROTECTED]> wrote:
  
 Well, this is interesting, because nua_handle_local() returns the url
without a username.
 Here is url_as_string(NULL, nua_handle_local(nh)->a_url )

 sip:10.1.64.123;transport=udp

 I create the handle with:
 nua_handle( no tags )
 Then:
 nua_set_hparams(
                      NUTAG_M_USERNAME( "3014243101" ),
                      SIPTAG_FROM_STR(  "\"phone 1\"
<sip:[EMAIL PROTECTED]>"  ),
                      NUTAG_AUTOACK( 1 ),
                      NUTAG_EARLY_ANSWER( 0 ),    // Don't Send SDP with 1xx
responses.
                      SOATAG_USER_SDP_STR( SDP ),
                      TAG_END() );

 So this probably explains what I am seeing, but why doesn't the username
get set ?
    

The nua_handle() function sets the From header for the handle. If
there is none, it uses the default From header, generated when
nua_create() or nua_set_params() is called. It looks like the code
that populates the request message with headers first tries to use the
>From header from the nua_invite() tags, then from the tags from
nua_handle() call and then from the values saved with the dialog. The
problem is caused by the nua_handle() which adds a copy of the default
>From header to the tags.

As a fix I'd propose that you include the SIPTAG_FROM_STR() and
perhaps NUTAG_URL() and SIPTAG_TO()/SIPTAG_TO_STR() in the
nua_handle() params. I'lkl file this as a bug, too, and try to figure
out how to fix it without breaking nua_handle_local().

  
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sofia-sip-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to