Koozali.org: home of the SME Server

Analogue phone dial after 1st digit

Offline compsos

  • *
  • 472
  • +0/-0
Analogue phone dial after 1st digit
« on: February 12, 2014, 10:43:52 PM »
Firstly this has been solved. the post is to understand the logic.
On a system with a pair of wctdm24xxx cards (39 fxs ports) we had the situation of 0 would get the operator but any other digit 1st failed. In the cli we saw the extension immediately dialled.

The error was tracked down to this in the extensions.conf file under internal
Code: [Select]
_[*#0-9]!,1,agi(sarkhpe,OutCos,\${EXTEN},,)\n"
The ! mark means do not wait but process now. If we edited the extensions.conf file the adjustment was lost as soon as the configuration was reloaded.

We eventually found it came from the generator/extensions.php

Code: [Select]
//  Class Of Service and Tenants if they are enabled
//
        if ($global['COSSTART'] == "ON") {
/*
                $OUT .= "\texten => _X.,1,agi(sarkhpe,OutCos,\${EXTEN},,)\n";   
                $OUT .= "\texten => _[+*]X.,1,agi(sarkhpe,OutCos,\${EXTEN},,)\n";
                $OUT .= "\texten => _**X.,1,agi(sarkhpe,OutCos,\${EXTEN},,)\n";
                $OUT .= "\texten => _***X.,1,agi(sarkhpe,OutCos,\${EXTEN},,)\n";
*/
                $OUT .= "\texten => _[*#0-9]!,1,agi(sarkhpe,OutCos,\${EXTEN},,)\n";
        }
        elseif ($global['CLUSTER'] == "ON") {
/*
                $OUT .= "\texten => _X.,1,agi(sarkhpe,OutCluster,\${EXTEN},,)\n";
                $OUT .= "\texten => _[+*]X.,1,agi(sarkhpe,OutCluster,\${EXTEN},,)\n";
                $OUT .= "\texten => _**X.,1,agi(sarkhpe,OutCluster,\${EXTEN},,)\n";
                $OUT .= "\texten => _***X.,1,agi(sarkhpe,OutCluster,\${EXTEN},,)\n";
*/
                $OUT .= "\texten => _[*#0-9]!,1,agi(sarkhpe,OutCluster,\${EXTEN},,)\n";
        }
        else {
                $OUT .= "\tinclude => qrxvtmny \n";     
        }
        $OUT .= "\n\texten => " . $global['OPERATOR'] . ",1,Goto(extensions,\${SYSOP},1)\n\n";

So turning on  the COS box in the globals/services box generated to single digit code.

The question is this an error or was the code meant to do something else?
Regards

Gordon............

Offline SARK devs

  • ****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: Analogue phone dial after 1st digit
« Reply #1 on: February 13, 2014, 02:44:47 PM »
HI Gordon

Thanks for this.  The ! is there for overlap dial from downstream legacy equipment running T1/J1/E1 circuits.   However, I'm not entirely sure it needs to be there.

I'll check it and come back.   In the meantime you can simply replace the ! with a . in the generator code if you wish to run COS.

Kind Regards
S

 

Offline compsos

  • *
  • 472
  • +0/-0
Re: Analogue phone dial after 1st digit
« Reply #2 on: February 13, 2014, 10:31:04 PM »
Hi S
We did try a . but the phones indeed allowed us to complete the number but then never activated the system to process the information.
Thanks
Regards

Gordon............

Offline SARK devs

  • ****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: Analogue phone dial after 1st digit
« Reply #3 on: February 14, 2014, 05:10:08 PM »
without a log I can't tell you why that should be.   Truth to tell we do very little work with digium analogue cards because they are a PITA on BT networks.   We use Sangoma Vega gateways for UK analogue lines.

send me a console trace and I'll take a look.

Kind Regards
S


Offline compsos

  • *
  • 472
  • +0/-0
Re: Analogue phone dial after 1st digit
« Reply #4 on: February 14, 2014, 11:15:26 PM »
Thanks S
As I said in the 1st post it is now solved so will not have a trace that I can send you other than the files we sent to Digium. They only show the 1 digit issue due to the !. We did not do a trace on '.' as did not solve the problem.

This was Digium's response to the trace we sent them
Quote
Thank you for the debugging information. After looking at the CLI output, what's happening is
Asterisk is immediately taking the first digit and then attempting to dial it -- effectively cutting
off the user before they can finish dialing the number. This is solely the behavior of Asterisk, and
has nothing to do with the card or equipment. The reason why Asterisk is doing this is because of the dialplan
in the /etc/asterisk/extensions.conf file. The context for those analog users
(as defined in /etc/asterisk/dahdi-channels.conf) is "from-internal".
If you check the extensions.conf file, you'll see the following:

[from-internal]   ; FPBX Compatibility
include => internal [internal]
 include => parkedcalls
        exten => _[*#0-9]!,1,agi(sarkhpe,OutCos,${EXTEN},,)
        exten => 0,1,Goto(extensions,${SYSOP},1)

Those are the only possible pattern matches for outgoing calls placed from those analog channels/users.
The problem is that the '!' character is being used in the first pattern: _[*#0-9]!

The '!' character is a wildcard that will cause Asterisk to immediately accept whatever has been entered
without waiting for the dialing to be completed. So the users only ever get to enter that first digit before
 Asterisk cuts off their dialing and attempts to route the call.

What I would recommend using is the '.' wildcard character instead, as this matches one or more characters
and will allow the users time to finish dialing the desired number.
So for example, please try changing the pattern match to resemble the following:
      exten => _[*#0-9].,1,agi(sarkhpe,OutCos,${EXTEN},,)
If you could try this and let me know how it goes, that would be really helpful.
I hope this helps. Please let me know if you have any questions. Thanks.

They also said this about sip verses analogue dialling

Quote
As for the problem with dialing from analog extensions, and why this was not a problem with SIP users, on SIP calls Asterisk usually receives the dialed number as a complete string in the INVITE message. It will then check the dialplan for patterns that match that string. For analog calls, however, the digits are received as DTMF one at a time. So if Asterisk is listening and it hears what it considers to be a match, it will try to route that call immediately. Some pattern matching characters (such as the '.' character) will allow for a window of time in which more digits can be dialed. The '!' character does not do this though, but rather it immediately proceeds as soon as it receives enough characters -- in this case, a single digit.
So I suspect in our case the '.' for the analogue became an unusually long period of time. It all works without the 'COS' dialplan.
Regards

Gordon............