Get status call

Hi, Rob.
I’m looking for api method that return me status about call.
For example, if I call and client not answer I get status ‘Not answer’ or something like this.
How I do this?

Hi,

If you hook the line events for the device that you are making the call on via a callback then you will get status callbacks whenever a call is initiated on the line or changes state.

Something like this installed as a line event handler should do the trick and you will then be told about state changes. A normal call will generally go ‘ring’ -> ‘up’ -> ‘dead’. An unanswered call will go ‘ring’ -> ‘dead’ without ever going to ‘up’…

function lineEvent(f, h, l) {
		// Get a list of all calls on the line
		calls = l.get('calls');

		// For each call
		for ( var x in calls) {

			// What is its new state
			var currentState = calls[x].get('state');
			console.log(l.get('name') + ' - ' + currentState);
                 }
}

Rob, I don’t use javascript code for call. I have to have request to call in my code. Maybe you write me some method in api for get status. For example, If I have call ID from dial response after I execute some method with ID that get me status of call.
Is it real?

Hi, I’m having some difficulty parsing the question here, if you aren’t using Javascript then I’m not sure how you are making the call to the Javascript device.dial() function to initiate a call in the first place?
Or are you using some other mechanism to initiate the call?
If you are using Javascript then registering a callback function to be told when a call changes state is the way to proceed.

I use .net with logic for process requests. I use fiddler for check request and then execute request in my code.

Only the most basic of requests are going to work by replaying HTTP transactions you have sniffed with fiddler. To do anything like monitor state, you are going to need to run the javascript API rather than fire and forget HTTP transactions.

Have you thought about using the node.js implementation of the API if you want to do this server side?