Hi everyone
I have a problem with my dialplan:
[outbound]
exten => _X.,1,Set(CHANNEL(hangup_handler_push)=outbound-hangup,s,1(args);
same => n,Dial(SIP/halonet/${EXTEN},30)
same => n,Wait(1)
same => n,UserEvent(DialStatus,status: ${DIALSTATUS},serial: ${SERIAL})
same => n,Hangup()
exten => ANSWERED,1,Answer()
same => n,UserEvent(AnswerConfirmation,serial: ${SERIAL})
same => n,Hangup()
[outbound-hangup]
exten => s,1,UserEvent(DialStatus,status: ${DIALSTATUS},serial: ${SERIAL})
same => n,Return()
I use it to talk to my WebService through AMI interface. I originate a call by issue following AMI action:
Action: Originate
Channel: Local/@outbound
Exten: ANSWERED
Context: outbound
Priority: 1
ActionID: 1
Variable: SERIAL=
Asterisk makes a call and pushes my events to my EventListener written in Java (Asterisk-Java), up to this everything as I expected then I have a problem that when I reject incoming call on my mobile phone Asterisk populates ${DIALSTATUS} with value BUSY. As I have read in documentation it should be populated with the DONTCALL value is not it? Next attempt when I just call my mobile phone while it’s busy doing another conversation for example to my friend it populates again the same value BUSY. As I can accept one of them but not both because I cannot recognize which one is real BUSY and which one is DONTCALL. Also I don’t get NOANSWER value when I just leave the phone ringing for some time instead I get CANCEL it should not be like that right? Only one of the status I get I think correctly is ANSWER value when I just pickup the phone.
My requirements which I need to support is:
- Recognise four of DIALSTATUS values: answer, busy, noanswer, dontcall and pushes them to my UserEvent on AMI
- Just after user pickup the phone Asterisk should hangup the call and just return DIALSTATUS
- When user don’t pickup for some time it should also hangup and return valid DIALSTATUS
- When user reject the call it should be valid DIALSTATUS also
- And last use case is when Asterisk found that user number is busy just return BUSY
The question is, is it possible and how to do it? Please help me.
About my configuration:
AsteriskNOW 6.12 64bit directly from asterisk.org site, registered SIP provider as follow:
[halonet]
disallow=all
defaultuser=my_user_name
type=friend
secret=my_password
host=sip.halonet.pl
fromuser=my_user_name
fromdomain=sip.halonet.pl
canreinvite=no
allow=ulaw
allow=alaw
qualify=yes
context=from-trunk-sip-halonet