I am trying to use the variable DIALSTATUS to know if the called numbered is busy, answered, has congestion, cancel, etc.
I have created a call file using php to make a call to a number. Now, I am trying to get the status of the called number. I was trying to know the status using the “DIALSTATUS” through the “extensions.conf” but, the DIALSTATUS is always returning a “”(empty string). Can some one help me with this issue.
My Basic application is to call a number and find out if the number is busy, canceled, noanswer, answer. Also please suggest me if some one have any idea to achieve this.
easy way to do that is use of Local channels. Originate call to a local channel which in turns dials that number you want. That way you can easily get the DIALSTATUS in dialplan.
Yes thats correct, Asterisk aggressively monitors the spool directory for call files. Whenever it sees a call file there it goes a head and places the call as instructed. In this case it finds the extension number matching with the context specified. The recommended way of doing it is to create the file else where and copy it to the spool directory otherwise asterisk may pickup the file while you are still creating it in the spool directory.
When this call file is place in spool what do you see on console ?
When I placed my call file in /var/spool/outgoing i am getting the following description in my console:
– Attempting call on LOCAL/123@newamar/n for 124@newamar:1 (Retry 1)
– Executing [123@newamar:1] Dial(“Local/123@newamar-8e8f,2”, “SIP/7865210317@vitel-outbound”) in new stack
– Called 7865210317@vitel-outbound
– SIP/vitel-outbound-006648b0 is ringing
– SIP/vitel-outbound-006648b0 is making progress passing it to Local/123@newamar-8e8f,2
– SIP/vitel-outbound-006648b0 answered Local/123@newamar-8e8f,2
Channel Local/123@newamar-8e8f,1 was answered.
== Starting Local/123@newamar-8e8f,1 at newamar,124,1 failed so falling back to exten ‘s’
== Starting Local/123@newamar-8e8f,1 at newamar,s,1 still failed so falling back to context ‘default’
[Dec 30 14:19:39] WARNING[2899]: pbx.c:2470 __ast_pbx_run: Channel ‘Local/123@newamar-8e8f,1’ sent into invalid extension ‘s’ in context ‘default’, but no invalid handler
[Dec 30 14:19:39] NOTICE[2899]: pbx_spool.c:365 attempt_thread: Call completed to LOCAL/123@newamar/n
== Spawn extension (newamar, 123, 1) exited non-zero on ‘Local/123@newamar-8e8f,2’