[Home]

Summary:ASTERISK-02850: dsp.c hangup detection on x100p
Reporter:Martin Vit (festr)Labels:
Date Opened:2004-11-18 11:34:44.000-0600Date Closed:2011-06-07 14:05:19
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) pokus.wav
Description:i have problem with hangup detection x100p with my telco in czech republic (europe)

(i have also tryed tweaking bussydetection and polarity patches but nothing helped)

When hanging up, only message which i can see is this:
channel.c: ast_log(LOG_DEBUG, "Dropping duplicate answer!\n");


This message appear, when in 1.0 stable: dsp.c:1180
...
 } else if (dsp->tstate == TONE_STATE_TALKING) {
      res = AST_CONTROL_ANSWER;
...

i can do hangups, when i change AST_CONTROL_ANSWER to AST_CONTROL_HANGUP and add one on line 1589.

But i dont know what this AST_CONTROL_ANSWER is when (dsp->tstate == TONE_STATE_TALKING) and i donw know if i brake something. But for me, hangup detection works.

pls help to solve this

****** ADDITIONAL INFORMATION ******

here is the patch

Index: dsp.c
===================================================================
RCS file: /usr/cvsroot/asterisk/dsp.c,v
retrieving revision 1.29.2.1
diff -u -r1.29.2.1 dsp.c
--- dsp.c       12 Nov 2004 13:48:42 -0000      1.29.2.1
+++ dsp.c       18 Nov 2004 17:33:52 -0000
@@ -1178,7 +1178,8 @@
                                               res = AST_CONTROL_BUSY;
                                               dsp->features &= ~DSP_FEATURE_CALL_PROGRESS;
                                       } else if (dsp->tstate == TONE_STATE_TALKING) {
-                                               res = AST_CONTROL_ANSWER;
+                                               //res = AST_CONTROL_ANSWER;
+                                               res = AST_CONTROL_HANGUP;
                                               dsp->features &= ~DSP_FEATURE_CALL_PROGRESS;
                                       } else if (dsp->tstate == TONE_STATE_RINGING)
                                               res = AST_CONTROL_RINGING;
@@ -1584,6 +1585,7 @@
                       case AST_CONTROL_BUSY:
                       case AST_CONTROL_RINGING:
                       case AST_CONTROL_CONGESTION:
+                       case AST_CONTROL_HANGUP:
                               dsp->f.subclass = res;
                               if (chan)
                                       ast_queue_frame(chan, &dsp->f);
Comments:By: Clod Patry (junky) 2004-11-18 12:22:42.000-0600

next time, try to attach the patch.
and you're talking about CVS too, when you choose CVS, try to specify which one too (version).
if you could past a full output of ur CLI, that would be useful too.

edited on: 11-18-04 12:24

By: Mark Spencer (markster) 2004-11-18 12:55:49.000-0600

Obviously this would break answer detection, and I can't understand how this would possibly help you with hangup detection. In fact, I bet if you yelled loud enough this would cause your line to detect a hangup.

By: Mark Spencer (markster) 2004-11-20 11:31:17.000-0600

Maybe you can attach a recording of the hangup sound.

By: Martin Vit (festr) 2004-11-20 14:31:42.000-0600

yes you are right, this is completly nonsense solution, i'm getting random hangups.

When the line hangups, i'm hearing busy tone (discontinuous tones)

CVS-stable

my zapata.conf:

[channels]
language=cz
context=interni
callreturn=yes
echocancel=yes
echocancelwhenbridged=yes
echotraining=yes
callerid=asreceived
adsi=yes

preflash=50
flash=80
rxflash=150

;x100p
faxdetect=incoming
context=telekom
signalling=fxs_ks
echocancel=yes
echocancelwhenbridged=yes
relaxdtmf=yes
rxgain=1.5
txgain=1.5
immediate=no
busydetect=yes
busycount=8
callprogress=yes
musiconhold=default
usecallerid=yes
polarityonanswerdelay=1
hanguponpolarityswitch=yes

channel=>1


i have tryed busycount=4 5 6 7 8, no one helped

here is the wav and CLI output with debug

   -- Executing Record("Zap/1-1", "pokus:wav|20|30") in new stack
Nov 20 21:21:58 DEBUG[10684]: channel.c:1128 ast_settimeout: Scheduling timer at 160 sample intervals
   -- Playing 'beep' (language 'cz')
ast*CLI>
ast*CLI>
Nov 20 21:21:59 DEBUG[10684]: channel.c:1128 ast_settimeout: Scheduling timer at 133 sample intervals
Nov 20 21:21:59 DEBUG[10684]: channel.c:1128 ast_settimeout: Scheduling timer at 0 sample intervals
Nov 20 21:21:59 DEBUG[10684]: channel.c:1128 ast_settimeout: Scheduling timer at 0 sample intervals
ast*CLI>
ast*CLI>
ast*CLI>
ast*CLI>
ast*CLI>
Nov 20 21:22:04 DEBUG[10684]: channel.c:1363 ast_read: Dropping duplicate answer!
ast*CLI>

----cut-------

no hangup detects

once it detects hangup (with busycount=8) :

Nov 20 21:07:00 DEBUG[2863]: Dropping duplicate answer!
Nov 20 21:07:02 DEBUG[2863]: Requesting Hangup because the busy tone was detected on channel Zap/1-1

but after the next few attempts, busy tone is not detected, only this debug:
Nov 20 21:07:00 DEBUG[2863]: Dropping duplicate answer!

By: srathje (srathje) 2004-11-21 16:35:16.000-0600

It seems like CZ are using three different busy tone definitions. The recording  is of "BUSY TONE II".

CZECH Rep. (ITU-T E.180.Supplement 2.doc)
DIAL TONE I              425  CONTINUOUS
DIAL TONE II             425  0.33 - 0.33 - 0.66 - 0.66
DIAL TONE III            425  0.165 - 0.165 - 0.660 - 0.660
RINGING TONE             425  1.0 - 4.0
BUSY TONE I              425  0.333 - 0.333
BUSY TONE II             425  0.167 - 0.167
BUSY TONE III            425  0.165 - 0.165 - 0.165 - 0.330
SPECIAL INFORMATION TONE 950/1400/1800  (3×0.33 - 2×0.03) - 1.0
WAITING TONE             425  0.33 - 5.0
CONNECTION TONE          425  0.05 - 0.05
OFFERING TONE (TRUNK)    425  0.33 - 0.33 - 0.33 - 1.5

By: Martin Vit (festr) 2004-11-21 18:06:35.000-0600

ok, so what can i do for recognising them? And what busy tone is detected by asterisk? And is it configurable? (*.h) Or can asterisk detect only one kind of busy tone?

By: srathje (srathje) 2004-11-22 01:59:29.000-0600

I don't have access to a "live" linux  right now so I appologise for not attaching diff's, it's kinda difficult to do that with a windoze client.

/etc/asterisk/indications.conf

Add this..

>>> start >>>

[general]
country=cz

...
...

[cz]
description = CZECH Rep.
ringcadance = 1000,4000
;
dial = 425
;
; change "dial" according to dial1, dial2, dial3 to match local signalling.
dial1 = 425
dial2 = 425/330,0/330,425/660,0/660
dial3 = 425/165,0/165,425/660,0/660
;
busy = 425/330,0/330
;
; change "busy" according to busy1, busy2, busy3 to match local signalling.
busy1 = 425/330,0/330
busy2 = 425/167,0/167
busy3 = 425/165,0/165,425/165,0/330
;
ring = 425/1000,0/4000
;
; Not 100% sure about the rest...
congestion = 425/250,0/250,425/750,0/250
callwaiting = 425/330,0/5000
dialrecall = 350+440
record = 425/250,0/250
info = 950/330,1400/330,1800/330
stutter = 350+440

<<< end <<<

/usr/src/zaptel/zonedata.c

Current CVS next free is 21, adjust accordingly...

>>> start >>>

       { 21, "cz", "CZECH Rep.", { 1000, 4000 },
       {
               { ZT_TONE_DIALTONE, "425" },

       /* 3 choices.. change accordingly
       DIAL TONE I 425 CONTINUOUS
               { ZT_TONE_DIALTONE, "425" },
       DIAL TONE II 425 0.33 - 0.33 - 0.66 - 0.66
               { ZT_TONE_DIALTONE, "425/330,0/330,425/660,0/660" },
       DIAL TONE III 425 0.165 - 0.165 - 0.660 - 0.660
               { ZT_TONE_DIALTONE, "425/165,0/165,425/660,0/660" }, */

               { ZT_TONE_BUSY, "425/167,0/167" },

       /* 3 choices.. change accordingly
       BUSY TONE I 425 0.333 - 0.333
               { ZT_TONE_BUSY, "425/330,0/330" },
       BUSY TONE II 425 0.167 - 0.167
               { ZT_TONE_BUSY, "425/167,0/167" },
       BUSY TONE III 425 0.165 - 0.165 - 0.165 - 0.330
               { ZT_TONE_BUSY, "425/165,0/165,425/165,0/330" }, */

               { ZT_TONE_RINGTONE, "425/1000,0/4000" },
               { ZT_TONE_CONGESTION, "425/250,0/250,425/750,0/250" },
               { ZT_TONE_CALLWAIT, "425/330,0/5000" },
               { ZT_TONE_DIALRECALL, "350+440" },
               { ZT_TONE_RECORDTONE, "425/250,0/250" },
               { ZT_TONE_INFO, "950/330,1400/330,1800/330" },
               { ZT_TONE_STUTTER, "350+440" } },
       },

<<< end <<<

"make install" both zaptel and asterisk.

----

In /etc/zapata.conf use:

defaultzone=cz

----

In /etc/asterisk/zaptel.conf

busydetect=no

----

By: Mark Spencer (markster) 2004-11-22 09:35:31.000-0600

We could try to create a new set of tone detection for "cz".  Currently we only have "us" and "cr"

By: Martin Vit (festr) 2004-11-22 11:34:14.000-0600

I have followed all your instructions and now it works well. But only with busydetct=yes, busycount=4 (8 or 6 doesnt work). full config:

;x100p
faxdetect=incoming
context=telecom
signalling=fxs_ks
echocancel=yes
echocancelwhenbridged=yes
relaxdtmf=yes
rxgain=-10
;txgain=1.5
immediate=no
busydetect=yes
busycount=4
callprogress=yes
musiconhold=default
usecallerid=yes
;polarityonanswerdelay=1
;hanguponpolarityswitch=yes

channel=>1

---------------
zonedata.c

{ 21, "cz", "CZECH Rep.", { 1000, 4000 },
       {
               { ZT_TONE_DIALTONE, "425" },
               { ZT_TONE_BUSY, "425/167,0/167" },            
               { ZT_TONE_RINGTONE, "425/1000,0/4000" },
               { ZT_TONE_CONGESTION, "425/250,0/250,425/750,0/250" },
               { ZT_TONE_CALLWAIT, "425/330,0/5000" },
               { ZT_TONE_DIALRECALL, "350+440" },
               { ZT_TONE_RECORDTONE, "425/250,0/250" },
               { ZT_TONE_INFO, "950/330,1400/330,1800/330" },
               { ZT_TONE_STUTTER, "350+440" } },
       },
       { -1 }


But ZT_TONE_BUSY is configurable only in this file?. so when i want to detect all 3 BUSY I II III ?

By: Mark Spencer (markster) 2004-11-29 14:46:36.000-0600

busydetect looks like the way to go since it is a regular busy cadence.  Let us know if you need anything else.