Mobile Divert Issue with Asterisk CLI

Hi All,

I have configured the soft key on the phone & Asterisk to divert the call to mobile. Everything seems to be working fine, i am getting the call on mobile as well. But there is no audio both side.

Any idea what could be the issue? why i am not getting audio both side.

Here is the configuration

;123 DESKPHONE-EXTENSION
exten = 22334455,1,GotoIf(["{DEVICE_STATE(Custom:305)}" = “INUSE”]?5)
exten = 22334455,2,Dial(SIP/SIP-123,40,twk)
exten = 22334455,4,Hangup()
exten = 22334455,5,Dial(SIP/SIP-TRUNK/0123456789,45,twk)
exten = 22334455,6,Hangup()

Added under “internal” context:
; Mobile Divert
exten = 305,1,Answer()
exten = 305,2,GotoIf(["{DEVICE_STATE(Custom:305)}" != “INUSE”]?5)
exten = 305,3,Set(DEVICE_STATE(Custom:305)=Not_Inuse)
exten = 305,4,Hangup()
exten = 305,5,Set(DEVICE_STATE(Custom:305)=InUse)
exten = 305,6,Hangup()
exten = 305,hint,custom:305

Added softbutton with the name of Divert on Deskphone EXTENSION with value 305, this Divert the call to mobile number but no audio both ways.

Thanks

The problem is probably in sip.conf.

@david551

Here is my configuration of sip.conf

[general]
tos_sip = cs3
tos_audio = cs3
externip = 102.165.72.3
nat = force_rport,comedia
localnet = 10.10.25.0/255.255.255.0
limitonpeer = yes
context = inbound
alwaysauthreject = yes
qualify = yes
allowguest = yes

[SIP-TRUNK-PROVIDER1]
type = peer
fromuser = 01020304
callerid = 01020304
fromdomain = sip.trunkprovier.com
defaultuser = 01020304
context = inbound
host = sip.trunkprovier.com
dtmfmode = rfc2833
disallow = all
allow = alaw
limitonpeers = yes
call-limt = 8
canreinvite = no
pedantic = no
qualify = 4000
insecure = port,invite
nat = force_rport,comedia
keepalive = yes
requirecalltoken = no

I believe canreinvite is still recognized, even though it was replaced many many years ago, so the most obvious cause doesn’t apply.

I think you need to provide the actual SIP INVITE transactions.

@david551

If i will change

canreinvite = yes

you think it may fix the problem. I can try this tomorrow and update you.

You want directmedia=no. canreinvite is the old name for directmedia, and no is the safe setting with regard to no audio type problems.

@david551

This is my Asterisk Version

Asterisk 15.1.5

I am sorry, but i did not understand this , what should i do to fix this audio issue.

Provide sip set debug on traces, and probably also rtp debug traces, so that it is easier to see what is going wrong.

@david551

I was following some old blogs.

https://community.asterisk.org/t/calls-with-no-audio-in-both-sides/73244/16

Do you think, if i will change nat = yes will fix the problem?

nat=yes is deprecated.

It is much easier to look at the traces and see what is happening than to try and guess workarounds.