title: How to register a SIP account with a specify network interface
body: <p>I am using Pjsip library to register a Sip account to Sip server</p>
  <pre><code>/* Register to SIP server by creating SIP account. */
    {
   pjsua_acc_config cfg;
   
   pjsua_acc_config_default(&amp;cfg);
   cfg.id = pj_str(&quot;sip:&quot; SIP_USER &quot;@&quot; SIP_DOMAIN);
   cfg.reg_uri = pj_str(&quot;sip:&quot; SIP_DOMAIN);
   cfg.cred_count = 1;
   cfg.cred_info[0].realm = pj_str(SIP_DOMAIN);
   cfg.cred_info[0].scheme = pj_str(&quot;digest&quot;);
   cfg.cred_info[0].username = pj_str(SIP_USER);
   cfg.cred_info[0].data_type = PJSIP_CRED_DATA_PLAIN_PASSWD;
   cfg.cred_info[0].data = pj_str(SIP_PASSWD);
   
    status = pjsua_acc_add(&amp;cfg, PJ_TRUE, &amp;acc_id);
    if (status != PJ_SUCCESS) error_exit(&quot;Error adding account&quot;, status);
   }
  </code></pre>
  <p>This working fine when my board only has one network interface, but when i run it on a new board which has many network interface, it always register to Server via interface have smalless IP address value. I read in this link: <a href="https://trac.pjsip.org/repos/wiki/FAQ#multihomed" rel="nofollow noreferrer">https://trac.pjsip.org/repos/wiki/FAQ#multihomed</a> And realize that Pjsip always chooses a network interface to register by its algorithm. And i tried to bind my application to a newtork interface too like this: <a href="https://unix.stackexchange.com/questions/210982/bind-unix-program-to-specific-network-interface">https://unix.stackexchange.com/questions/210982/bind-unix-program-to-specific-network-interface</a> but it not work too. I need to choose network interface manually in the code, how can i do it ?</p>