Home
RECOMMENDED FOR YOU:
SMS Gateway software
Ozeki brings you outstanding
SMS Gateway technology. Use our SMS Server products on Windows,Linux, or Android

C# SMS API
Developers can use our C# SMS API to send SMS from C#.Net. The C# SMS API comes with full source code

PHP SMS API
The ozeki PHP SMS gateway software can be used to send SMS from PHP and to receive SMS usig PHP on your website

SMPP SMS Gateway
SMS service providers use our SMPP gateway solution, that offers a high performance SMPP server and SMPP client gateway with amazing routing capabilities
Ozeki Phone System

getCallState() method

If a call object is added to the program, this method can run on it. It is used to find out the current callstate of the call. The callstates can be: "RINGING", "NOT_FOUND", "REJECTED", "HOLD", "IN_CALL", "COMPLETED" and "BUSY".

Returns

currentCallState: Type: CallState. The current state of the call.

Method usage example

In this example we make the myFirstCall object in the call class, we set the called number and start the call. After this we write out the current callstate on the console in every 2 seconds until the call ends. We check if the call has been completed by registering on the onCallStateChanged event (Code example 1).

var calledNumber = "1000";

//constructor of the call
var myFirstCall = OzWebClient.createCall(calledNumber); 

myFirstCall.start();	//starts the call

//registers to the onCallStateChanged event
myFirstCall.onCallStateChanged(callStateChanged); 

loop(); //starts the loop	

function loop(){
	if(myFirstCall != null){ //if there is a call
	
		//start the loop recursively in every 2 seconds and
		setTimeout('loop()',2000); 
		
		//write the current callstate on the console log
		console.log(myFirstCall.getCallState()); 
	}
}

function callStateChanged(state){
	if (state = "COMPLETED"){ //if the call is completed it
		myFirstCall=null; //deletes the call
	}
}
	
Code example 1 - getCallState() method example

More information