• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2437
  • Last Modified:

asterisk pstn disconnect tone ??

Dear all
when make call from my mobile to the land line which connected to my Elastix server through Wildcard TDM400P and i made disconnect  but the extension still ringing for 3 times. here what i did
in /etc/modprobe.conf i added
options wctdm opermode=BAHRAIN

in  /etc/dahdi/system.conf   i made

and the strange thig is the in /var/log/messages
i can see BAHRAIN mode

case when make call come through IVR by these steps i did call disconnect correctly
but if the call direct to extension it take 4 rings to disconnect and i have also big problem echo
which appear when make these steps

All what i want when dial my Elastix server through pstn and the call go to spesific extension and
the caller disconnect the call ,direct also the extension that was ringing stop ringing directly


  • 10
  • 9
  • 3
  • +3
1 Solution
Do you have echocalcel=yes and echocancelwhenbridged=yes devined in your chan_dahdi.conf file?
Does the echo get better after you have been on the call for 20 seconds or so?

Its best to sort out the echo first and then the hangup issues afterwards.
Try changing your signalling on the TDM card in your DAHDI configs.

if it is currently set to kewlstart, change it to loop start and vice versa.
>>Its best to sort out the echo first and then the hangup issues afterwards.

Why? In the case of a PSTN connection, would signaling not be the first place to look? How does echo affect hang up?
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

tahasipAuthor Commented:
Thanks both for your replay
for echocancelwhenbridged=yes  it was no i made it yes then tried the same is happening echo

for the signaling issue
in /etc/asterisk/chan_dahdi.conf
it was
i made it   signalling=fxs_ls
but some thing strang when make asterisk -vrrrrr then reload i can see the follwoing
 -- Reconfigured channel 1, FXS Kewlstart signalling
    -- Reconfigured channel 2, FXS Kewlstart signalling
    -- Reconfigured channel 3, FXS Kewlstart signalling
    -- Reconfigured channel 4, FXS Kewlstart signalling
meaning it didnot changed to loop start and still the echo exist
> Why? In the case of a PSTN connection, would signaling not be the first place to look? How does echo affect hang up?

Often it is related to the detection of the tomes on the line which indicate the other party has hung up. When sorting out echo you often need to adjust the rxgain and txgain on the line and this can often affect the tone detection. So the best way is to sort out the echo cancelation and the line levels and then diagnose the detection of hangup.
However as you say hangup detection can also be caused by the signaling type and in this case there is no harm in trying out the other two possible settings at the same time as testing the echo.
Does the echo get better during the call?
If it does then you could try adding echotraining=yes which will cause it to mute the line briefly and send down an impulse to allow the echo training to train much quicker.

When making these changes some require asterisk to restart and some also require dahdi to be restarted. Just to be on the safe side I would stop asterisk, restart dahdi and then start asterisk (or just reboot the server).
tahasipAuthor Commented:
For the echotraining=yes
it was echotraining=800 i changed it to yes but no change
i attached to you my dahidi confg file also for the rx gain and tx gain the two are 0.0
please see the attached file .
but the echo still exist .

Good to know. I do so little with POTS lines, and when I do I always get the echo can cards because I don't want to deal with / chase echo. I generally use PRI or SIP exclusively.

But that makes perfect sense: the driver doesn't know if the hangup has occurred or not.
tahasipAuthor Commented:
sorry Drdamnit

i didnot get what u want , all what i want when call my elastix server to the land lines which connected to the card then the call go direct to one extension then when the other side hang the call it direct disconnect not take four rings to disconnect that is it
tahasipAuthor Commented:
Dear all
I put another card 24 port one instaed of the old one 4 port
bur i still have this echo problem now i think it is related with asterisk not with dahidi.conf or what is your opinion and how can i overcome this echo problem ??
Where do you have it plugged into the telephone system?

Do you have any other phones on the same line?
Do you have a long extension cable between the master telephone socket and your asterisk box?
tahasipAuthor Commented:
sorry it was mistake from my side no echo with the new card
now let us return to the main problem for the disconnect issue
You have tried the 3 different signaling types already I assume (groundstart, loopstart and kewlstart). If neither of them work then you have to detect the hangup tones.
For this you need to edit indications.conf. You are in Bahrain and I am not sure if the file includes information about the tones in your country. The default file that I have certainly doesn't include them but you may use the same tones as another country which is in the list.
For the disconnection issue:

in chan_dahdi,conf add the following line:


That is not supported in all countries, but many will switch the polarity of the line when hanging up the call as a signal to disconnect.

Back to the echo:

If you have a card without hardware echo cancellation, you MUST enable a software echo canceller if you are using dahdi.  (zaptel had a default echo canceller that was enabled).

so your /etc/dahdi/system.conf file must have a line like this:


mg2 is one of several software options.  

You may have to set your rxgain and txgain to negative numbers.  If the line is too loud it will induce echo on the call.


tahasipAuthor Commented:
ok thanks for all for replaying
let me try all of this and feed you back
When troubleshooting echo and disconnect issues, you may want to first use fxotune.

Then, instead of arbitrarily setting the rxgain and txgain to random values, use dahdi_monitor while you make test calls to a type 102 miliwatt test number.
tahasipAuthor Commented:
Dear grblades:
this is my indication.conf file tell me what to do ?


description = Russian Federation
ringcadence = 1000,4000
dial = 425
busy = 425/350,0/350
ring = 425/800,0/3200
congestion = 425/350,0/350
callwaiting = 425/200,0/5000
dialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440
record = 1400/500,0/15000
info = !950/330,!1400/330,!1800/330,0
Your system appears to be set to recognise the standard dialtone etc... that is used in Russia.
Does your telephone system use the same tones as Russia?

The best thing to do is to find a country which you use the same telephone tones and which is already in indications.conf and configure the country= line in there to use that.
tahasipAuthor Commented:
The best thing to do is to find a country which you use the same telephone tones

how can i know my country tones ?

and where to change the country name ?
plz tell me in details what to do
try to give me examples
What country does your country have a lot of ties with?
Is your telephone company tied to any other in a different country?

You need to find out which of the larger countries your telephone provider has the same sounds as and then configure it to use those.
Have a look in indications.conf and you will see the country codes it supports in the '[ ]'.
tahasipAuthor Commented:

; Do NOT edit this file as it is auto-generated by FreePBX. All modifications to ;
; this file must be done via the web gui.                                        ;

description = United States / North America
ringcadence = 2000,4000
dial = 350+440
busy = 480+620/500,0/500
ring = 440+480/2000,0/4000
congestion = 480+620/250,0/250
callwaiting = 440/300,0/10000
dialrecall = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440
record = 1400/500,0/15000
info = !950/330,!1400/330,!1800/330,0
stutter = !350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440

This is my indication.conf file
It sais you are using freepbx so you will need to set the country there which matches the same tones that are used in your country.

Sorry I cannot tell you what this should be.
tahasipAuthor Commented:
Dear grblades:
In indication.conf
there is nothig named disconnect tone the thing iam looking for
my disconnect tone here in Bahrain is 330+440 and here some other information  
Bahrain (Kingdom of)
Acceptance tone -   425   0.06 on 0.06 off
Busy tone -   425   0.375 on 0.375 off
Congestion tone -   425   0.40 on 0.35 off 0.225 on 0.525 off
Dial tone -   330x440   continuous
Number unobtainable tone -   425   continuous
Pay tone -   816/1209   O.125 on 1.5 off
Ringing tone -   425   0.4 on 0.2 off 0.4 on 2.0 off
Route tone -   425   0.06 on 0.06 off
Call waiting tone -   425   0.2 on 0.6 off 0.2 on 5.0 off

I tried to find which country has the same configuration like mine
but untill now i found nothing
tell me which country i have to chose and how this file solve my problem and it did not contain disconnect tone
Try this for your indications.conf file. I have configured as per the tones in your last post.

Also look in chan_dahdi.conf and see if 'hanguponpolarityswitch=yes' is set. Its not always supported but worth setting.
You could also try setting 'busydetect=yes' in that same file.

If you still have problems talk to your telephone company and ask them whether they support CPC (Calling Party Control). If they do then ask what the interval is set to. It should be at least 500.
This is the preferred method of detecting hangups.

description = Bahrain
ringcadence = 400,200,400,2000
dial = 330*440
busy = 425/375,0/375
congestion = 425/400,0/350,425/225,0/525
unobtainable = 425
ring = 425/400,0/200,425/400,0/2000
callwaiting = 425/200,0/600,425/200,0/5000
acceptance  = 425/60,0/60

Open in new window

You have to record and measure your hangup/disconnect tone, it will be something like 500ms-500ms (first 500ms with sound, next 500ms silent, next 500ms with sound,  next 500ms silent etc.....). Then put it in /etc/asterisk/dahdi.conf the below lines:


This will tell asteirsk to hang up the call if it detect that busy signal (500, 500) twice.

Please note that if you decrease busycount, it may lead to false hangup.

To avoid this, use digital PSTN line (T1/E1)

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 10
  • 9
  • 3
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now