How to get call status using .call Files

I m having asterisk-1.8 working properly on my CentOS 6.2 system.

I want to generate calls through .call files. And want to get the status of that calls i.e whether the call is Answered, Busy, No answered, cancle etc. Based on the status I want to do various actions.

I can generate the call properly with the call files. For the answered calls, I can get the call status through DIALSTATUS. Its working fine. No issue at all.
But the issue is how to get the status of busy/cancle/no answere etc calls ? Please guide me for the same. Below is my code :


Something like this works for me, so I am not sure that you have issues with it …

    exten => s,1,NoOp(=============Testing===============)
    exten => s,n,Dial(SIP/1001,10,tT)

    exten => h,1,Set(DialStatus=${DIALSTATUS})

I think he wants the status on the cold call side, not the agent side.

dejanst and david55 thank you for your reply.

As I mentioned that I m generating the call from the .call file. So, once the person picks up then only it will come to this dial plan. And we will get the answer DIALSTATUS.

But what if the call which is dialed from the dialplan is not picked up or not answered or busy then how can it come to the dialplan ? And in this case how to get the status of the call ?


You should be using the AMI to do this - you observe the call lifecycle so you know what is going on. Note that handling call failures, reschedules, etc may take a bit of work to get right.