One-way audio in outbound calls to trunk

Hello All,

I am running FreePBX 15 and Asterisk 16 installation which is running behind a TD-LTE modem-router. I have a DID from my ISP which is configured as a SIP trunk (chan_sip). I have set RTP port range to 7000-20000 in Asterisk SIP settings. Also have forwarded this port range in my router.

Incoming calls from trunk work well. However when dial an outside number, only outgoing audio is working and incoming audio does not touch my softphone. My extension is an IAX2 type to avoid NAT traversal issues as both Asterisk and softphones are behind NAT but inside different networks. Also using IAX2 solved my security problem where SIP scanners were trying to scan and extensions so I have only white-listed my ISP’s VoIP server.
Bellow is my trunk config as Asterisk general and SIP config:

sip.conf:
[global]
type=global
user_agent=FPBX-15.0.16.38(16.7.0)
default_outbound_endpoint=dpma_endpoint
endpoint_identifier_order=ip,username,anonymous,header,auth_username

sip_additional.conf (trunk config):[2191012100]
type=user
secret=mysecret
context=from-trun

[Asiatel-021]
username=2191012100
type=friend
secret=mysecret
qualify=yes
nat=force_rport,comedia
insecure=port,invite
host=185.98.113.122
fromuser=2191012100
context=from-trunk
allow=all
nat=force_rport,comedia

sip_general_additional.confaccept_outofcall_message=yes
auth_message_requests=no
outofcall_message_context=dpma_message_context
faxdetect=no
vmexten=*97
useragent=FPBX-15.0.16.38(16.7.0)
language=fa
disallow=all
allow=ulaw
allow=alaw
allow=gsm
allow=g726
allow=g722
allow=g723
allow=g719
allow=g729
allow=slin
allow=slin12
allow=slin16
allow=slin24
allow=slin32
allow=slin44
allow=slin48
allow=slin96
allow=slin192
allow=opus
allow=speex
allow=speex16
allow=speex32
allow=siren7
allow=adpcm
allow=silk8
allow=silk12
allow=silk16
allow=silk24
allow=lpc10
allow=testlaw
allow=none
allow=ilbc
allow=codec2
allow=siren14
context=from-sip-external
callerid=Unknown
notifyringing=yes
notifyhold=yes
tos_sip=cs3
tos_audio=ef
tos_video=af41
alwaysauthreject=yes
limitonpeers=yes
icesupport=no
rtpend=20000
context=from-trunk
callerid=Unknown
rtpstart=7000
tcpenable=yes
callevents=yes
jbenable=yes
jblog=no
jbimpl=adaptive
jbforce=yes
jbmaxsize=200
jbresyncthreshold=1000
checkmwi=10
maxexpiry=3600
minexpiry=60
srvlookup=no
tlsenable=no
allowguest=yes
notifyhold=yes
rtptimeout=10
canreinvite=yes
tlsbindaddr=[::]:5161
rtpkeepalive=10
videosupport=no
defaultexpiry=120
notifyringing=yes
maxcallbitrate=384
rtpholdtimeout=300
g726nonstandard=no
registertimeout=20
tlsclientmethod=tlsv1
registerattempts=0
nat=force_rport,comedia
ALLOW_SIP_ANON=no
udpbindaddr=0.0.0.0:5060
tlscafile=/etc/ssl/certs/ca-certificates.crt
externip=MyIP
localnet=192.168.1.0/24

Your help is appreciated

I chacked with tcpdump and it seems RTP packaets on the port given in SIP message is comming to the box. It seems it something to do with codecs. In the SIP message, I see provider is offering PCMU/8000 but there is no such codec to enable in Asterisk SIP settings page.

Any idea?

Hi shetab, PCMU should be the same as ulaw/g711u. Do you see the same codecs being used for the working inbound calls ? In your previous ticket about this issue, you mentioned having some packet captures. Is the tcpdump showing RTP packets flowing in both directions, between your pbx and the provider? You can try taking a look at Settings->Asterisk SIP Settings, and take a look at the external address option to make sure it’s accurate. Also does your config shows “nat=force_rport,comedia”. Does the default NAT setting of yes(in SIP Settings) not work for your environment?

I have static IP assigned from my ISP. It is accurate. I now have “allow=all” for both incoming and outgoing.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.