Вопрос

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:

http://www.venturevoip.com/news.php?rssid=2217

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top