Summary:ASTERISK-02094: Dlink doesn't provide tone when handset is picked up
Reporter:lexoid (lexoid)Labels:
Date Opened:2004-07-23 06:23:07Date Closed:2008-01-15 15:03:29.000-0600
Versions:Frequency of
Environment:Attachments:( 0) dlink-mgcp.tar.gz
( 1) mgcp-debug.tar.gz

I'm testing Dlink's MGCP hard phone DPH-100M (latest firmware available from dlink.com) with Asterisk. With stable release of Asterisk everything works fine, but with CVS Head there're several problems.

When I pick-up the handset, I don't hear the dial tone. To be more precise it could be heared sometimes only for about 1/10 of second. This is the 1st problem, beside that dialing behaves strangly. For extension 5556, i should dial only last 556 to ring.

See attached files for more information. They include "ngrep port 2427" and script of "mgcp debug" for stable and HEAD version of Asterisk.

Thanks in advance
Comments:By: lexoid (lexoid) 2004-07-23 06:42:34

Forgot to mention that after starting ngrep and asterisk, Dlink was restarted via web interface.

By: Mark Spencer (markster) 2004-07-24 21:37:02

I've commited two changes which should fix your problem.  

The first problem is that the phone does not handle the sequencing of events properly.  By setting "slowsequence=yes" in your gateway before your line => entries you will turn on that option.  This will get you dialtone.  However, as soon as you get ringback, it will disconnect because the D-Link doesn't know that "rt" is part of the "G" package.  Working around that requires defining DLINK_BUGGY_FIRMWARE in chan_mgcp.c since that is clearly a protocol violation which is very specific to the dlink, and not really general enough to merit a runtime configuration.

Please test and confirm it's fixed at your earliest possible convenience.

By: lexoid (lexoid) 2004-07-26 05:59:33

Ok, I've compiled chan_mgcp with:

#define MAX_EXPIREY     3600
#define CANREINVITE     1

Indeed it provides dial tone now, but there're other issues with dlink.
1st: I cannot dial correct number (should we open another bug or continue this?).
I have these extension defined:
exten => h,1,Playtones(congestion)
exten => h,2,Wait(5)
exten => h,3,Hangup
exten => i,1,Playtones(congestion)
exten => i,2,Wait(5)
exten => i,3,Hangup
exten => h,1,Playtones(congestion)
exten => h,2,Wait(5)
exten => h,3,Hangup
exten => h,1,Playtones(congestion)
exten => h,2,Wait(5)
exten => h,3,Hangup
exten => 5551,1,Macro(stdexten,MGCP/aaln/1@
exten => 5432,1,SetCalledParty("Lexa")
exten => 5432,2,Macro(stdexten,SCCP/Lexa)

After dialing two digits 5 and 4 I'm getting disconnected. If I'd have extension exten => 5555,2,Macro(stdexten,SCCP/Lexa) and dialed 5 and 5, than I'd be connected to extension 5555. there's ngrep and "mgcp debug" in attached file.

And second issue, chan_mgcp dumps core at random states. eg after call disconnect. Most simple I can trigger this by pressing "on hook" many times with small interval. here is "gdb /usr/sbin/asterisk core":
#0  0x404aa003 in handle_response (p=0x80ed6c0, sub=0x0, result=200,
   ident=3202348142, resp=0xbedff244) at chan_mgcp.c:2291
2291                        if (sub->owner) {

Thanks in advance

By: Mark Spencer (markster) 2004-07-26 13:05:56

Turn off RFC2833 DTMF.

By: jayson (jayson) 2004-07-26 14:03:52

FYI, I'm having the same problem (double digits) on a Sayson 480i MGCP phone using Asterisk via chan_mgcp.  I'm currently in contact with Sayson as to the possibility of turning off RFC2833 support.  Is there some way to do this via *?  inbanddtmf or something?

By: Mark Spencer (markster) 2004-07-26 15:47:51

Okay update to latest CVS.  I've turned off RFC2833 in general and make it now where you must explicitly turn it on with dtmfmode=rfc2833.

By: Mark Spencer (markster) 2004-07-26 16:16:42

Also did a patch that should fix your crash.

By: lexoid (lexoid) 2004-07-27 06:49:30

Turning off RFC2833 DTMF solves my problem with dialing.
Is there some delay on anonymous cvs? I don't see any diff from yesterdays update.

By: lexoid (lexoid) 2004-07-28 06:38:20

Compiled new cvs. Seems to work fine. Doesn't crash. BTW: any experience in reporting bugs to Dlink? Do they try to fix them?

By: twisted (twisted) 2004-07-28 09:30:26

D-Link should have a means of contact, yes, check their website.

This bug has been fixed in cvs, by Markster.  Yay! :)

By: Digium Subversion (svnbot) 2008-01-15 15:03:29.000-0600

Repository: asterisk
Revision: 3508

U   trunk/channels/chan_mgcp.c
U   trunk/configs/mgcp.conf.sample

r3508 | markster | 2008-01-15 15:03:28 -0600 (Tue, 15 Jan 2008) | 2 lines

Create one generally useful runtime option and one compile time option to work around bugs in the DPH100M phone (bug ASTERISK-2094)