Asterisk without “Disconnect Supervision”

It is very hard to configure an asterisk system if your telco is not providing  Disconnect supervision on your PSTN/Analog line. Even the developers of digium “Switchvox” could not solve the “great call hangup issue” on their great PBX  till now (12th Sep. 2011), because many telecom providers all over the world do not support  this method of call disconnection.

So what happens if you are using asterisk and do not have disconnect supervision on your analog line. If you have not properly configured asterisk with busydetect=yes/callprogress=yes in dahdi/zapata configuration you  will end up  “always busy analog lines”  and you may have to restart the PBX  to receive a call/make call. As an example , I’m using asterisk and if somebody calling me,the call rings my phone via asterisk and  I’m not at my desk to attend the call, so the callee hangs up his phone. But the asterisk will keep ringing my phone because it will not detect the “call disconnect tone”  which is send by the telco when the callee hangup the call. So that PSTN/Analog line remains busy until you manually pick up  phone and disconnect or restart asterisk. This may happen always when caller/callee fails to hangup the call., ie call hang up from one end will not release the line for another call.

Try the below settings before you start.  Try increasing rxgain if pbx could not detect the busytone successfully.

Add busypattern if required. If your TSP supports polarity reversal(disconnect supervision) hanguponpolarityswitch is the best option.

Edit the file /etc/asterisk/chan_dahdi.conf

rxgain=5.0

busydetect=yes

busycount=3

;busypattern=500,500

;hanguponpolarityswitch=yes

The Solution

    One easy solution is get the appropriate busy tone/disconnect tone settings from your telco(you will never get it 😉 ) or from World PSTN Tone Database. If your telco tones are different than those they have given, then you may have to record the busy/call disconnect tone(Use 3CX Phone, or DAHDIBarge). Then use Audacity/Wavesurfer to find the on/off cadence timing on the recorded call. Find the screenshots.
Audacity

Here the ON timing is around 325 millisecond and the OFF timing is also the same.

So you got the busy tone/disconnect tone pattern  325/325. For some telco there may be multiple on/off settings ,like 325 on 325 off then 400 on and 350 off, then it repeats.ie 325/325/ 400/350.

Wavesurfer

Open the recorded file in Wavesurfer and select choose Configuration as Waveform.

Zoom in the waveform.

Right click in the  Spectrogram Pane to get the Spectrogram Controls.

Put the analysis window length to maximum to get the narrow spectrum line. Mouse over the spectrum line and see the status bar to get the frequency.

Select the wave form from start to end so that you will get the ON timing as a tool tip.

Select the blank area to get the OFF timing.

PIKA – The easy PBX

If you are using pika PBX you can straight away use this settings to configure the PBX. Edit the file /etc/pika/inccpa.cfg. Add new pattern under [callpa_settings]. Create the pattern context with the new tone settings.

If you got the tone on/off pattern as 400 on,350 off, 230 on,530 of as “Call disconnect” Tone. then the configuration will be as follows.

There are more patterns.showed only newly added pattern.

[callpa_settings]
pattern4=cp_huntbusy
[cp_huntbusy]
type=4
tolerance=30
cadences=2
states=4
ignorestates=1
state0=400
state1=350
state2=230
state3=530

DAHDI Configuration for Normal PC/Server based Asterisk installation

The main configuration files are /etc/asterisk/chan_dahdi.conf &  /etc/asterisk/dahdi-channels.conf

.. to be continued..

Worth reading: http://www.fredshack.com/docs/asterisk.html

Advertisements

6 thoughts on “Asterisk – How to detect a busy tone

  1. Great article.I have the same issue.I am using freepbx on top of asterisk and my asterisk box connected with my private pstn through analog fxo card.My system can detect hangup and it keeps busy all my lines.I tried to force hangup dahdi manually from asterisk AGI/AMI but its not working.I think i should try this out.thanks for your article.

  2. Hey! This is my 1st comment here so I just wanted to
    give a quick shout out and say I truly enjoy reading your posts.
    Can you suggest any other blogs/websites/forums that deal with the same subjects?
    Thanks a lot!

  3. My partner and I stumbled over here by a different web page and thought I should check things out.

    I like what I see so now i am following you.
    Look forward to looking over your web page yet again.

  4. Hi Shyju,

    Thanks a lot for the post. In Dubai Etisalat lines, is there any specific setting to get the lines disconnected. we have a test system which has this issue. i tried so many settings as mentioned above but nothing get to work.

    Thanks
    Abdul

  5. Has anyone got this problem resolved with Etisalat (Dubai)? I’m facing same issue with PRI 30 channels terminated into Elastix.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s