* You are viewing Posts Tagged ‘DIALSTATUS’

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();