Webphone

KonradSC

Active Member
Mar 10, 2017
134
68
28
Hi All,

I wanted to share my webphone that I'm working on using a modified version of ctxSip. It includes an updated version (0.15.6) of Sipjs which required me to make some adjustments to webphone/phone/scripts/SIP.js/sip.js in order to get hold and mute working correctly. I had issues with one-way audio using the older sipjs version 0.7.8.

Before you attempt to install this make sure you have webrtc working on your system!!
Use this link to test it out: https://collecttix.github.io/ctxSip/

Brief instructions...
1. Make sure you have webrtc up and working. See above.

2. Is webrtc working? Read through this thread if you are stuck. https://www.pbxforums.com/threads/tls-and-webrtc-enablement.146/

3. Download the webphone files and stick them in your /var/www/fusionpbx/apps directory
https://github.com/konradSC/Fusionpbx-Public/tree/master/Apps/webphone

2. Change owner
chown -R www-data:www-data /var/www/fusionpbx/

3. Upgrade Permissions and Menu



A few things...
1. I'm not a JS programmer, so a lot of this was hacked together. I'm open to suggestions on code changes.
2. The wss port is hard coded to 7443. You can adjust that in webphone/phone/index.php. Update the hardcoded variable or use a session variable.
3. There seems to be a two or three second delay in call setup. It could be the ICE or STUN setup. I haven't spent too much time troubleshooting it yet. Let me know if you have a fix.
4. I'm releasing this so the community can test it out. If we get a solid version of this webphone then I'll submit it to the Fusion project.

Thanks,
Konrad
 
  • Like
Reactions: yukon

Kenny Riley

Active Member
Nov 1, 2017
221
35
28
33
Hi there!

I am trying this and getting an 'Access Denied' error when trying to hit: https://mydomain.fusionpbx.com/app/webphone/webphone.php

I have changed ownership as suggested and have verified the permissions of this folder in /var/www/fusionpbx/app/webphone:
drwxr-xr-x 4 www-data www-data 4096 Apr 22 10:36 webphone

However I'm still not having any luck. I've updated permissions and menu, logged out and back in, etc. What am I missing?
 

Kenny Riley

Active Member
Nov 1, 2017
221
35
28
33
Ahh ignore this, my superadmin permissions were protected and not updating. Thank you Konrad, I'm excited to play with this!
 
  • Like
Reactions: KonradSC

gflow

Member
Aug 25, 2019
45
1
8
I've only tested in Master, but perhaps it might work in 4.4.
I just tested it on 4.4 and was getting the following:

Fatal error: Uncaught Error: Class 'token' not found in /var/www/fusionpbx/app/webphone/webphone.php:44 Stack trace: #0 {main} thrown in /var/www/fusionpbx/app/webphone/webphone.php on line 44

Any idea's on how to resolve that?
 
Last edited:

markjcrane

Active Member
Staff member
Jul 22, 2018
266
85
28
45
FusionPBX 4.4 is a previous release that is now insecure and unstable compared to FusionPBX 4.5.
 

markjcrane

Active Member
Staff member
Jul 22, 2018
266
85
28
45
I would say 4.5. However it depends how much risk you want to tolerate by staying on 4.4.
 

KonradSC

Active Member
Mar 10, 2017
134
68
28
I noticed that this client is using INFO for DTMF. You may want to add something like this to your dialplan in order for DTMF to be processed.

Code:
    <condition field="${sip_user_agent}" expression="SIP.js">
        <action application="set" data="dtmf_type=info"/>
    </condition>