[asterisk-users] problem of registration with Asterisk using exosip2
Idriss Ghodhbane
idriss.ghodhbane at gmail.com
Mon Apr 26 11:45:55 CDT 2010
Hi Everybody,
I try to register to the Asterisk server using exosip2, this is my code :
*TRACE_INITIALIZE (6, stdout);
if (eXosip_init ()) {
printf("eXosip_init failed\n");
exit (1);
}
i = eXosip_listen_addr (IPPROTO_UDP,"192.168.14.35", port, AF_INET, 0);
if (i!=0) {
eXosip_quit();
printf("could not initialize transport layer\n");
exit (1);
}
osip_message_t *reg = NULL;
int id;
int j;
eXosip_lock ();
id = eXosip_register_build_initial_register
("sip:3000 at 192.168.14.35<sip%3A3000 at 192.168.14.35>",
"sip:192.168.14.36", "sip:3000 at 192.168.15.35:5060", 1800, ®);
if (id < 0)
{
eXosip_unlock ();
return -1;
}
j = eXosip_register_send_register (id, reg);
printf("%d\n",j);
eXosip_unlock ();
return j;
*
Unfortunately, the Asterisk server send to me this message :
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.14.35:5060
;branch=z9hG4bK1366493399;received=192.168.14.35;rport=5060
From: <sip:3000 at 192.168.14.35 <sip%3A3000 at 192.168.14.35>>;tag=1127882803
To: <sip:3000 at 192.168.14.35 <sip%3A3000 at 192.168.14.35>>
Call-ID: 796455329 at 192.168.14.35
CSeq: 1 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Contact: <sip:3000 at 192.168.14.36 <sip%3A3000 at 192.168.14.36>>
Content-Length: 0
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.14.35:5060
;branch=z9hG4bK1366493399;received=192.168.14.35;rport=5060
From: <sip:3000 at 192.168.14.35 <sip%3A3000 at 192.168.14.35>>;tag=1127882803
To: <sip:3000 at 192.168.14.35 <sip%3A3000 at 192.168.14.35>>;tag=as0f0ad599
Call-ID: 796455329 at 192.168.14.35
CSeq: 1 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="1929e732"
Content-Length: 0
What is wrong in my code ?
Big thanks for your help.
--
IDRISS GHODHBANE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100426/3662594f/attachment.htm
More information about the asterisk-users
mailing list