Hi,
I want to use the pjsua to try send an instant message to another IPV6 client. So, according to one of the mailing list of title, "how to enable IPv6 address calling" there has the step to modify the pjsua for IPv6 support (I guess including support for IM). Part of the mail is as below:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
First of all you need to use SVN trunk version since 0.8 release
doesn't support IPv6. Then put this in your config_site.h:
#define PJ_HAS_IPV6 1
Then you need to modify pjsua_app.c to create IPv6 SIP and media
transports. For the SIP transport, replace PJSIP_TRANSPORT_UDP with
PJSIP_TRANSPORT_UDP6 (and same for TCP, although I haven't tested with
TCP. But it should work).
For
IPv6 media transports, you'd need to create the media transports
manualy with pjmedia_transport_udp_create3(), specifying pj_AF_INET6()
as "af" argument, then give the media transport instances in the array
to pjsua-lib with pjsua_media_transports_attach().
Then when making calls, don't forget to enclose the IPv6 host part of
the URI with square brackets (e.g. "sip:user@[::1]"), otherwise you'll
get the Invalid URI error. You may be able to resolve IPv6 hosts as
long as DNS resolver is disabled (i.e. don't use --nameserver option
in pjsua), but I haven't tried this.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Currently I'm using PJProject 1.0.1. Is it suitable for use?
In the pjsua_apps.c I have following modified code portion as the guide
(replace PJSIP_TRANSPORT_UDP with PJSIP_TRANSPORT_UDP6 (and same for TCP)):
/* Add UDP transport unless it's disabled. */
if (!app_config.no_udp) {
pjsua_acc_id aid;
status = pjsua_transport_create(PJSIP_TRANSPORT_UDP6,
&app_config.udp_cfg,
&transport_id);
if (status != PJ_SUCCESS)
goto on_error;
/* Add local account */
pjsua_acc_add_local(transport_id, PJ_TRUE, &aid);
//pjsua_acc_set_transport(aid, transport_id);
pjsua_acc_set_online_status(current_acc, PJ_TRUE);
if (app_config.udp_cfg.port == 0) {
pjsua_transport_info ti;
pj_sockaddr_in *a;
pjsua_transport_get_info(transport_id, &ti);
a = (pj_sockaddr_in*)&ti.local_addr;
tcp_cfg.port = pj_ntohs(a->sin_port);
}
}
/* Add TCP transport unless it's disabled */
if (!app_config.no_tcp) {
status = pjsua_transport_create(PJSIP_TRANSPORT_TCP6,
&tcp_cfg,
&transport_id);
if (status != PJ_SUCCESS)
goto on_error;
/* Add local account */
pjsua_acc_add_local(transport_id, PJ_TRUE, NULL);
pjsua_acc_set_online_status(current_acc, PJ_TRUE);
}
I also change the code as guide (create the media transports manualy with pjmedia_transport_udp_create3(), specifying pj_AF_INET6() as "af" argument, then give the media transport instances in the array to pjsua-lib with pjsua_media_transports_attach())
Following is my code portion:
static pj_status_t create_transport_adapter(pjmedia_endpt *med_endpt, int port,
pjmedia_transport **p_tp)
{
pjmedia_transport *udp;
pj_status_t status;
/* Create the UDP media transport */
status = pjmedia_transport_udp_create3(med_endpt, pj_AF_INET6(), NULL, NULL, port, 0, &udp);
if (status != PJ_SUCCESS)
return status;
/* Create the adapter */
status = pjmedia_tp_adapter_create(med_endpt, NULL, udp, p_tp);
if (status != PJ_SUCCESS) {
pjmedia_transport_close(udp);
return status;
}
return PJ_SUCCESS;
}
Is it all that I need to do?
However, after done all the change, when i start the pjsua with command below:
./pjsua-i686-pc-linux-gnu --id sip:mobile@[2001:db8:121::3] --registrar sip:[2001:db8:121::3]
the pjsua register to sip server (SER) , and then it straight unregister. Can I know whats happen here?
I urgently need helps from you all since I google around but with very little information about this.
Thanks in advance.
Sincerely,
ws
Visit our blog: http://blog.pjsip.org
pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
2009/3/20 Soh Wei Sin wssoh85@yahoo.com
Hi,
[snip]
Is it all that I need to do?
It probably is.
However, after done all the change, when i start the pjsua with command
below:
./pjsua-i686-pc-linux-gnu --id sip:mobile@[2001:db8:121::3] --registrar
sip:[2001:db8:121::3]
the pjsua register to sip server (SER) , and then it straight unregister.
Can I know whats happen here?
Log file will be of great help.
cheers
benny
I urgently need helps from you all since I google around but with very
little information about this.
Thanks in advance.
Sincerely,
ws
Visit our blog: http://blog.pjsip.org
pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
Visit our blog: http://blog.pjsip.org
pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
Hi Benny,
The attached file is my log file. From the log file, I found that the pjsua is able to register to SER, however, after it success in register, then it automatically unregister
after that. Why would this happen?
sincerely,
ws
From: Benny Prijono bennylp@teluu.com
To: pjsip list pjsip@lists.pjsip.org
Sent: Friday, March 20, 2009 10:08:51 PM
Subject: Re: [pjsip] pjsua unregister upon register for ipv6 client
2009/3/20 Soh Wei Sin wssoh85@yahoo.com
Hi,
[snip]
Is it all that I need to do?
It probably is.
However, after done all the change, when i start the pjsua with command below:
./pjsua-i686-pc-linux-gnu --id sip:mobile@[2001:db8:121::3] --registrar sip:[2001:db8:121::3]
the pjsua register to sip server (SER) , and then it straight unregister. Can I know whats happen here?
Log file will be of great help.
cheers
benny
I urgently need helps from you all since I google around but with very little information about this.
Thanks in advance.
Sincerely,
ws
Visit our blog: http://blog.pjsip.org
pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
Visit our blog: http://blog.pjsip.org
pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
Hi Benny,
Do I misunderstand what you mean? "A Log file will be on great help" mean which log file you suggest for me to read? or you was asking me for attach my log file to you?
Hope heard from you soon.
Thanks
Sincerely,
ws
From: Soh Wei Sin wssoh85@yahoo.com
To: pjsip list pjsip@lists.pjsip.org
Sent: Saturday, March 21, 2009 11:59:20 AM
Subject: Re: [pjsip] pjsua unregister upon register for ipv6 client
Hi Benny,
The attached file is my log file. From the log file, I found that the pjsua is able to register to SER, however, after it success in register, then it automatically unregister
after that. Why would this happen?
sincerely,
ws
From: Benny Prijono bennylp@teluu.com
To: pjsip list pjsip@lists.pjsip.org
Sent: Friday, March 20, 2009 10:08:51 PM
Subject: Re: [pjsip] pjsua unregister upon register for ipv6 client
2009/3/20 Soh Wei Sin wssoh85@yahoo.com
Hi,
[snip]
Is it all that I need to do?
It probably is.
However, after done all the change, when i start the pjsua with command below:
./pjsua-i686-pc-linux-gnu --id sip:mobile@[2001:db8:121::3] --registrar sip:[2001:db8:121::3]
the pjsua register to sip server (SER) , and then it straight unregister. Can I know whats happen here?
Log file will be of great help.
cheers
benny
I urgently need helps from you all since I google around but with very little information about this.
Thanks in advance.
Sincerely,
ws
Visit our blog: http://blog.pjsip.org
pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
Visit our blog: http://blog.pjsip.org
pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
-----Inline Attachment Follows-----
Script started on Sat 21 Mar 2009 11:51:37 AM MYT
]0;ims@ims-laptop: ~/Desktop/v6pjproject-1.0.1/pjsip-apps/binims@ims-laptop:~/Desktop/v6pjproject-1.0.1/pjsip-apps/bin$ sudo gedit /boot/grub/menu.lst ls[Kcd /boot/grub/[7@sudo gedit[C[C[C[C[C[C[C[C[C[C[C[C[12P./vlc -vvvcd Desktop/orivlc-0.8.6f/lear[K./vlc -vvv[6Pmake./vlc -vvv[6Pmakewping 192.168.1.10[1P510makw[Ke./vlc -vvv[6Pmake./vlc -vvv[5Pcleard Desktop/orivlc-0.8.6f/[15P./vlc -vvvsudo gedit /boot/grub/[7Pcd [C[C[C[C[C[C[C[C[C[C[C[Cls[Ksudo gedit /boot/grub/menu.lst [Ksudo gedit /boot/grub/menu.lst [K./pjsua-i686-pc-linux-gnu --local-port=6060 --id sip:h[Kims@[2001:db8:1
21::3] --registrar sip:[2001:db8:121::3]
11:52:25.653 os_core_unix.c pjlib 1.0.1 for POSIX initialized
11:52:25.654 sip_endpoint.c Creating endpoint instance...
11:52:25.654 pjlib select() I/O Queue created (0x81a8c68)
11:52:25.654 sip_endpoint.c Module "mod-msg-print" registered
11:52:25.654 sip_transport. Transport manager created.
11:52:25.654 sip_endpoint.c Module "mod-pjsua-log" registered
11:52:25.655 sip_endpoint.c Module "mod-tsx-layer" registered
11:52:25.655 sip_endpoint.c Module "mod-stateful-util" registered
11:52:25.655 sip_endpoint.c Module "mod-ua" registered
11:52:25.655 sip_endpoint.c Module "mod-100rel" registered
11:52:25.655 sip_endpoint.c Module "mod-pjsua" registered
11:52:25.655 sip_endpoint.c Module "mod-invite" registered
11:52:26.061 pasound.c PortAudio sound library initialized, status=0
11:52:26.061 pasound.c PortAudio host api count=2
11:52:26.061 pasound.c Sound device count=15
11:52:26.062 pjlib select() I/O Queue created (0x81c8cac)
11:52:26.062 sip_endpoint.c Module "mod-evsub" registered
11:52:26.062 sip_endpoint.c Module "mod-presence" registered
11:52:26.062 sip_endpoint.c Module "mod-refer" registered
11:52:26.062 sip_endpoint.c Module "mod-pjsua-pres" registered
11:52:26.062 sip_endpoint.c Module "mod-pjsua-im" registered
11:52:26.062 sip_endpoint.c Module "mod-pjsua-options" registered
11:52:26.063 pjsua_core.c 1 SIP worker threads created
11:52:26.063 pjsua_core.c pjsua version 1.0.1 for i686-pc-linux-gnu initialized
11:52:26.368 pjsua_core.c SIP UDP socket reachable at 2001:db8:121::3:6060
11:52:26.368 udpv60x81d83b0 SIP UDP IPv6 transport started, published address is 2001:db8:121::3:6060
11:52:26.368 pjsua_acc.c Account sip:[2001:db8:121::3]:6060 added with id 0
11:52:26.368 tcplis:6060 SIP TCP listener ready for incoming connections at 192.168.1.10:6060
11:52:26.368 pjsua_acc.c Account sip:[192.168.1.10]:6060;transport=TCP added with id 1
11:52:26.368 pjsua_acc.c Account sip:ims@[2001:db8:121::3] added with id 2
11:52:26.368 pjsua_core.c TX 447 bytes Request msg REGISTER/cseq=60648 (tdta0x81dae10) to UDP 2001:db8:121::3:5060:
REGISTER sip:[2001:db8:121::3] SIP/2.0
Via: SIP/2.0/UDP [2001:db8:121::3]:6060;rport;branch=z9hG4bKPjA2WfcmH7EuBIa8RJ5qjFaL-AnQGoyDNG
Max-Forwards: 70
From: sip:ims@[2001:db8:121::3];tag=1QQcZBzeEFNOTUXj1SnMWjoXaVWICjQ2
To: sip:ims@[2001:db8:121::3]
Call-ID: pMlBEOOxmlc5jk.xt0HQWCeBJ4xL7gb5
CSeq: 60648 REGISTER
User-Agent: PJSUA v1.0.1/i686-pc-linux-gnu
Contact: sip:ims@[2001:db8:121::3]:6060
Expires: 300
Content-Length: 0
--end msg--
11:52:26.369 pjsua_acc.c Registration sent
11:52:26.369 pjsua_media.c RTP socket reachable at 192.168.1.10:4000
11:52:26.369 pjsua_media.c RTCP socket reachable at 192.168.1.10:4001
11:52:26.369 pjsua_media.c RTP socket reachable at 192.168.1.10:4002
11:52:26.369 pjsua_media.c RTCP socket reachable at 192.168.1.10:4003
11:52:26.369 pjsua_media.c RTP socket reachable at 192.168.1.10:4004
11:52:26.369 pjsua_media.c RTCP socket reachable at 192.168.1.10:4005
11:52:26.369 pjsua_media.c RTP socket reachable at 192.168.1.10:4006
11:52:26.369 pjsua_media.c RTCP socket reachable at 192.168.1.10:4007
Account list:
[ 0] sip:[2001:db8:121::3]:6060: does not register
Online status: Online
[ 1] sip:[192.168.1.10]:6060;transport=TCP: does not register
Online status: Online
*[ 2] sip:ims@[2001:db8:121::3]: 100/In Progress (expires=0)
Online status: Online
Buddy list:
-none-
---===========+
You have 0 active call
11:52:26.375 pjsua_core.c RX 685 bytes Response msg 200/REGISTER/cseq=60648 (rdata0x81d8824) from UDP 2001:db8:121::3:5060:
SIP/2.0 200 OK
Via: SIP/2.0/UDP [2001:db8:121::3]:6060;rport=6060;branch=z9hG4bKPjA2WfcmH7EuBIa8RJ5qjFaL-AnQGoyDNG;received=2001:DB8:121:0:0:0:0:3
From: sip:ims@[2001:db8:121::3];tag=1QQcZBzeEFNOTUXj1SnMWjoXaVWICjQ2
To: sip:ims@[2001:db8:121::3];tag=9ab222bedaadae7945b972e442a3f11d.f31f
Call-ID: pMlBEOOxmlc5jk.xt0HQWCeBJ4xL7gb5
CSeq: 60648 REGISTER
Contact: sip:ims@[2001:db8:121::3]:6060;expires=300
Server: Sip EXpress router (0.9.6 (i386/linux))
Content-Length: 0
Warning: 392 2001:DB8:121:0:0:0:0:3:5060 "Noisy feedback tells: pid=10131 req_src_ip=2001:DB8:121:0:0:0:0:3 req_src_port=6060 in_uri=sip:[2001:db8:121::3] out_uri=sip:[2001:db8:121::3] via_cnt==1"
--end msg--
11:52:26.375 pjsua_acc.c IP address change detected for account 2 (2001:db8:121::3:6060 --> 2001:DB8:121:0:0:0:0:3:6060). Updating registration..
11:52:26.376 pjsua_core.c TX 445 bytes Request msg REGISTER/cseq=60649 (tdta0x81e7400) to UDP 2001:db8:121::3:5060:
REGISTER sip:[2001:db8:121::3] SIP/2.0
Via: SIP/2.0/UDP [2001:db8:121::3]:6060;rport;branch=z9hG4bKPjBkzhNOLdaUSScRCJb4HCcPtttV8yg7vq
Max-Forwards: 70
From: sip:ims@[2001:db8:121::3];tag=3vxkLPG9J6EjDoKVW.926s2v0JFaswAl
To: sip:ims@[2001:db8:121::3]
Call-ID: pMlBEOOxmlc5jk.xt0HQWCeBJ4xL7gb5
CSeq: 60649 REGISTER
User-Agent: PJSUA v1.0.1/i686-pc-linux-gnu
Contact: sip:ims@[2001:db8:121::3]:6060
Expires: 0
Content-Length: 0
--end msg--
11:52:26.376 pjsua_acc.c Unregistration sent
11:52:26.376 sip_reg.c Invalid Contact URI: "sip:ims@2001:DB8:121:0:0:0:0:3:6060;transport=UDP"
11:52:26.376 pjsua_acc.c Client registration initialization error: Invalid URI (PJSIP_EINVALIDURI) [status=171039]
11:52:26.376 pjsua_acc.c Unable to create registration: Invalid URI (PJSIP_EINVALIDURI) [status=171039]
11:52:26.376 pjsua_core.c RX 630 bytes Response msg 200/REGISTER/cseq=60649 (rdata0x81d8824) from UDP 2001:db8:121::3:5060:
SIP/2.0 200 OK
Via: SIP/2.0/UDP [2001:db8:121::3]:6060;rport=6060;branch=z9hG4bKPjBkzhNOLdaUSScRCJb4HCcPtttV8yg7vq;received=2001:DB8:121:0:0:0:0:3
From: sip:ims@[2001:db8:121::3];tag=3vxkLPG9J6EjDoKVW.926s2v0JFaswAl
To: sip:ims@[2001:db8:121::3];tag=9ab222bedaadae7945b972e442a3f11d.868a
Call-ID: pMlBEOOxmlc5jk.xt0HQWCeBJ4xL7gb5
CSeq: 60649 REGISTER
Server: Sip EXpress router (0.9.6 (i386/linux))
Content-Length: 0
Warning: 392 2001:DB8:121:0:0:0:0:3:5060 "Noisy feedback tells: pid=10133 req_src_ip=2001:DB8:121:0:0:0:0:3 req_src_port=6060 in_uri=sip:[2001:db8:121::3] out_uri=sip:[2001:db8:121::3] via_cnt==1"
--end msg--
q
11:52:40.060 pasound.c PortAudio sound library shutting down..
11:52:40.061 pjsua_core.c Shutting down...
11:52:41.064 pjsua_core.c Destroying...
11:52:41.064 sip_transactio Stopping transaction layer module
11:52:41.064 sip_endpoint.c Module "mod-pjsua-options" unregistered
11:52:41.064 sip_endpoint.c Module "mod-pjsua-im" unregistered
11:52:41.064 sip_endpoint.c Module "mod-pjsua-pres" unregistered
11:52:41.064 sip_endpoint.c Module "mod-pjsua" unregistered
11:52:41.064 sip_endpoint.c Module "mod-stateful-util" unregistered
11:52:41.064 sip_endpoint.c Module "mod-refer" unregistered
11:52:41.064 sip_endpoint.c Module "mod-presence" unregistered
11:52:41.064 sip_endpoint.c Module "mod-evsub" unregistered
11:52:41.064 sip_endpoint.c Module "mod-invite" unregistered
11:52:41.064 sip_endpoint.c Module "mod-100rel" unregistered
11:52:41.064 sip_endpoint.c Module "mod-ua" unregistered
11:52:41.064 sip_transactio Transaction layer module destroyed
11:52:41.064 sip_endpoint.c Module "mod-tsx-layer" unregistered
11:52:41.064 sip_endpoint.c Module "mod-msg-print" unregistered
11:52:41.064 sip_endpoint.c Module "mod-pjsua-log" unregistered
11:52:41.068 tcplis:6060 SIP TCP listener destroyed
11:52:41.068 sip_endpoint.c Endpoint 0x81a0dbc destroyed
11:52:41.069 pjsua_core.c PJSUA destroyed...
]0;ims@ims-laptop: ~/Desktop/v6pjproject-1.0.1/pjsip-apps/binims@ims-laptop:~/Desktop/v6pjproject-1.0.1/pjsip-apps/bin$ exit
exit
Script done on Sat 21 Mar 2009 11:52:43 AM MYT