El 03/09/14 15:45, Luca Olivetti ha escrit:
> El 03/09/14 06:13, Luca Olivetti ha escrit:
>> El 06/03/13 15:36, Francesco Lamonica ha escrit:
>>
>> Sorry to revive an old thread (and for the top-posting!), but I'm having
>> the same issue and I saw no replies on the list.
>>
>> I'm using nua and I tried this right after the call to nua_create
>>
>>
>>         if (g_conf.local_ip) {
>>                 url_t * local_url;
>>                 local_url = url_make(svd->nua, "sip:*.*");
>>                 local_url->url_host = g_conf.local_ip;
>>                 nua_set_params(svd->nua,
>>                                NUTAG_URL (local_url),
>>                                TAG_NULL () );
>>         }
>>
>>
>> but it doesn't seem to be working.
> 
> I also tried to add
>  TAG_IF (g_conf.local_ip, SIPTAG_VIA_STR(g_conf.local_ip)),
>  TAG_IF (g_conf.local_ip, SOATAG_ADDRESS(g_conf.local_ip)),
> 
> in the call to nua_create, again with no apparent result (not
> surprisingly since it was a random attempt).

It turns out that, contrary to what the documentation says
(http://sofia-sip.sourceforge.net/refdocs/nua/nua__tag_8h.html#a3cfaf741baba4cd2e325385375dac22b),
NUTAG_URL doesn't work to "set stack's own address" if used with
nua_set_params, but only with nua_create:


        char *local_ip=NULL;
        if (g_conf.local_ip) {
                asprintf(&local_ip, "sip:%s", g_conf.local_ip);
                SU_DEBUG_5(("using NUTAG_URL %s\n",local_ip));
        }

        svd->nua = nua_create (svd->root, svd_nua_callback, svd,
                        SIPTAG_USER_AGENT_STR ("svd VoIP agent"),
                        SOATAG_AF (SOA_AF_IP4_IP6),
                        TPTAG_TOS (tos),
                        NUTAG_ALLOW ("INFO"),
                        NUTAG_AUTOALERT (1),
                        NUTAG_ENABLEMESSAGE (1),
                        NUTAG_ENABLEINVITE (1),
                        NUTAG_DETECT_NETWORK_UPDATES
(NUA_NW_DETECT_TRY_FULL),
                        TAG_IF (local_ip, NUTAG_URL(local_ip)),
                        TAG_NULL () );



But even if this works, I'd still prefer a solution that allows me to
specify the local interface for each registration instead of globally.
Any hint?

Bye
-- 
Luca

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Sofia-sip-devel mailing list
Sofia-sip-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to