Function in sip_transport_udp.c bugs in IPv6 and pjsip_endpt_acquire_transport bugs too

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
 
I'm trying to update my application for IPv6 but I discover a lot of bug in PJSIP.I use last version of PJSIP and I don't work with PJSUA nor PJSimple-UA.
 
First of all, I have tested in IPv6 the sample program simpleua, and it doesn't work : Segmentation Fault.I have add the define value in config_site.h, change pj_AFINET to pj_AFINET6, and compile correctly PJSIP.
 
After investigation, I see in get_published_name function in sip_transport_udp.c, in else part of "if (tmp_addr.addr.sa_family == pj_AF_INET())" line 504, you haven't used pj_strcpy2 to copy hosbuf in bound_name->hostIf you add it, there is no segmentation fault, but the published address print to screen is "::" :(
 
I haven't debug more this application because I don't try to get published name.
I create UDP socket with a known IP address and port like this :
 
 if (AF == pj_AF_INET()) {     //pj_sockaddr_in addr;     addIPSuccess = pj_inet_aton(&(dial->localInfo->IP), &(dial->addr.sin_addr));        dial->addr.sin_port = pj_htons(dial->localInfo->sipPort);     dial->addr.sin_family = pj_AF_INET();     status = pjsip_udp_transport_start( g_endpt, &(dial->addr), NULL, 1, NULL); } else if (AF == pj_AF_INET6()) {     //pj_sockaddr_in6 addr;     addIPSuccess = pj_inet_pton(pj_AF_INET6(), &(dial->localInfo->IP), &(dial->addr6.sin6_addr));        dial->addr6.sin6_port = pj_htons(dial->localInfo->sipPort);     dial->addr6.sin6_family = pj_AF_INET6();     status = pjsip_udp_transport_start6(g_endpt, &(dial->addr6), NULL, 1, NULL); } else {     status = PJ_EAFNOTSUP; }
 
"dial" is a structure used to keep data for a sip dialog (I don't use PJSIP dialog for some reasons too long to explain)"localInfo" also is a structure that contains local IP (pj_str_t) and a port (int).
 
It's works well in IPv4 but not in IPv6.
 
If I create a structure pjsip_host_port, init manualy it with data from localInfo, and calls pjsip_udp_transport_start6 with this params, I can create an UDP socket in IPv6.It's works well like this.
 
After doing this, I have discovered another bug, this time when I want send SIP message.To send SIP message, I use my own function that calls pjsip_endpt_acquire_transport and pjsip_transport_send. It's works well in IPv4 but not in IPv6.After long investigation, it seems that acquire_transport doesn't work, and if you put some logs in the find_entry the called hash function (from pjlib), you don't see the same log print on screen in IPv4 or IPv6.It's seems that source code has been updated in version 1.0.1, may be you haven't tested it in IPv6 ?
 
But if you don't use pjsip_endpt_acquire_transport, create your own socket, attach an UDP transport on it, like PJSUA done, you can send SIP message in IPv6.
 
Actually, I use transport created by pjsip_udp_transport_start6 to send SIP message, and it's work, I can establish a SIP session between two PJSIP User Agent.
 
I don't know if you have time to investigate more these bug, it would be great if you can do it, but I hope my mail can help other people that are trying PJSIP in IPv6 not with PJSUA.
 
If you have more information about all these bugs, I would be happy to know them :)
 
Thanks to have read me.
 
Regards,
 
C?dric.
_________________________________________________________________
T?l?phonez gratuitement ? tous vos proches avec Windows Live Messenger? !? T?l?chargez-le maintenant !
http://www.windowslive.fr/messenger/1.asp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20090213/5a608e53/attachment-0001.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux