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

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.


The problem is probably in sip.conf.


Here is my configuration of sip.conf

tos_sip = cs3
tos_audio = cs3
externip =
nat = force_rport,comedia
localnet =
limitonpeer = yes
context = inbound
alwaysauthreject = yes
qualify = yes
allowguest = yes

type = peer
fromuser = 01020304
callerid = 01020304
fromdomain =
defaultuser = 01020304
context = inbound
host =
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.


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.


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.


I was following some old blogs.

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.

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