[Asterisk-Dev] TMD400 FXO <-> Nokia 32 GSM (Hangup Problems)

Leandro Morgado leandro.morgado at bragaredes.homelinux.com
Mon Nov 15 09:17:41 MST 2004


Hi,

I have a TDM400 FXO module connected to a Nokia 32 GSM Terminal (
http://www.nokia.com/nokia/0,,56025,00.html ).

Outgoing calls from asterisk to the Nokia work flawlessly. Incoming 
calls from the Nokia are working fine when asterisk hangs up the call. 

However, when the far-end hangs up (i.e., the Nokia GSM hangs up the
call), asterisk detects the hangup but fails to put the line back onhook
and the GSM terminal stays with the line busy until I reload the
zaptel/wcfxs modules. I think this is due to some kind of electrical
problem and did some voltage measurements by using the debug mode in the
wcfxs module. 

As I understand it, the voltage should be around 48V when the line is
onhook. When a call comes in it starts to drop until it reaches 7V,
meaning the call is connected. During the call is stays at this value
and when the Nokia hangs up it drops the battery for 500ms (this process
is called Disconnect Supervision). Asterisk detects this correctly as
the Hangup signal and should "open the circuit" so that voltage goes
back to 48V indicating the line is onhook and ready for another call.
The problem is that the voltage only goes to ~37V instead of 48V and the
Nokia terminal still thinks Asterisk has the line offhook. 

I have included some of these logs. Any help/hints on what causes this
problem will be greatly appreciated. I've also looked at the source code
of wcfxs.c and despite having a broad idea of how it works, I'm not at
all comfortable with messing around with it's low level internals. Hints
on any "hacks" to the code that could solve this would be great.

Oh, and can anyone tell me what "Debounce" is/does ?

Thanks,

Leandro


---------- /var/log/messages ------------

-->NOTE: 48V meaning line is onhook and ready for a call

Nov 13 19:27:21 raider kernel: Module 2: Installed -- AUTO FXO (FRANCE
mode)
Nov 13 19:27:21 raider kernel: ProSLIC on module 3, product 0, version 0
Nov 13 19:27:21 raider kernel: Module 3: Not installed
Nov 13 19:27:21 raider kernel: Found a Wildcard TDM: Wildcard TDM400P
REV H (4 modules)
Nov 13 19:27:21 raider kernel: Card 3: Voltage: 48  Debounce 0
Nov 13 19:27:21 raider kernel: 7278595 Polarity reversed (0 -> 1)
Nov 13 19:27:22 raider kernel: Card 3: Voltage: 49  Debounce 63
Nov 13 19:27:24 raider last message repeated 6 times
Nov 13 19:27:24 raider kernel: Card 3: Voltage: 48  Debounce 63
Nov 13 19:27:25 raider kernel: Card 3: Voltage: 49  Debounce 63
Nov 13 19:27:25 raider kernel: Setting FXS hook state to 0 (00)
Nov 13 19:27:25 raider kernel: Setting FXS hook state to 0 (00)
Nov 13 19:27:25 raider kernel: Registered tone zone 2 (France)
Nov 13 19:27:25 raider kernel: Card 3: Voltage: 49  Debounce 63
Nov 13 19:27:27 raider last message repeated 5 times
Nov 13 19:27:28 raider kernel: Card 3: Voltage: 48  Debounce 63
Nov 13 19:27:28 raider kernel: Card 3: Voltage: 48  Debounce 63
...
Nov 13 19:42:32 raider last message repeated 47 times
Nov 13 19:42:33 raider kernel: Card 3: Voltage: 47  Debounce 63
Nov 13 19:42:33 raider kernel: Card 3: Voltage: 48  Debounce 63
Nov 13 19:42:36 raider last message repeated 6 times

-->NOTE: This is when the Nokia rings Asterisk

Nov 13 19:42:36 raider kernel: Card 3: Voltage: 38  Debounce 63
Nov 13 19:42:36 raider kernel: RING on 2/3!
Nov 13 19:42:36 raider kernel: Card 3: Voltage: 38  Debounce 63
Nov 13 19:42:37 raider kernel: Card 3: Voltage: 38  Debounce 63
Nov 13 19:42:37 raider kernel: Card 3: Voltage: 45  Debounce 63
Nov 13 19:42:37 raider kernel: NO RING on 2/3!
Nov 13 19:42:38 raider kernel: Card 3: Voltage: 38  Debounce 63
Nov 13 19:42:38 raider kernel: Card 3: Voltage: 38  Debounce 63
Nov 13 19:42:38 raider kernel: Card 3: Voltage: 37  Debounce 63
Nov 13 19:42:39 raider kernel: Card 3: Voltage: 28  Debounce 63

-->NOTE: 7V indicates the call is connected 

Nov 13 19:42:39 raider kernel: Card 3: Voltage: 7  Debounce 63
Nov 13 19:42:40 raider kernel: Card 3: Voltage: 7  Debounce 63
Nov 13 19:42:40 raider kernel: Card 3: Voltage: 6  Debounce 63
Nov 13 19:42:40 raider kernel: Card 3: Voltage: 9  Debounce 63
Nov 13 19:42:41 raider kernel: Card 3: Voltage: 7  Debounce 63
Nov 13 19:42:42 raider last message repeated 3 times
Nov 13 19:42:42 raider kernel: Card 3: Voltage: 9  Debounce 63
Nov 13 19:42:43 raider kernel: Card 3: Voltage: 7  Debounce 63
Nov 13 19:42:43 raider kernel: Card 3: Voltage: 6  Debounce 63
Nov 13 19:42:44 raider kernel: Card 3: Voltage: 9  Debounce 63
Nov 13 19:42:44 raider kernel: Card 3: Voltage: 7  Debounce 63
Nov 13 19:42:44 raider kernel: Card 3: Voltage: 7  Debounce 63
Nov 13 19:42:45 raider kernel: Card 3: Voltage: 9  Debounce 63

-->NOTE: At this point Nokia hangs up and drops the battery

Nov 13 19:42:45 raider kernel: Battery loss: 2 (63 debounce)
Nov 13 19:42:45 raider kernel: Battery loss: 2 (62 debounce)
Nov 13 19:42:45 raider kernel: Battery loss: 1 (61 debounce)
Nov 13 19:42:45 raider kernel: Battery loss: 1 (60 debounce)
Nov 13 19:42:45 raider kernel: Battery loss: 1 (59 debounce)
...
Nov 13 19:42:45 raider kernel: Battery loss: 1 (10 debounce)
Nov 13 19:42:45 raider kernel: Battery loss: 1 (9 debounce)
Nov 13 19:42:45 raider kernel: Battery loss: 0 (8 debounce)
Nov 13 19:42:45 raider kernel: Battery loss: 0 (7 debounce)
Nov 13 19:42:45 raider kernel: Battery loss: 1 (6 debounce)
Nov 13 19:42:45 raider kernel: Battery loss: 1 (5 debounce)
Nov 13 19:42:45 raider kernel: Battery loss: 1 (4 debounce)
Nov 13 19:42:45 raider kernel: Battery loss: 0 (3 debounce)
Nov 13 19:42:45 raider kernel: Battery loss: 0 (2 debounce)
Nov 13 19:42:45 raider kernel: Battery loss: 1 (1 debounce)
Nov 13 19:42:45 raider kernel: Battery loss: 1 (0 debounce)
Nov 13 19:42:45 raider kernel: NO BATTERY on 2/3!
Nov 13 19:42:45 raider kernel: Card 3: Voltage: 1  Debounce 63
Nov 13 19:42:46 raider kernel: Card 3: Voltage: 1  Debounce 63

-->NOTE: After asterisk detects hangup voltage should go to 48V
         but incorrectly stays at ~38V

Nov 13 19:42:46 raider kernel: Card 3: Voltage: 38  Debounce 24
Nov 13 19:42:46 raider kernel: BATTERY on 2/3 (+)!
Nov 13 19:42:46 raider kernel: Card 3: Voltage: 37  Debounce 63
Nov 13 19:42:47 raider kernel: Card 3: Voltage: 38  Debounce 63
Nov 13 19:42:47 raider kernel: Card 3: Voltage: 39  Debounce 63
Nov 13 19:42:48 raider kernel: Card 3: Voltage: 38  Debounce 63
Nov 13 19:42:48 raider kernel: Card 3: Voltage: 37  Debounce 63
Nov 13 19:42:48 raider kernel: Card 3: Voltage: 38  Debounce 63
Nov 13 19:42:51 raider last message repeated 6 times
Nov 13 19:42:51 raider kernel: Card 3: Voltage: 37  Debounce 63
Nov 13 19:42:52 raider kernel: Card 3: Voltage: 38  Debounce 63
Nov 13 19:42:52 raider kernel: Card 3: Voltage: 37  Debounce 63


The dialplan is a simple:

[incoming-from-tdm]
exten => s,1,Noop(${CALLERID})
exten => s,2,Answer
exten => s,3,Playback(tt-monkeys)
exten => s,4,Playback(beep)
exten => s,5,Hangup


zaptel.conf:
------------
loadzone=fr
defaultzone=fr
#Use Kewlstart FXS signalling for the Wildcard X100P
fxsks=1
#TDM400P
fxoks=2-3
fxsks=4


zapata.conf:
-----------
[channels]
echocancel=yes
hidecallerid=no
usecallerid=yes
echocancel=yes
echocancelwhenbridged=yes
rxgain=0.0
txgain=0.0
group=1
busydetect=yes
busycount=7

;X100P
signalling=fxs_ks
context=incoming-from-x100p
channel=>1

;TDM400P with 2 FXS
signalling=fxo_ks
context=incoming-from-tdm400
channel => 2-3

;TDM400P with 1 FXO
signalling=fxs_ks
context=incoming-from-x100p
channel=>4
-- 
Bragaredes - I.R.I. Telecomunicações, Lda.
Rua Padre Freitas, Nº 106 Fracção A, 
4700 - 283 Braga, PORTUGAL
Cell:  +351 962415514
Phone: +351 253 625 399  
Fax:   +351 253 331 349



More information about the asterisk-dev mailing list