[SOLVED i.e. the problem never existed...] PJSIP with no audio on out- and incoming calls

Hi!

I started to use pjsip to connect to a SIP trunk (German Telekom). Internal calls are no problem. In- and outgoing signalling is also no problem, but there is no audio with these calls.

The trunk is a bit special as it uses tcp for SIP, a proxy, and requires NAPTR and SRC to work for the name resolutions. My PBX is a bit special as it is sitting on the router and it sees the LAN and WAN, so NAT issues should not cause problems. It didn’t with chan_sip.

I have already looked at various pcap traces. When I enable rtp debugging in the cli, I see only incoming packets from the local phone. When I capture the traffic on the WAN side of the router, I actually see (and playback with wireshark) the external audio, but that does not arrive at Asterisk and the local phone. If I do not let Asterisk connect to a local phone and just playback MOH, the other side can hear it.

I am sure that I have overlooked something, but I can’t find out what that might be. Here’s my pjsip.conf:

[global]
type=global
max_initial_qualify_time=4

[transport-tcp]
type=transport
protocol=tcp
bind=0.0.0.0
;local_net=192.168.0.0/24
;local_net=127.0.0.1/32
;external_media_address=80.151.XXX.XXX
;external_signaling_address=80.151.XXX.XXX

[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0
;local_net=192.168.0.0/24
;external_media_address=80.151.XXX.XXX
;external_signaling_address=80.151.XXX.XXX

[tcomsip_reg]
type=registration
transport=transport-tcp
outbound_proxy=sip:reg.sip-trunk.telekom.de
outbound_auth=tcomsip_auth
server_uri=sip:sip-trunk.telekom.de
client_uri=sip:+49YYYYYYYYYY@sip-trunk.telekom.de
contact_user=+49YYYYYYYYYY
;line=yes
;endpoint=tcomsip_endpoint

[tcomsip_aor]
type=aor
contact=sip:55xxxxxxxxxx@sip-trunk.telekom.de
outbound_proxy=sip:reg.sip-trunk.telekom.de
default_expiration=600

[tcomsip_identify]
type=identify
endpoint=tcomsip_endpoint
match=reg.sip-trunk.telekom.de

[tcomsip_auth]
type=auth
realm=sip-trunk.telekom.de
username=55xxxxxxxxxx
password=secret
auth_type=userpass

[tcomsip_endpoint]
type=endpoint
;direct_media=no
context=from-telekom
allow=!all,g722,alaw,ulaw
timers=no
from_domain=sip-trunk.telekom.de
;auth=tcomsip_auth
outbound_auth=tcomsip_auth
outbound_proxy=sip:reg.sip-trunk.telekom.de
aors=tcomsip_aor
callerid=""<+49YYYYYYYYYY>
from_user=+49YYYYYYYYYY
dtmf_mode=rfc4733
;disable_direct_media_on_nat=yes
;rtp_symmetric=yes
;force_rport=yes
;rewrite_contact=yes

[phone001]
type=endpoint
auth=phone001
callerid=Phone #1<1001>
;direct_media=no
call_group=1
pickup_group=1
aors=phone001
aggregate_mwi=yes
device_state_busy_at=1
allow_subscribe=yes
transport=transport-udp
context=from-internal
allow=!all,g722,alaw,ulaw

[phone001]
type=auth
auth_type=userpass
username=phone001
password=admin ; just kidding

[phone001]
type=aor
max_contacts=1
qualify_frequency=63 

[phone002]
type=endpoint
auth=phone002
callerid=Phone #2<1002>
;direct_media=no
call_group=1
pickup_group=1
aors=phone002
device_state_busy_at=1
allow_subscribe=yes
transport=transport-udp
context=from-internal
allow=!all,g722,alaw,ulaw

[phone002]
type=auth
auth_type=userpass
username=phone002
password=admin

[phone002]
type=aor
max_contacts=1
qualify_frequency=61

At first glance there was nothing unusual in the the SIP traces, so my guess is that I am missing a “connection” in pjsip.

What is the actual SIP signaling? Is a reinvite occurring to send media directly? If so this can be disabled using the direct_media option.

Short answer: I think there is another INVITE after authorization. 217.0.132.121 is the media server.

Signaling is tcp and I didn’t find a problem with that, no matter what. Only Audio.

I have set up a FreePBX system with the same settings. The only two things I changed was to add manually the realm and to set direct media always to no. This configuration shows the same problems and there is no audio when external channels are involved.

What else could influence this?

You’d need to do further analysis and see. The SDP communicates the IP addresses to use for things, making sure they are correct is important. Secondly checking the traffic using a packet capture for RTP to see media flowing is also important. You need to break down the problem and isolate it further.

Meanwhile I have organized myself a Bintec be.IP Router that also gets sold by the service provider. I can currently use it only in the so-called “gateway mode” with an older Sangoma BRI card, but everything works as expected.

I’ll save a couple of pcap traces for various in- and outbound calls and then I shall see whether there is something special in them…

It could be my “net” with several gateways and an impertinent IPv6 auto-configuration. I saw some SDP data sets with IPv6 addresses in the connection field, which could send stuff to another gateway. I still need to verify that with a different setup. The VoIP router is IPv4 only and none of the Telekom SRV replies showed an IPv6 entry.

Problem solved. I simply forgot the “line” and “endpoint” statements in the registration definitions.

The docs more or less say, that these options must be set for the (rare) case that that this is supposed to work. PJSIP is an exercise an humility, :).

I don’t know if anyone encountered this before, but I share it here just in case. When I install Asterisk 18 on Debian 9, I didn’t open inbound udp ports, except for 5060. It was the reason of no sound in calls. After I allowed inbound udp ports, issue resolved for me.