[pjsip] how to enable IPv6 address calling
bennylp at pjsip.org
Wed May 21 08:14:17 EDT 2008
On Wed, May 21, 2008 at 12:52 PM, TARUN CHAPLOT <tarunchaplot at yahoo.com> wrote:
> Hello Everyone
> I am using pjproject-0.8.0 on Mac OS X and I tried to call a IPv6 address
> but it gives the below mentioned error:
> pjsua_app.c Invalid URL: unknown error -1
> pjsua_call.c unable to call : Invalid Request URI
> (PJSIP_EINVALIDREQUURI) [status=171042]
> I read that pjsip supports IPv6 but not able to find how.
> Can anybody tell what changes do I need to make to make enable IPv6 address
We tested IPv6 (SIP and media) calls with another implementation and
it seems to be working fine, but you're right, the IPv6 support is
still experimental for now and some modifications to the application
are needed to get it going.
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.
Good luck. :)
More information about the pjsip