* You are viewing Posts Tagged ‘DIALSTATUS’

AMD With Analog Lines – DIALSTATUS Empty

Hello,

I would like to use AMD on outgoing calls using analog line. I tested with SPA3102 and cisco2811 as gw and asterisk 1.8.26.1 as well as 11.8.1
Other end is analog number behind another cisco/asterisk, also tested calling a mobile number with the same result.

What I did: dial is done like exten => s,n,Dial(SIP//,,M(myMacro)), which tell Asterisk to execute myMacro when the call is answered by calling party.

[myMacro]

exten => s,1,NoOP(Executed when call is answered)
same => n,AMD()
same => n,NoOp(Dial status=${DIALSTATUS})
same => n,NoOp(AMD status=${AMDSTATUS} cause=${AMDCAUSE})
same => n,MacroExit()

Problem is that [myMacro] is executed as soon as the call is going out from the gw (cisco or linksys) and before called party answered. DIALSTATUS is empty (should be ANSWER), AMDSTATUS=NOTSURE and AMDCAUSE=TOOLONG-5000 which seems OK as DIALSTATUS isn’t reliable.

The same dialplan using a SIP trunk is working as expected.

So question is, why, when using analog line, I dont get the right behavior.

Thanks for any hint

extending fallback numbers

Hi

A couple of weeks ago I asekd how to setup a fallback numer and one of
the reply I received was to se GotoIF and ${DIALSTATUS}.
I succeeded in making it work for a single fallback number (i.e. the
operator), but I want to extend it in the following manner:

2000-2099 -> fallback to 2000
2100-2199 -> fallback to 2100
2200-2299 -> fallback to 2200
2300-2399 -> fallback to 2300

and so on…

How do I implement such a configuration in a dialplan?

TIA
Paolo

Asterisk Dialstatus

The DIALSTATUS channel variable is created when you attempt to connect to another device or endpoint and bridge the call with the Dial Application. It contains the status of the call reflected in one of the following values:

  • CHANUNAVAIL
  • CONGESTION
  • NOANSWER
  • BUSY
  • ANSWER
  • CANCEL
  • DONTCALL – For the Privacy and Screening Modes. Will be set if the called party chooses to send the calling party to the ‘Go Away’ script.
  • TORTURE – For the Privacy and Screening Modes. Will be set if the called party chooses to send the calling party to the ‘torture’ script.
  • INVALIDARGS

 

Asterisk Dialstatus

Hello,

I’m using AGI scripting with asterisk and need to execute certain commands just after Dial(). But once dial command is executed, further commands/instructions are ignored.

$agi->exec("Dial","SIP/100");
$dialstatus = $agi -> get_variable("DIALSTATUS");

if($dialstatus[data]=="ANSWER")

{
    do something…….
}

thanks,
Kamlesh

Why **CONGESTION** not *****NOANSWER****** ?

Hi List,

I have a DID number which is routed to my production server. Problem is
that when I dial that DID number from my production number then it’s gives
DIALSTATUS to CONGESTION if I don’t pick the calls. As per the asterisk it
should reply NO ANSWER.

*extensions.conf *:-

exten => 08723310476,1,Dial(SIP/2218)
same => n,NoOp(**${DIALSTATUS}**)
same => n,ExecIf($['${DIALSTATUS}'='CHANUNAVAIL']?NoOp(Channel
unavailable. On SIP, peer may not be registered.))
same => n,ExecIf($['${DIALSTATUS}'='BUSY']?noop(Busy signal. The
dial command reached its number but the number is busy.))
same => n,ExecIf($['${DIALSTATUS}'='ANSWER']?noop(Call is answered.
A successful dial. The caller reached the callee.))
same => n,ExecIf($['${DIALSTATUS}'='NOANSWER']?noop(No answer. The
dial command reached its number, the number rang for too long, then the
dial timed out.))
same => n,ExecIf($['${DIALSTATUS}'='CANCEL']?noop(Call is
cancelled. The dial command reached its number but the caller hung up
before the callee picked up.))
same => n,ExecIf($['${DIALSTATUS}'='CONGESTION']?noop(Congestion.
This status is usually a sign that the dialled number is not recognised.))
same => n,ExecIf($['${DIALSTATUS}'='DONTCALL']?noop(Privacy mode,
callee rejected the call))
same => n,ExecIf($['${DIALSTATUS}'='TORTURE']?noop(Privacy mode,
callee chose to send caller to torture menu))
same => n,ExecIf($['${DIALSTATUS}'='INVALIDARGS']?noop(Error
parsing Dial command arguments))
same => n,wait(9)

exten => 1212,1,Answer()
same => n,Dial(SIP/08723310476@voipon)
same => n,NoOp(**${DIALSTATUS}**)
same => n,ExecIf($['${DIALSTATUS}'='CHANUNAVAIL']?NoOp(Channel
unavailable. On SIP, peer may not be registered.))
same => n,ExecIf($['${DIALSTATUS}'='BUSY']?noop(Busy signal. The
dial command reached its number but the number is busy.))
same => n,ExecIf($['${DIALSTATUS}'='ANSWER']?noop(Call is answered.
A successful dial. The caller reached the callee.))
same => n,ExecIf($['${DIALSTATUS}'='NOANSWER']?noop(No answer. The
dial command reached its number, the number rang for too long, then the
dial timed out.))
same => n,ExecIf($['${DIALSTATUS}'='CANCEL']?noop(Call is
cancelled. The dial command reached its number but the caller hung up
before the callee picked up.))
same => n,ExecIf($['${DIALSTATUS}'='CONGESTION']?noop(Congestion.
This status is usually a sign that the dialled number is not recognised.))
same => n,ExecIf($['${DIALSTATUS}'='DONTCALL']?noop(Privacy mode,
callee rejected the call))
same => n,ExecIf($['${DIALSTATUS}'='TORTURE']?noop(Privacy mode,
callee chose to send caller to torture menu))
same => n,ExecIf($['${DIALSTATUS}'='INVALIDARGS']?noop(Error
parsing Dial command arguments))
same => n,Hangup()

exten => h,1,NoOp()
same => n,NoOp(********${HANGUPCAUSE}*********)
same => n,NoOP(bye Virendra)

*asterisk cli:-*

DIALSTATUS Values

Hello,

I tried to search the answer of my problem but unable to get resolution so sending to you guys. I’m using asterisk 1.6.2.7 and writing the AGI scripts using PHP. I’m unable to retrieve the DIALSTATUS value, during execution of AGI script, I get empty value.

Extracts from AGI Script:

#!/usr/bin/php -q
#!/bin/bash
< ?php
include_once (“phpagi-2.14/phpagi.php”);
$agi = new AGI();