Hangup detection with an SPA3102
So. Polarity detection is a great way of signaling that a line has been hanged up. Unless your telco doesn’t use it… Which might probably be the case if you live in a country outside the United States like me.
Enter the Disconnect Tone detection in the SPA3102. It allows the SPA to listen to the line waiting for the busy tone that the telco sends you after the other party hanged up the phone.
How could you know if you’re having disconnection problems on Asterisk? Just make a call to your server through the line connected to the SPA (with you cellphone for example), answer it somehow (on another phone, an IVR, a queue…) and then hangup the initial call (hangup on the cellphone). Now start counting how many seconds asterisk keeps the channel active… If it’s more than 10 you probably have a problem…
Now, there are many ways of obtaining the parameters of your disconnect tone, for example:
- Asking your telco. Results may vary depending on the telco…
- Using an oscilloscope or some kind of signal processing hardware. Maybe a little expensive…
- Searching for your tone in this tone database (you might have to register but it’s free). This could really help you understand all the parameters that you have to configure in the SPA (as you can format the tone as “Sipura/linksys”) You might either find the tone you’re looking for or at least you can look for one that is alike. This is not the most accurate way of doing it but you might get lucky…
- Measuring the tone’s parameters manually. Check out this link. I think this is the most reliable way of doing it, specially if you use sigview (which is free for a limited time) as it will give you a very accurate cadence and frequence values.
There’s a very extensive guide on the link I provided and here are some screenshots of how sigview works, courtesy of my friend Luis:
With this method we went from hanging up after more than 20 seconds to less than 5… Before the changes, in some cases, the channels remained active for hours and hours and Asterisk kept recording those calls so we found recordings that were bigger than 400MB and our client’s hard drive was becoming full daily…
So, the links in this post might help you with an SPA3102 but the sigview measurements will help you with any kind of PSTN gateway like an AudioCodes… But configuring those is a far different beast.
Until next time.




