Asterisk ringing issue

Dear Team,

I have an asterisk server with version 11.

And there is SIP line is terminated on the asterisk server. And i have routed the call to my dialplan for ringing and play voicefile. Below is my dialplan

exten => _XXXXXXXX,1,Ringing
exten => _XXXXXXXX,n,Playback(Myfile)
exten => _XXXXXXXX,n,Hangup()

While executing this dialplan if the person who call on the number they will able to hear the Voicefile but if the person speak anything then the voicefile is breaking or going silent.

The same dialplan if i comment the lines for ringing as below then there is no issue.

exten => _912238615133,1,Playback(Myfile)
exten => _912238615133,n,Hangup()

Can anyone help me to find out why am facing the voice issue while using the Riniging application ?

All Ringing does is to cause Asterisk to give an intermediate SIP response of 180 Ringing. The Playback will cause a final 200 OK response. I would look to the peer for the source of the problem.


when i remove the Ringing application from dial plan there is no issue…

Below is the SIP Trunk Details.

context=trunkinbound ; Default context for incoming calls
allowguest=no ; Allow or reject guest calls (default is yes, this can also be set to ‘osp’
;realm=mydomain.tld ; Realm for digest authentication
bindport=5060 ; UDP Port to bind to (SIP standard port is 5060)
bindaddr= ; IP address to bind to ( binds to all)
srvlookup=yes ; Enable DNS SRV lookups on outbound calls
;domain=mydomain.tld ; Set default domain for this host
;domain= ; Add IP address as local domain
;allowexternalinvites=no ; Disable INVITE and REFER to non-local domains
;autodomain=yes ; Turn this on to have Asterisk add local host
;pedantic=yes ; Enable slow, pedantic checking for Pingtel
;tos=184 ; Set IP QoS to either a keyword or numeric val
tos=lowdelay ; lowdelay,throughput,reliability,mincost,none
maxexpiry=3600 ; Max length of incoming registration we allow
defaultexpiry=120 ; Default length of incoming/outgoing registration
;notifymimetype=text/plain ; Allow overriding of mime type in MWI NOTIFY
;checkmwi=10 ; Default time between mailbox checks for peers
;vmexten=voicemail ; dialplan extension to reach mailbox sets the
;videosupport=yes ; Turn on support for SIP video
;recordhistory=yes ; Record SIP history by default
disallow=all ; First disallow all codecs
allow=ulaw ; Allow codecs in order of preference
allow=alaw ; Allow codecs in order of preference
allow=gsm ;
musicclass=default ; Sets the default music on hold class for all SIP calls
language=en ; Default language setting for all users/peers
relaxdtmf=yes ; Relax dtmf handling
rtptimeout=60 ; Terminate call if 60 seconds of no RTP activity
;rtpholdtimeout=300 ; Terminate call if 300 seconds of no RTP activity
trustrpid=no ; If Remote-Party-ID should be trusted
sendrpid=yes ; If Remote-Party-ID should be sent
progressinband=no ; If we should generate in-band ringing always
;useragent=Asterisk PBX ; Allows you to change the user agent string
promiscredir = no ; If yes, allows 302 or REDIR to non-local SIP address
;usereqphone = no ; If yes, “;user=phone” is added to uri that contains
dtmfmode = rfc2833 ; Set default dtmfmode for sending DTMF. Default: rfc2833
;compactheaders = yes ; send compact sip headers.
;sipdebug = yes ; Turn on SIP debugging by default, from
;subscribecontext = default ; Set a specific context for SUBSCRIBE requests
;notifyringing = yes ; Notify subscriptions on RINGING state
;alwaysauthreject = yes ; When an incoming INVITE or REGISTER is to be rejected,
;registertimeout=20 ; retry registration calls every 20 seconds (default)
;registerattempts=10 ; Number of registration attempts before we give up
callevents=no ; generate manager events when sip ua performs events (e.g. hold)
;externip = ; Address that we’re going to put in outbound SIP messages
; ; Alternatively you can specify an
;externrefresh=10 ; How often to refresh externhost if
localnet=; All RFC 1918 addresses are local networks
localnet= ; Also RFC1918
localnet= ; Another RFC1918 with CIDR notation
localnet= ;Zero conf local network
nat=yes ; Global NAT settings (Affects all peers and users)
;rtcachefriends=yes ; Cache realtime friends by adding them to the internal list
;rtupdate=yes ; Send registry updates to database using realtime? (yes|no)
;rtautoclear=yes ; Auto-Expire friends created on the fly on the same schedule
;ignoreregexpire=yes ; Enabling this setting has two functions:
; domain=myasterisk.dom
; autodomain=yes
; fromdomain=mydomain.tld ; When making outbound SIP INVITEs to

register =>987987@

sendrpid = yes

Kindly let us know if you have required any more details for the same.

Logs, at at least verbosity 5, and including the SIP protocol logs.

Logs are looking normal only …there is no error or warning while facing the issue.

Below is sample Logs for your reference.

Scenario 1 : Where facing the Voice Breaking issue while using the Ringing Application.

-- Executing [789789@trunkinbound:1] Goto("SIP/MY-sip-trunk-00000474", "trunkinbound,789787,1") in new stack
-- Goto (trunkinbound,789787,1)
-- Executing [789787@trunkinbound:1] Ringing("SIP/MY-sip-trunk-00000474", "") in new stack
-- Executing [789787@trunkinbound:2] Playback("SIP/MY-sip-trunk-00000474", "/home/local/CORPORATE/vijo/clubwav") in new stack
   > 0x7f05d00211e0 -- Probation passed - setting RTP source address to
-- <SIP/MY-sip-trunk-00000474> Playing '/home/local/CORPORATE/vijo/clubwav.slin' (language 'en')

> 0x7f05d0000910 – Probation passed - setting RTP source address to
== Spawn extension (trunkinbound, 789787, 2) exited non-zero on ‘SIP/MY-sip-trunk-00000474’
– Executing [h@trunkinbound:1] AGI(“SIP/MY-sip-trunk-00000474”, “agi://–HVcauses–PRI-----NODEBUG-----0---------------”) in new stack

Scenario 2 : Where Not facing any Voice Breaking issue while not using the Ringing Application.

– Executing [789789@trunkinbound:1] Goto(“SIP/MY-sip-trunk-00000475”, “trunkinbound,789787,1”) in new stack
– Goto (trunkinbound,789787,1)
– Executing [789787@trunkinbound:1] Playback(“SIP/MY-sip-trunk-00000475”, “/home/local/CORPORATE/vijo/clubwav”) in new stack
> 0x7f05d0000910 – Probation passed - setting RTP source address to
– <SIP/MY-sip-trunk-00000475> Playing ‘/home/local/CORPORATE/vijo/clubwav.slin’ (language ‘en’)
== Manager ‘sendcron’ logged on from
== Manager ‘sendcron’ logged off from
== Manager ‘sendcron’ logged on from
== Manager ‘sendcron’ logged off from
== Manager ‘sendcron’ logged on from
== Manager ‘sendcron’ logged off from
== Spawn extension (trunkinbound, 789787, 1) exited non-zero on ‘SIP/MY-sip-trunk-00000475’
– Executing [h@trunkinbound:1] AGI(“SIP/MY-sip-trunk-00000475”, “agi://–HVcauses–PRI-----NODEBUG-----0---------------”) in new stack
– <SIP/MY-sip-trunk-00000475>AGI Script agi://–HVcauses–PRI-----NODEBUG-----0--------------- completed, returning

Handling your .pcapng file is too much work for me, especially as I don’t have wireshark on the machine I’m using at the moment.

U need the PCAP trace ?

As i have checked i have not found any issue in the trace as well .

Is there any issue with Ringing application ?

did you try to answer channel before playback?


I have tried that in that case am not facing the voice issue.

I have answered the call and enabled the ringing …Am facing the issue only while iam not answering the channel and using the ringing application

Playback answers the channel, itself, unless you tell it not to.

Thinking about it, calling Ringing, then Playback, without a delay, between them, makes no sense, as the 180 Ringing will, immediately, be followed by the 200 OK generated by the Answer in Playback. The net effect should be the same as if you didn’t call Ringing at all.

try with background app.

Maybe it is about ringing need some stuff like below

exten => s,n,Ringing

exten => s,n,Wait(2)

I have tried with below configuration

exten => s,1,Ringing
exten => s,n,Wait(2)
exten => s,n,Playback(myfile)
exten => s,n,Hangup()

With above configuration also i facing the issue.

only when i remove the Ringing from the dial plan its working fine otherwise i have to answer the channel before using the ringing application.

I would say this was a problem with the phone, but we need the SIP INVITE dialogue trace in a form that is easy to digest, to be sure.

exten => s,1,Progress()
;exten => s,n,Ringing()
exten => s,n,Wait(2)
exten => s,n,Playback(myfile,noanswer)
exten => s,n,Hangup()

Could u try this?
Progress is need for early media that means without answer channel, can play a mediafile

It shouldn’t make a difference, as Playback answers. However, it might just make Asterisk send the ringback tone as early media, although I don’t think that is a requirement of SIP (I believe you cannot revert from progress to alerting in ISDN, but can in SIP).

given that you will start billing on the Playback, there is not much penalty for Answer, Ringing, Wait, Playback.

I have tried with Another SIP provider and Also tried the coming calls from different phones as well but still result was same.

I don’t want to answer the call till the Playback application executed …

because i am also executing the agi like miss call service. hence i can’t answer the call in that case.

Below is one of my sample

exten => s,1,Ringing
exten => s,n,Wait(3)
exten => s,n,AGI(myagi.agi)
exten => s,n,Hangup()

But how to identify why the Ringing causing this issue ?

Or is there any another application which can be use instead of Ringing with same functionality.