Page 1 of 1

webphone is not working on real time report page

PostPosted: Sat Mar 18, 2017 6:26 am
by chornyi_taras
Looks like websocket url is not passed as an option to webphone iframe on real time report page. To fix this I've used following path:


Code: Select all
Index: www/vicidial/realtime_report.php
===================================================================
--- www/vicidial/realtime_report.php    (revision 2705)
+++ www/vicidial/realtime_report.php    (working copy)
@@ -941,6 +941,13 @@
                        $codecs_list = preg_replace("/ /",'',$codecs_list);
                        $codecs_list = preg_replace("/-/",'',$codecs_list);
                        $codecs_list = preg_replace("/&/",'',$codecs_list);
+                       $stmt="SELECT asterisk_version,web_socket_url from servers where server_ip='$webphone_server_ip';";
+                if ($DB) {echo "|$stmt|\n";}
+                $rslt=mysql_to_mysqli($stmt, $link);
+                                if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01028',$VD_login,$server_ip,$session_name,$one_mysql_log);}
+                $row=mysqli_fetch_row($rslt);
+                $asterisk_version=$row[0];
+                $web_socket_url=$row[1];

                        if ($use_external_server_ip=='Y')
                                {
@@ -994,7 +1001,8 @@
                        if ($webphone_dialpad == 'TOGGLE_OFF') {$webphone_options .= "--DIALPAD_OFF_TOGGLE";}
                        if ($webphone_auto_answer == 'Y') {$webphone_options .= "--AUTOANSWER_Y";}
                        if ($webphone_auto_answer == 'N') {$webphone_options .= "--AUTOANSWER_N";}
-
+                       if (strlen($web_socket_url) > 5) {$webphone_options .= "--WEBSOCKETURL$web_socket_url";}
+echo "<!-- debug: $web_socket_url -->";
                        $session_name='RTS01234561234567890';

                        ### base64 encode variables


@mflorell is it possible to include it to vici code base?

Re: webphone is not working on real time report page

PostPosted: Sat Mar 18, 2017 8:47 am
by mflorell
Should be all fixed in svn/trunk, thank you very much for pointing this out!

Re: webphone is not working on real time report page

PostPosted: Sat Mar 18, 2017 3:08 pm
by chornyi_taras
verified. Thanks mflorell

Re: webphone is not working on real time report page

PostPosted: Thu May 11, 2017 9:31 am
by chornyi_taras
same issue is present on phone_only page
agc/phone_only.php

Re: webphone is not working on real time report page

PostPosted: Thu May 11, 2017 10:18 am
by mflorell
The phone_only.php script in svn/trunk should now be WebRTC-capable.

Re: webphone is not working on real time report page

PostPosted: Thu May 11, 2017 1:27 pm
by chornyi_taras
verified. Thanks for quick fix