PBXes (http://www1.pbxes.com/forum/index.php)
- English (http://www1.pbxes.com/forum/board.php?boardid=16)
-- Feature Requests (http://www1.pbxes.com/forum/board.php?boardid=23)
--- RE: See extension status from website (http://www1.pbxes.com/forum/threadid.php?threadid=1445421617)


Posted by cartomanzia on 21.10.2015 at 11:00:

See extension status from website

Our need would be to offer to our visitors the possibilty to see who is free and who's not. Is this possibile right now ? Or could you please integrate this feature ? Thank you


Posted by i-p-tel on 22.10.2015 at 14:28:

RE: See extension status from website

The feature is already there. Please have a look at webcall. You can choose URLs under Extensions.


Posted by cartomanzia on 23.10.2015 at 07:26:

RE: See extension status from website

Right but Can I see if the operator is busy from my webpage ?
EDIT: Now I can do the exact question:

Can I show my FOP inside an iframe of my website ?


Posted by i-p-tel on 26.10.2015 at 08:57:

RE: See extension status from website

Busy status are visible from webcall pages (you can display more than one extension). FOP cannot be displayed on websites because it requires to login first.


Posted by cartomanzia on 27.10.2015 at 14:35:

RE: See extension status from website

Probably we are talking of two different webpage... where is possibile to call "webcall pages", there is not any "spy" or indicator to see who's busy or not... could you please be more detailed ?

In general, I need to show on my website the presence of the operator that is on line or not. (like the green spy inside FOP).
If some operator connect his sip phone, on the website I need to show that he is connected. It is possible ?


Posted by i-p-tel on 11.11.2015 at 09:51:

RE: See extension status from website

We have tested again. The webcall page of an extension shows "Busy" under the extension's name if it is currently in a call. This information can be read by a php application, too, if you want to collect it.


Posted by cartomanzia on 11.11.2015 at 11:57:

RE: See extension status from website

YES, could be a solution. Could you please tell me what's the query I need to call to get back the "busy" variable ?
I'm explain myself better:
This is what I will do in php:
<?
conditions=check the ext addr xxx if is busytraurig here I need the address where I will check the stauts of extention, where the answer could be: busy or null)
in case is busy I will show an image, in case not I will show other Image.
refresh page every xx seconds;
?>
I already know how to do, I just need the addres where check the status of extention and the variable name that contain "busy".


Posted by i-p-tel on 02.12.2015 at 11:40:

RE: See extension status from website

Your app needs to read the whole webcall page, and at the position where "Busy" is shown for busy extensions, look for it. If the string is present there, the extension is busy, if the string is not present where expected it is not in a call.


Posted by cartomanzia on 02.12.2015 at 17:33:

RE: See extension status from website

Wow... finally an effective answer smile MANY MANY MANY THANK YOU FOR THAT. Here's the code to get the status to show, in case someone need:

EDIT: I see there is some troubles when this script is used in a while cycle. So, The suggestion is to use to get single result as well. Use the script below that result more effective:

<?php
$p="Number of extention you want to check"; // es 01, 02 ecc

$addr="http://pbxes.org/youralias$p"; /* address of your Webcall page, NOTE: for this script the address need to end with the number of the extention you wanna check.*/

/*Now we will get not entire page, 'cause of latency problems but only the term we need.*/

$start_read=3214;
$interval=912;

/*Then we are ready to know the status of extensions we want to check */

if(!$page= file_get_contents($addr, false, null, $start_read, $interval)) die ("impossible to read the page");
if($status=strstr($page, "Busy")){
$status; echo "Busy";
} else {
echo "Idle";
}
fclose($page); // we close the web page reading

$curpage = $_SERVER['PHP_SELF'];
header('Refresh: 5; url=?code=$p' . $curpage);

?>


Posted by i-p-tel on 02.12.2015 at 22:33:

RE: See extension status from website

Thank you very much for sharing!


Posted by i-p-tel on 01.10.2016 at 11:56:

RE: See extension status from website

There is an easier way to access extension state. When getting the extension's webcall page with parameter "?action=state", you will get a number back which is
Zitat:
0 - Idle
1 - InUse
2 - Busy
4 - Unavailable
8 - Ringing
9 - Inuse & Ringing

Use of this parameter requires the host where your account is actually hosted (www1 to www4) to be given in the URL.


Posted by sia on 01.04.2017 at 21:13:

RE: See extension status from website

http:/pbxes.org/alias?action=state does not work for me, resulting in 404.

The WebCall page is valid, and works with no parameters or with ?action=video

p.s. I did try using specific http://wwwN.pbxes.org/ as well

--igor


Posted by i-p-tel on 03.04.2017 at 11:08:

RE: See extension status from website

hostname needs to be followed by .pbxes.com

Powered by: Burning Board Lite 1.0.2 © 2001-2004 WoltLab GmbH
English translation by Satelk