Asterisk Call Manager/1.3 .After login I am able to retrieve all peer detail as a string.
fwrite($socket, "Action: Command\r\n");
fwrite($socket, "Command: sip show peer ".$sip_no."\r\n\r\n");
I need to know whether the channel is busy or not.
How Can I get only the status like
function checkstatus(sip_no){
.....
return status;
}
Based on the status I need to do further processing.
You can query the Asterisk manager and get a response for each of your peers, using the sip command, in your case, i.e.:
sip show peer PEERNAME
Where PEERNAME is the name of your peer.
Here's a page with an example script for this: