Git Product home page Git Product logo

gmaruzz / saraphone Goto Github PK

View Code? Open in Web Editor NEW
150.0 12.0 71.0 612 KB

SaraPhone is an open source SIP WebRTC phone, complete with HotDesking, Redial, BLFs, MWI, DND, PhoneBook, Hold, Mute, Notifications. SaraPhone is fully integrated with FusionPBX. Based on SIP.js, SaraPhone works with all WebRTC compliant servers: FreeSWITCH, Asterisk, OpenSIPS, Kamailio, etc. SaraPhone gets its name from Giovanni's wife, Sara.

License: Mozilla Public License 2.0

PHP 13.10% CSS 1.10% JavaScript 78.49% HTML 6.79% Lua 0.52%
sip webrtc phone freeswitch asterisk opensips kamailio janus fusionpbx mwi

saraphone's Introduction

What is SaraPhone?

SaraPhone is an open source bare bone SIP WebRTC office phone (no video), complete with most features real companies want to use in real world: HotDesking, Redial, BLFs, MWI, DND, PhoneBook, Hold, Transfer, Mute, Attended Transfer, Notifications, running on all Browsers both on Desktop and SmartPhone.

SaraPhone is fully integrated with FusionPBX, the full-featured domain based multi-tenant PBX and voice switch for FreeSwitch.

Based on SIP.js, SaraPhone works with all WebRTC compliant SIP proxies, gateways, and servers (FreeSWITCH, Asterisk, OpenSIPS, Kamailio, etc).

Initial author is Giovanni Maruzzelli, and SaraPhone gets its name from Giovanni's wife, Sara.

In addition to providing all of the usual DeskPhone functionality, SaraPhone got:

  • Desktop Notification for Incoming Calls
  • Live MWI update
  • Real Time BLFs status update
  • BLF click to call
  • Caller Name and Number Display
  • Call Error Cause Display
  • AutoAnswer
  • Network Disconnect Reload
  • Show and Set Caller-ID (incoming-outbound)

Software Requirements

  • FusionPBX
  • or
  • WSS SIP Server (FreeSWITCH, Asterisk, OpenSIPS, Kamailio, etc) + Web Server (Apache, Nginx, etc)

How to Install SaraPhone on FusionPBX

YOU REALLY NEED TO DO ALL FOLLOWING STEPS

ALL THOSE BORING FOLLOWING STEPS

SAD, BUT TRUE

1 As root do the following:

cd /var/www/fusionpbx/app;
git clone https://github.com/gmaruzz/saraphone.git;
chown -R www-data:www-data saraphone;

2 Login as superadmin to your FusionPBX Web GUI,

Menu->Advanced->Upgrade, check:

  • App Defaults
  • Menu Defaults
  • Permission Defaults

then click "Execute"

3 Then, go to

Menu->Advanced->Default Settings SaraPhone settings:

  • wss_proxy SIP external IP Address of FusionPBX server

then click "Reload"

4 Go to Menu->Advanced->Sip Profiles

click on "internal", then:

  • liberal-dtmf true true
  • send-message-query-on-register true true
  • send-presence-on-register true true
  • wss-binding :7443 true

5 Go to menu->status->sipstatus

  • click fluchcache
  • click reloadxml

6 You NEED well working letsencrypt SSL certificates:

cd /usr/src/fusionpbx-install.sh/debian/resources/
./letsencrypt.sh

cat /etc/dehydrated/certs/XXX/fullchain.pem /etc/dehydrated/certs/XXX/privkey.pem > /etc/freeswitch/tls/wss.pem

7 then restart FreeSWITCH:

systemctl restart freeswitch;

8 For well working MWI:

edit /etc/freeswitch/autoload_configs/lua.conf.xml, uncomment line:

<param name="startup-script" value="app/voicemail/resources/scripts/mwi_subscribe.lua"/>

9 then restart FreeSWITCH:

systemctl restart freeswitch;

10 check USERs, EXTENSIONs, DEVICEs

User MUST have one or more EXTENSION assigned to her, and at least one of such extensions MUST be assigned to a DEVICE (you can create a fake device making up the macaddress).

SaraPhone will get its config from the DEVICE so, you want to configure the BLFs in the DEVICE page (menu->Accounts->Devices).

Saraphone will not care about "Port" and "Transport" settings in the DEVICE page. Saraphone will always use WSS transport, and the port defined in menu->Advanced->Default Settings->saraphone.

(optional: for best looking results, in the menu->Accounts->Extensions extension page, set effective-caller-id-name)

11 Logout from FusionPBX and login as a normal user, you will find:

Menu->Apps->SaraPhone

12 Desktop Notifications of incoming calls

To allow for desktop notifications of incoming calls, click on "Allow Notification" on the bottom of SaraPhone web page

13 Upgrading After Install

cd /var/www/fusionpbx/app/saraphone;
git stash; git pull; git stash apply

often, and you will get latest features/bigfixes, and maintain your own modifications

How to Install SaraPhone on WSS SIP Server + Web Server

  • As root go into HTML directory of your webserver, and:
git clone https://github.com/gmaruzz/saraphone.git;
chown -R www-data:www-data saraphone;

then edit saraphone.html to preset WSS proxy address and port, and the SIP domain.

You can then access SaraPhone at:

https://your.webserver.address/saraphone/saraphone.html

DON'T: Self -Signed SSL certs

DON'T: To authorize self-signed certificates (only for test) for WSS, from your browser (works on Opera and FireFox, Chrome does not accept self signed WSS at all) go to:

https://your.fusionpbx.address:7443/

and force the browser to accept (I understand the risks, etc)

FAQs, PROBLEMs, Troubleshooting

Q: There is a sensible delay in establishing audio after call is connected

A: Check if you have two network interfaces (eg: Ethernet and VPN on PCs, or WiFi and Data on Cells) active at same moment. ICE gathering is confused by two Net interfaces. Disable "Data always on" on smartphones, so you will have either WiFi OR Data at each single moment.

Q: In FusionPBX, I want to click on VoiceMail/Messages button and go straight to my messages, no login no password

A: Into saraphone.js, edit the lines:

$("#checkvmailbtn").click(function() {
    $("#extstarbtn").click();
    $("#ext9btn").click();
    $("#ext8btn").click();
    $("#callbtn").click();
});

to become:

$("#checkvmailbtn").click(function() {
    $("#extstarbtn").click();
    $("#ext9btn").click();
    $("#ext7btn").click();
    $("#callbtn").click();
});

eg, it will call *97 instead of *98

then edit the dialplan extension named vmain_user (*97) and add:

action set voicemail_authorized=true

at order 37 (before app.lua voicemail.lua)

Q: I want to use SaraPhone with multiple "Internel" SIP Profiles in FusionPBX

A: You must edit BOTH your SIP Profiles AND your Domains:

SIP Profiles:

menu->Advanced->Sip Profiles

for each "internal" Sip Profile:

wss-binding :74XX True

#note the colon in the port value, sao is colon then portnumber, XX is a number

DOMAINS:

menu->advanced->domains

click on a domainname

for each domainname

go at bottom right of page

click on Add (domain setting)

Category: saraphone

Subcategory: wss_port

Type: text

Value: the port number (no colon) you assigned to the profile of this domain

Enabled: True

SCREENSHOTS !

saraphone_01 saraphone_02 saraphone_03

saraphone's People

Contributors

frytimo avatar gmaruzz avatar greenbea avatar nandy1925 avatar rbetancor avatar seven1240 avatar wouam31200 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

saraphone's Issues

Error when loading Saraphone: Cannot use object of type database as array

I have followed the installation instructions and getting the error below when loading the saraphone application (that's all I see nothing else loads except for that error).

My system has the following installed:

FusionPBX 4.4.11
Freeswitch 1.8.6
PHP 7.1.33

Fatal error: Uncaught Error: Cannot use object of type database as array in /var/www/fusionpbx/app/saraphone/saraphone.php:77 Stack trace: #0 {main} thrown in /var/www/fusionpbx/app/saraphone/saraphone.php on line 77

Remember Registration Information

Hi Giovanni,

I installed to https://xswitch.cn/sara/ it looks great, however, I don't use fusionpbx and it seems it cannot remember the account info I filled. Each time I refresh it goes back to the default.

I'd like to ask is that a missing feature or would you like to add it, I generally remember it in localStorage, see the verto based demo: https://git.xswitch.cn/xswitch/xcc-examples/src/branch/master/webrtc/es6/demo.js

Would you like to add it or accept a PR?

Cheers,
Seven.

no display name on incoming calls throws exception?

First of all, great work Giovanni !! Many thanks for a very useful tool.

I noticed that this line assumes all incoming calls will have a display name in the From header:

var txt = document.createTextNode(s.remoteIdentity.displayName.toString());

When I sent this INVITE for an incoming call (which I believe is valid) I saw the app throw an exception:

020-04-30 20:25:40.652968 send 1220 bytes to wss/[xxx]:48492 at 20:25:40.652872:
INVITE sip:[email protected];transport=wss SIP/2.0^M
Via: SIP/2.0/WSS xxx.xxx.xxx:4433;branch=z9hG4bKS3XBSj9gBaX6g^M
Max-Forwards: 70^M
From: <sip:[email protected]:48492>;tag=KD1r1Xa3t7e1F^M
To: <sip:[email protected]:48492>^M
Call-ID: 99dd1694-05c3-1239-27a8-06241ca032e2^M
CSeq: 19585378 INVITE^M
Contact: <sip:172.31.32.10:4433;transport=wss>^M
Content-Type: application/sdp^M
Content-Length: 757^M
X-CID: 998db3d8-05c3-1239-be86-000000000000^M

488: Incompatible SDP

Tried to demo to a customer and got the above error in the soft-phone. What causes this?

Call to undefined method database

Sir,
I am using Fusionpbx on Centos7 and mariadb for the database. When I login to saraphone under Apps I am getting the below error. Is this something to do with database connection ?

Fatal error: Call to undefined method database::select() in /var/www/html/app/saraphone/saraphone.php on line 57

Location match in apache2 wss proxy

I edited saraphone.html with my login and server info. When I then press Login, nothing happens except I'm asked for microphone permission.

Browser console has this:

Sat Apr 18 2020 15:28:12 GMT+0300 (Eastern European Summer Time) | sip.ua | next connection attempt in 2 seconds sip.js:2900:10
GEThttps://test.tutpro.com/saraphone/saraphone.html
[HTTP/1.1 200 OK 467ms]

Sat Apr 18 2020 15:28:12 GMT+0300 (Eastern European Summer Time) | sip.ua | user requested closure... sip.js:2900:10
Sat Apr 18 2020 15:28:12 GMT+0300 (Eastern European Summer Time) | sip.ua | closing registerContext sip.js:2900:10
Sat Apr 18 2020 15:28:12 GMT+0300 (Eastern European Summer Time) | sip.transport | closing WebSocket wss://192.168.43.82:443 sip.js:2900:10
GEThttps://test.tutpro.com/saraphone/css/bootstrap.min.css
[HTTP/1.1 200 OK 8ms]

GEThttps://test.tutpro.com/saraphone/css/style2.css
[HTTP/1.1 200 OK 165ms]

GEThttps://test.tutpro.com/saraphone/js/adapter.js
[HTTP/1.1 200 OK 39ms]

GEThttps://test.tutpro.com/saraphone/js/jquery.min.js
[HTTP/1.1 200 OK 277ms]

GEThttps://test.tutpro.com/saraphone/js/sip.js
[HTTP/1.1 200 OK 339ms]

GEThttps://test.tutpro.com/saraphone/saraphone.js?random=5e95b0591ba90
[HTTP/1.1 200 OK 262ms]

GEThttps://test.tutpro.com/saraphone/wav/0.wav
[HTTP/1.1 206 Partial Content 0ms]

GEThttps://test.tutpro.com/saraphone/wav/1.wav
[HTTP/1.1 206 Partial Content 0ms]

GEThttps://test.tutpro.com/saraphone/wav/2.wav
[HTTP/1.1 206 Partial Content 0ms]

GEThttps://test.tutpro.com/saraphone/wav/3.wav
[HTTP/1.1 206 Partial Content 1ms]

GEThttps://test.tutpro.com/saraphone/wav/4.wav
[HTTP/1.1 206 Partial Content 1ms]

GEThttps://test.tutpro.com/saraphone/wav/5.wav
[HTTP/1.1 206 Partial Content 0ms]

GEThttps://test.tutpro.com/saraphone/wav/6.wav
[HTTP/1.1 206 Partial Content 0ms]

GEThttps://test.tutpro.com/saraphone/wav/7.wav
[HTTP/1.1 206 Partial Content 1ms]

GEThttps://test.tutpro.com/saraphone/wav/8.wav
[HTTP/1.1 206 Partial Content 0ms]

GEThttps://test.tutpro.com/saraphone/wav/9.wav
[HTTP/1.1 206 Partial Content 1ms]

GEThttps://test.tutpro.com/saraphone/wav/star.wav
[HTTP/1.1 206 Partial Content 0ms]

GEThttps://test.tutpro.com/saraphone/wav/hash.wav
[HTTP/1.1 206 Partial Content 1ms]

GEThttps://test.tutpro.com/saraphone/wav/silence.wav
[HTTP/1.1 206 Partial Content 1ms]

GEThttps://test.tutpro.com/saraphone/mp3/ring.mp3
[HTTP/1.1 206 Partial Content 11ms]

The doctor is in saraphone.js:1004:13
Is something troubling you? saraphone.js:1005:13
GEThttps://test.tutpro.com/saraphone/favicon.ico

login page keeps loading

in test it in my domain and it worked fine

i gave it to one customer to test and by him the login page will keep trying to login and reload

i checked in the page code it has the right
username
password
domain name
pot number

i tired it in chrome and explorer

any idea what to test

FEATURE REQUEST: SDES

the calls work fine with FS over wss after patch applied manually but i noticed when dialing from certain countries where DTLS should work and isnt being blocked based on tests using the opentokrtc demo, i still get choppy audio after a minute into the call and then no audio at all. I believe jssip library supports SDES so would it be possible to add an option to use that on SRTP as the works flawless

wss proxy uri with path

Looks like it is currently not possible to have path in wss proxy URI. I tried by adding path to WSS Proxy Port:

443/wss/

but connection to proxy was not established.

I tested with JsSIP and connection worked fine. So it is not an issue with my Apache WSS proxy configuration.

I don't know if this issue is a bug or feature request.

If feature request, then instead of WSS Proxy Name and Port, it would be better to allow user to configure the whole URI.

sip 183 session progress no audio

most of my upstream gateways send a 183 session progress and send media of custom ringtone which FS passes onto saraphone but the media doesnt start unless the connected is signalled, anyway to get around this in FS or the dialer?

Halted at Choose which phone

as soon as I open saraphone it shows me the display page with a drop-down list which has no options to select from, the user has extensions and those extensions are connected to devices but nothing is being displayed here
image
image
image
image
image

Voicemail Bug

Good Morning

i had an issue with my fusionpbx that when a user called in to listen to VM free-switch was playing back for adavnced options press 5, this was before the greeting that said you have x new voicemails...... we noticed in the CLI that as soon as the voicemail gets activated the sara dialplan got invoked, so i just disabled all the dialplans from sara and my VM works regular now

Multiple Profiles Support in FusionPBX

I have followed your instructions but the phone cannot login. I think the issue has something to do with Multiple internal SIP profiles?

What should I do?

FusionPBX 5.1 PHP8 Saraphone Not Work

I iam try use saraphone in my fusionpbx 5.1 and not work, when i try use in my older instance the fusionpbx 4.X its work.

Now i tested in other instance that use FusionPBX 5.1 but use PHP 7.4 and its OK, i try new installations in Debian 12 that use PHP 8.1 by default and not work, its possible any change to work with PHP 8 in Saraphone?

When i try use saraphone with PHP 8 i receive only screen to select device but not is possivel select or change any configuration.

Contacts not Open/permission

Hello,

Gmaruzz, i have a problem, when login in Saraphone the button Contacts not Work.
When I click in contacts only open a new window bellow the "Phone", in this windows the message is "access denied" according to the print, please what is necessary to see the contacts of fusionpbx or extensions and groups?

I instaled a new fusionpbx for make tests, I followed all the steps describe here and the same error.
Uploading 2024-06-04_15h27_33.png…

REFER transfer support

Does SaraPhone have REFER transfer support? If not, then is this planned for the future?

Red bar up top with "NETWORK DISCONNECTED" etc

Went back through and followed the guide three times making sure I didn't skip any steps sans the MWI subscribe line.

I am able to select a phone and click choose which phone, but then I get the page warning that it shouldn't be there for more than half a second.

Do not register and back to login

I am trying to work with Asterisk (not FusionPBX) and when I click Login a black screen flashes then goes back to the login screen. I have configured the User, Password, Name, SIP Domain, Wss Proxy, Port. Details work using another webRTC dialer (sipml5).
Wondering if you can provide any guidance on what I maybe missing?
Many thanks :)

Dial string gets reset when a new incoming call arrives

If you are dialing a number to do an outbound call and during that dialing you receive a new incoming call, the dialing string input get reset.

Input dial string should not be touched and let the user to decide if continue dialing or answer de incoming call.

Cross Domain Ext

Hi

i just installed the phone and i set up a user that maps to Ext 103 and i have a yealink deivce assigned

when i log in to the saraphone it it will pull in the drop down all 103 from all domains

saraphone

Unable to load webphone - Stuck at "Please Wait" in chrome

Hi Giovanni,

I have downloaded SaraPhone and tried to load up in Chrome and it appears to be stuck at "Please wait" Any clue as to why this issue?

We would like to test your webrtc for our pbx platform based on 2600hz kazoo. Let us know if that is supported.

Thanks
Rabbani

image

Bugs and feature improvements

i noticed there is a FS patch which is based on old code so doesnt apply to master, secondly if you enter a incorrect login it doesnt indicate if its incorrect, thirdly would it be possible to add code to activate proximity sensor and activate the earpiece rather than speakerphone on a mobile.

I tried the dialer with my FS server using wss and that works fine provided DTLS isnt blocked in a country but for some odd reason i start getting choppy audio after a while and then it totally stops whereas SRTP works flawless with the same FS instance along with TLS. i tried the opentokrtc demo and it works flawless which also runs on webrtc so no idea whats causing the choppy audio

Menu disappears

My fusionpbx version is as below

Version 4.5.27
Git Information Branch: master Commit: 1049b37e6be7a77ed0e862ce3b12116852db95e4 Origin: https://github.com/fusionpbx/fusionpbx Status: Your branch is up to date with 'origin/master'. +173 days ago
Project Path /var/www/fusionpbx
Switch Version 1.10.3 (32bit)
PHP Version 7.3.31-1~deb10u1

When I follow the instructions for saraphone

2 Login as superadmin to your FusionPBX Web GUI,

Menu->Advanced->Upgrade, check:

    App Defaults
    Menu Defaults
    Permission Defaults

then click "Execute"

The menu on the top disappears, I have to close the browser and relogin to get it back

Inbound Call - No Audio (except for firefox)

Outbound everything works fine in all my tested browsers.

Inbound calls ie. extension 100 (yealink handset) calls 200 (Saraphone).
Saraphone 200 can hear the audio from Yealink 100
Yealink 100 can NOT hear audio from Saraphone 200.

This is an issue on Google Chrome (latest version), Opera (latest version), Microsoft Edge.

Tested on Windows and Mac. Same thing.

However with Firefox, all works perfectly.

Hold, XTrans, etc. buttons did not work during call

I see the DTMF codes on the FS CLI, but they do not do anything.

I saw that the .lua script have some calls to bind_digit_action ... but I don't saw that lua script been executed during the call stablishement or the SaraPhone loading.

Maybe some missing instruction on the install docs?

Failed opening required 'resources/require.php'

I tried saraphone according to "How to Install SaraPhone on WSS SIP Server + Web Server" and got this:

[Sat Apr 18 13:58:19.697412 2020] [php7:warn] [pid 22243] [client 192.168.43.82:37986] PHP Warning:  require_once(resources/require.php): failed to open stream: No such file or directory in /var/www/saraphone/contacts.php on line 30, referer: https://test.tutpro.com/saraphone/saraphone.html
[Sat Apr 18 13:58:19.697469 2020] [php7:error] [pid 22243] [client 192.168.43.82:37986] PHP Fatal error:  require_once(): Failed opening required 'resources/require.php' (include_path='.:/usr/share/php:/var/www') in /var/www/saraphone/contacts.php on line 30, referer: https://test.tutpro.com/saraphone/saraphone.html

Such a file (require.php) does not exist.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.