<div dir="ltr"><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">Hi Everybody,<br><br>I try to register to the Asterisk server using exosip2, this is my code :<br>
<b>TRACE_INITIALIZE (6, stdout);<br> if (eXosip_init ()) {<br> printf("eXosip_init failed\n");<br> exit (1);<br> }<br><br> i = eXosip_listen_addr (IPPROTO_UDP,"192.168.14.35", port, AF_INET, 0);<br>
if (i!=0) {<br> eXosip_quit();<br> printf("could not initialize transport layer\n");<br> exit (1);<br> }<br> osip_message_t *reg = NULL;<br> int id;<br> int j;<br><br> eXosip_lock ();<br> id = eXosip_register_build_initial_register ("<a href="mailto:sip%3A3000@192.168.14.35" target="_blank" style="color: rgb(42, 93, 176); ">sip:3000@192.168.14.35</a>", "sip:192.168.14.36", "<a href="http://sip:3000@192.168.15.35:5060/" target="_blank" style="color: rgb(42, 93, 176); ">sip:3000@192.168.15.35:5060</a>", 1800, &reg);<br>
if (id < 0)<br> {<br> eXosip_unlock ();<br> return -1;<br>}<br><br>j = eXosip_register_send_register (id, reg);<br> printf("%d\n",j);<br> eXosip_unlock ();<br> <br> return j;<br></b><br>Unfortunately, the Asterisk server send to me this message :<br>
<br><span style="background-color: rgb(255, 204, 102); ">SIP/2.0 100 Trying </span><br style="background-color: rgb(255, 204, 102); "><span style="background-color: rgb(255, 204, 102); ">Via: SIP/2.0/UDP 192.168.14.35:5060;branch=z9hG4bK1366493399;received=192.168.14.35;rport=5060 </span><br style="background-color: rgb(255, 204, 102); ">
<span style="background-color: rgb(255, 204, 102); ">From: <<a href="mailto:sip%3A3000@192.168.14.35" target="_blank" style="color: rgb(42, 93, 176); ">sip:3000@192.168.14.35</a>>;tag=1127882803 </span><br style="background-color: rgb(255, 204, 102); ">
<span style="background-color: rgb(255, 204, 102); ">To: <<a href="mailto:sip%3A3000@192.168.14.35" target="_blank" style="color: rgb(42, 93, 176); ">sip:3000@192.168.14.35</a>> </span><br style="background-color: rgb(255, 204, 102); ">
<span style="background-color: rgb(255, 204, 102); ">Call-ID: <a href="mailto:796455329@192.168.14.35" target="_blank" style="color: rgb(42, 93, 176); ">796455329@192.168.14.35</a> </span><br style="background-color: rgb(255, 204, 102); ">
<span style="background-color: rgb(255, 204, 102); ">CSeq: 1 REGISTER </span><br style="background-color: rgb(255, 204, 102); "><span style="background-color: rgb(255, 204, 102); ">User-Agent: Asterisk PBX </span><br style="background-color: rgb(255, 204, 102); ">
<span style="background-color: rgb(255, 204, 102); ">Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY </span><br style="background-color: rgb(255, 204, 102); "><span style="background-color: rgb(255, 204, 102); ">Supported: replaces </span><br style="background-color: rgb(255, 204, 102); ">
<span style="background-color: rgb(255, 204, 102); ">Contact: <<a href="mailto:sip%3A3000@192.168.14.36" target="_blank" style="color: rgb(42, 93, 176); ">sip:3000@192.168.14.36</a>> </span><br style="background-color: rgb(255, 204, 102); ">
<span style="background-color: rgb(255, 204, 102); ">Content-Length: 0 </span><br style="background-color: rgb(255, 204, 102); "><span style="background-color: rgb(255, 204, 102); "> </span><br style="background-color: rgb(255, 204, 102); ">
<span style="background-color: rgb(255, 204, 102); ">SIP/2.0 401 Unauthorized </span><br style="background-color: rgb(255, 204, 102); "><span style="background-color: rgb(255, 204, 102); ">Via: SIP/2.0/UDP 192.168.14.35:5060;branch=z9hG4bK1366493399;received=192.168.14.35;rport=5060 </span><br style="background-color: rgb(255, 204, 102); ">
<span style="background-color: rgb(255, 204, 102); ">From: <<a href="mailto:sip%3A3000@192.168.14.35" target="_blank" style="color: rgb(42, 93, 176); ">sip:3000@192.168.14.35</a>>;tag=1127882803 </span><br style="background-color: rgb(255, 204, 102); ">
<span style="background-color: rgb(255, 204, 102); ">To: <<a href="mailto:sip%3A3000@192.168.14.35" target="_blank" style="color: rgb(42, 93, 176); ">sip:3000@192.168.14.35</a>>;tag=as0f0ad599 </span><br style="background-color: rgb(255, 204, 102); ">
<span style="background-color: rgb(255, 204, 102); ">Call-ID: <a href="mailto:796455329@192.168.14.35" target="_blank" style="color: rgb(42, 93, 176); ">796455329@192.168.14.35</a> </span><br style="background-color: rgb(255, 204, 102); ">
<span style="background-color: rgb(255, 204, 102); ">CSeq: 1 REGISTER </span><br style="background-color: rgb(255, 204, 102); "><span style="background-color: rgb(255, 204, 102); ">User-Agent: Asterisk PBX </span><br style="background-color: rgb(255, 204, 102); ">
<span style="background-color: rgb(255, 204, 102); ">Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY </span><br style="background-color: rgb(255, 204, 102); "><span style="background-color: rgb(255, 204, 102); ">Supported: replaces </span><br style="background-color: rgb(255, 204, 102); ">
<span style="background-color: rgb(255, 204, 102); ">WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="1929e732" </span><br style="background-color: rgb(255, 204, 102); "><span style="background-color: rgb(255, 204, 102); ">Content-Length: 0</span></span><br clear="all">
<br><div>What is wrong in my code ?</div><div>Big thanks for your help.<br>-- <br>IDRISS GHODHBANE<br>
</div></div>