DIALSTATUS on CANCEL

Home » Asterisk Users » DIALSTATUS on CANCEL
Asterisk Users 13 Comments

Hello,

We have a strange situation (asterisk 1.6.2.14), where we get a result for
DIALSTATUS for BUSY and No-ANSWER, but nothing for CANCEL.

This is the (relevant) test dialplan:

13 thoughts on - DIALSTATUS on CANCEL

  • Hi Nikhil,

    Both debug and verbose are set to 20. That’s all I got, but as you can see,
    for the other types of reasons, the DIALSTATUS got a value (and we see the
    events). I’m pretty sure it’s a bug.

    Michael

  • I have make test in AEL.

    context fu {

    _000./userN => {
    Dial(SIP/${EXTEN:3}@Prov);
    Noop(${DIALSTATUS});
    };
    h => {
    Noop(${DIALSTATUS});
    };
    };

    And look CLI

  • Vardan

    I have not use AEL so it is a bit hard to follow with the formatting the
    way it is but it looks like correct.
    Please note the “h” extension only appears to run if a call is connected so
    I do not know when the “CANCEL” would ever be set.
    There may be someone else who can speak to this. It also appears thet
    ${DIALSTATUS} may not be set if the call is not allowed to time out or
    dialed. To me it would make sense to set the inital state of the
    ${DIALSTATUS} to CANCEL and if nothing changes it that would stand, but I
    may be missing the point on this can anyone else speak to it?

    Bryant

  • If on the dial command you add option g, if the call is not answered, it will fall through to the next statement which can be a hangup command and then it will go to the h extension. If that does not then make the statement after the dial command a goto h extension.

  • In AEL macro you must use catch h

    for example

    macro DialToSIPProv (tech,number,prov) {

    Dial(${tech}/${number}@${prov});
    switch(${DIALSTATUS}) {
    case BUSY:
    Noop(BUSY);
    [Do some one]
    break;
    case CHANUNAVAIL:
    Noop(CHANUN);
    [Do some one]
    break;
    case NOANSWER:
    Noop(NOANS);
    [Do some one]
    break;
    case CANCEL:
    Noop(CANCEL);
    [Do some one]
    break;
    case CONGESTION:
    Noop(CONG);
    [Do some one]
    break;
    case ANSWER:
    Noop(ANS);
    [Do some one]
    break;
    default:
    Noop(default);
    [Do some one]
    break;
    };

    catch h {
    Noop(Hangup in macro);
    Noop(${DIALSTATUS});
    Hangup;
    };

    return;
    };

  • I am using the g option and it does not run the next statement or “h” extension if the caller hangs up before an answers or time out event occurs during a dial comand.

    Bryant

    href=”mailto:bryantz@zktech.com”>bryantz@zktech.com wrote:
    href=”mailto:info@eif.am”>info@eif.am
    href=”mailto:asterisk-users@lists.digium.com”>asterisk-users@lists.digium.com
    href=”mailto:info@eif.am”>info@eif.am
    href=”mailto:asterisk-users@lists.digium.com”>asterisk-users@lists.digium.com
    href=”mailto:info@eif.am”>info@eif.am

  • Vandar

    I know understand what you are saying here. Once I turned on CEL I was able
    to see when and where each hangup was firing for each channel and the order
    of operations here. I am now moving very aggressively to get to CEL as I
    now see why CDR’s are so broken. I have my CEL to CDR translator in testing
    and this is looking very promising.

    Thanks for your help.
    Bryant