PJSIP IPV6 Transport does not bind to ::

Hello,

I have newly installed Asterisk 13.0.1 on my raspberry box.

I am triyng to set up PJSIP using an IPV6 transport.

The box has a global address and two local addresses:

asterisk@raspbx ~ $ ifconfig -a
eth0 Link encap:Ethernet HWaddr b8:27:eb:da:bb:b6
inet addr:192.168.178.99 Bcast:192.168.178.255 Mask:255.255.255.0
inet6 addr: fe80::ba27:ebff:feda:bbb6/64 Scope:Link
inet6 addr: 2a02:8070:8680:9520:ba27:ebff:feda:bbb6/64 Scope:Global
inet6 addr: fd00::ba27:ebff:feda:bbb6/64 Scope:Global
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:23373 errors:0 dropped:0 overruns:0 frame:0
TX packets:26482 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2431636 (2.3 MiB) TX bytes:11339366 (10.8 MiB)

The transport definition in pjsip.conf is:

[udp-ipv6]
type=transport
protocol=udp
bind=::

as it is described in the documentation to have it binded to all available addresses

I get the following message when starting up asterisk:

[Dec 12 00:58:23] Asterisk 13.0.1 built by root @ raspberrypi on a armv6l running Linux on 2014-12-06 17:25:37 UTC
[Dec 12 00:58:24] NOTICE[10157] cdr.c: CDR simple logging enabled.
[Dec 12 00:58:26] NOTICE[10157] loader.c: 232 modules will be loaded.
[Dec 12 00:58:26] WARNING[10157] loader.c: Error loading module ‘res_monitor.so’: /usr/lib/asterisk/modules/res_monitor.so: undefined symbol: __ast_beep_stop
[Dec 12 00:58:31] ERROR[10157] config_options.c: Could not find option suitable for category ‘easybell’ named ‘aors’ at line 34 of
[Dec 12 00:58:31] ERROR[10157] res_sorcery_config.c: Could not create an object of type ‘auth’ with id ‘easybell’ from configuration file ‘pjsip.conf’
[Dec 12 00:58:31] ERROR[10157] config_options.c: Error parsing bind=:: at line 8 of
[Dec 12 00:58:31] ERROR[10157] res_sorcery_config.c: Could not create an object of type ‘transport’ with id ‘udp-ipv6’ from configuration file ‘pjsip.conf’

Is there an alternate way to bind asterisk to all available IPV6 addresses, I do not want to use a specific address, as the address is given by the ISP and may change over time.

(I did not yet try to bind asterisk to the global address)

It also does not bind to a fully qualified address:

[Dec 12 18:03:16] DEBUG[11475] config.c: Parsing /etc/asterisk/pjsip.conf
[Dec 12 18:03:16] VERBOSE[11475] config.c: Parsing ‘/etc/asterisk/pjsip.conf’: Found
[Dec 12 18:03:16] DEBUG[11475] config.c: extract int from [0] in [0, 65535] gives 0
[Dec 12 18:03:16] DEBUG[11475] config.c: extract int from [100] in [1, 2147483647] gives 100
[Dec 12 18:03:16] DEBUG[11475] config.c: extract int from [1] in [-2147483648, 2147483647] gives 1
[Dec 12 18:03:16] DEBUG[11475] config.c: extract int from [0] in [-2147483648, 2147483647] gives 0
[Dec 12 18:03:16] ERROR[11475] config_options.c: Error parsing bind=fe80::ba27:ebff:feda:bbb6 at line 8 of
[Dec 12 18:03:16] ERROR[11475] res_sorcery_config.c: Could not create an object of type ‘transport’ with id ‘udp-ipv6’ from configuration file ‘pjsip.conf’

Did you compile pjproject with IPv6 support? IPv6 doesn’t build by default with pjproject.

wiki.asterisk.org/wiki/display/ … +pjproject

Hm,

I compiled it straight as it came from the asterisk repository and made no change to any configure file.

I will look if I can figure it out.

There’s a note on there reading:

Enabling IPV6 Support
IPv6 support in pjproject is, by default, disabled. To enable it, add CFLAGS=’-DPJ_HAS_IPV6=1’ to your ./configure command.

That should help.

Cheers

Hm, the make of pjproject fails with an undefined reference.

** Edited after I changed the configure command **

configure:

./configure --with-external-speex --with-external-srtp --with-external-gsm --prefix=/usr --enable-shared --disable-sound --disable-resample --disable-video --disable-opencore-amr CFLAGS=’-O2 -DNDEBUG -DPJ_HAS_IPV6=1’

failure of make:

gcc -o …/bin/pjmedia-test-armv6l-unknown-linux-gnueabihf
output/pjmedia-test-armv6l-unknown-linux-gnueabihf/codec_vectors.o output/pjmedia-test-armv6l-unknown-linux-gnueabihf/jbuf_test.o output/pjmedia-test-armv6l-unknown-linux-gnueabihf/main.o output/pjmedia-test-armv6l-unknown-linux-gnueabihf/mips_test.o output/pjmedia-test-armv6l-unknown-linux-gnueabihf/vid_codec_test.o output/pjmedia-test-armv6l-unknown-linux-gnueabihf/vid_dev_test.o output/pjmedia-test-armv6l-unknown-linux-gnueabihf/vid_port_test.o output/pjmedia-test-armv6l-unknown-linux-gnueabihf/rtp_test.o output/pjmedia-test-armv6l-unknown-linux-gnueabihf/test.o output/pjmedia-test-armv6l-unknown-linux-gnueabihf/sdp_neg_test.o -lpjmedia-codec -lpjmedia-videodev -lpjmedia -lpjmedia-audiodev -lpj -lpjlib-util -lpjnath -lilbccodec -lg7221codec -lsrtp -lgsm -lspeex -lspeexdsp -luuid -lm -lrt -lpthread -lcrypto -lssl -L/home/asterisk/src/asterisk-complete/asterisk/asterisk-13.0.1/pjproject/pjlib/lib -L/home/asterisk/src/asterisk-complete/asterisk/asterisk-13.0.1/pjproject/pjlib-util/lib -L/home/asterisk/src/asterisk-complete/asterisk/asterisk-13.0.1/pjproject/pjnath/lib -L/home/asterisk/src/asterisk-complete/asterisk/asterisk-13.0.1/pjproject/pjmedia/lib -L/home/asterisk/src/asterisk-complete/asterisk/asterisk-13.0.1/pjproject/pjsip/lib -L/home/asterisk/src/asterisk-complete/asterisk/asterisk-13.0.1/pjproject/third_party/lib
/home/asterisk/src/asterisk-complete/asterisk/asterisk-13.0.1/pjproject/pjmedia/lib/libpjmedia.so: undefined reference to `srtp_shutdown’
collect2: ld returned 1 exit status
/home/asterisk/src/asterisk-complete/asterisk/asterisk-13.0.1/pjproject/build/rules.mak:122: recipe for target ‘…/bin/pjmedia-test-armv6l-unknown-linux-gnueabihf’ failed
make[2]: *** […/bin/pjmedia-test-armv6l-unknown-linux-gnueabihf] Error 1
make[2]: Leaving directory '/home/asterisk/src/asterisk-complete/asterisk/asterisk-13.0.1/pjproject/pjmedia/build’
Makefile:242: recipe for target ‘pjmedia-test-armv6l-unknown-linux-gnueabihf’ failed
make[1]: *** [pjmedia-test-armv6l-unknown-linux-gnueabihf] Error 2
make[1]: Leaving directory '/home/asterisk/src/asterisk-complete/asterisk/asterisk-13.0.1/pjproject/pjmedia/build’
Makefile:14: recipe for target ‘all’ failed
make: *** [all] Error 1

Hm,

trial and error here.

I looked into the config log of asterisk and found that there is a PJPROJECT_CFLAGS option.
So I configured asterisk again (in the main asterisk source directory) with:

./configure PJPROJECT_CFLAGS=-DPJ_HAS_IPV6=1 -DPJ_AUTOCONF=1 -O2 -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1 -fPIC -DOPENSSL_NO_SSL2=1 -I/usr/local/include

It is still compiling now (that takes some hours on my box)…

Well,

let me put together what I found out meanwhile.

  1. When downloading asterisk there is a script in contrib/scripts named install_prereq.
  2. The script can download and install packaged and unpackaged prerequisites.
  3. For the raspian distro pjproject is in the unpackaged prereqs.
  4. The script downloads and installs pjproject from github.com/asterisk/pjproject.git
  5. The script compiles pjproject without IPV6 support
  6. When trying to build this version of pjproject the build fails with an unresolved reference to srtp_shutdown
  7. When downloading the newest version of pjproject from svn co svn.pjsip.org/repos/pjproject/trunk/ the build with IPV6 support succeeds

This is the current state for me. Currently I am rebuilding asterisk after the last change.

pjsip show transports

Transport: <TransportId…> <BindAddress…>

Transport: udp-ipv6 udp 0 0 [::]:5060