ctxSip - Web SIP Client

2,530 views
Skip to first unread message

Blake

unread,
Sep 9, 2014, 5:13:23 PM9/9/14
to 2600h...@googlegroups.com
I wrote an open source web sip client.  It is based on SIP.js and I have it working on my Kazoo installation.  It is designed to be a component in a larger web application.

I just posted it on GitHub and it is open source (MIT license).

Project:
https://github.com/collecttix/ctxSip

Demo:

Features:
  • Audio only (SIP.js is video capable, but I don't need it.  It should be trivial to implement.)
  • Hold / Resume, Mute, multiple call support.
  • No plugins required, Works with WebSocket / WebRTC enabled browsers. (Firefox & Chrome, for now Safari 8 when it is released.)
  • Intuitive interface
  • Call log is saved to localStorage.
  • Easy to configure and integrate into your project. (jQuery, Bootstrap)
I am am sure it is rough around the edges.  I would love some input.  Pull requests welcome.

Te Matau

unread,
Sep 10, 2014, 1:42:53 PM9/10/14
to 2600h...@googlegroups.com
You are my hero!

Dayton Turner

unread,
Sep 15, 2014, 4:38:57 PM9/15/14
to 2600h...@googlegroups.com
What are you using for the websockets url for Kazoo installations?

Blake

unread,
Sep 15, 2014, 5:39:35 PM9/15/14
to 2600h...@googlegroups.com
I use 8433 (ssl) on the kamailo server. This is necessary for SSL sites to prevent browser issues when accessing non-SSL content. The default unsecured port is 8080.  

Both are set in:
/etc/kazoo/kamailio/local.cfg

Dayton Turner

unread,
Sep 15, 2014, 8:29:12 PM9/15/14
to 2600h...@googlegroups.com
I may just need to update my kamailio - this is presumably set up using the websockets module?  I havent updated my kamailio in some time.  I'll do that first and look again.

Thanks!

September 15, 2014 at 2:39 PM
I use 8433 (ssl) on the kamailo server. This is necessary for SSL sites to prevent browser issues when accessing non-SSL content. The default unsecured port is 8080.  

Both are set in:

On Monday, September 15, 2014 3:38:57 PM UTC-5, Dayton Turner wrote:
--
You received this message because you are subscribed to a topic in the Google Groups "2600hz-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/2600hz-dev/r0KgyxzRl8g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 2600hz-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
September 15, 2014 at 1:38 PM
What are you using for the websockets url for Kazoo installations?

On Tuesday, 9 September 2014 14:13:23 UTC-7, Blake wrote:
--
You received this message because you are subscribed to a topic in the Google Groups "2600hz-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/2600hz-dev/r0KgyxzRl8g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 2600hz-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Dayton Turner 
Founder and CEO

Voxter Communications Inc.
webhttp://www.voxter.com
tel.
 +1 (604) 629-8647 x 102
fax+1 (604) 629-8646
did+1 (604) 638-3851

*** FOR CUSTOMER SUPPORT, PLEASE EMAIL sup...@voxter.ca OR CALL (604) 629-8647 ***


 

Yumminova Telecom

unread,
Nov 17, 2014, 2:02:39 AM11/17/14
to 2600h...@googlegroups.com
Perhaps its nice if u write some doc on which steps to follow to get it to work?

Looks great though!


Op maandag 17 november 2014 01:22:37 UTC+1 schreef G. Arrington:
How do you configure the websocket URL?

Yumminova Telecom

unread,
Nov 17, 2014, 2:10:12 AM11/17/14
to 2600h...@googlegroups.com
Demo gives a 404


Op dinsdag 9 september 2014 23:13:23 UTC+2 schreef Blake:

Sam Metson

unread,
Nov 17, 2014, 3:36:42 PM11/17/14
to 2600h...@googlegroups.com
I was the person who ported it to Kazoo UI. The config file in phone/scripts doesn't do anything (and I probably should have gotten rid of it completely). You can specify the websocket URL in the Kazoo UI config file. with the ws_server key, e.g. winkstart,config={ ws_server: 'ws://ip_of_kamailio:8080' }.

Cheers,
Sam

Blake

unread,
Nov 17, 2014, 7:57:11 PM11/17/14
to 2600h...@googlegroups.com
It is merged in kazoo-ui? Awesome! Thanks Sam!
Message has been deleted

Eamon

unread,
Nov 18, 2014, 12:15:18 PM11/18/14
to 2600h...@googlegroups.com
Hi

I have enabled websocket in kamailio #!substdef "!MY_WEBSOCKET_DOMAIN!X.X.X.X!g"
added the WSS in the UI , updated config.js in /phone/scripts with device details and WSS
i still get websocket disconnect when i load the app in the UI

Sam Metson

unread,
Nov 18, 2014, 3:26:07 PM11/18/14
to 2600h...@googlegroups.com
To be clear, the config file in phone/scripts does nothing, and shouldn't be used.

As to your issue, I seem to remember having some difficulties with Kamailio. We're running 
You need to add the line #!trydef WEBSOCKETS-ROLE to the enabled roles section in kamailio's local.cfg.
The line you posted causes Kamailio to check the Origin header of the websocket request (and reject non-matching requests), so it might be best to try with that line commented out, at least for testing.

The lines you're probably looking for are the ones below (they may already be present in the default config):
#!substdef "!TCP_WS!tcp:MY_IP_ADDRESS:8080!g"
#!substdef "!UDP_WS_SIP!udp:MY_IP_ADDRESS:8080!g"
#!substdef "!TLS_WSS!tls:MY_IP_ADDRESS:8443!g"
#!substdef "!UDP_WSS_SIP!udp:MY_IP_ADDRESS:8443!g"


Cheers,
Sam

Eamon

unread,
Nov 18, 2014, 5:18:08 PM11/18/14
to 2600h...@googlegroups.com
Hi Sam

I have checked config
#!trydef WEBSOCKETS-ROLE is enabled in the local config


#!substdef "!TCP_WS!tcp:MY_IP_ADDRESS:8080!g"
#!substdef "!UDP_WS_SIP!udp:MY_IP_ADDRESS:8080!g"
#!substdef "!TLS_WSS!tls:MY_IP_ADDRESS:8443!g"
#!substdef "!UDP_WSS_SIP!udp:MY_IP_ADDRESS:8443!g"

are there by default
i still get the below message when i open browser phone

Websocket Disconnected.

An Error occurred connecting to the websocket.

Sam Metson

unread,
Nov 18, 2014, 10:06:53 PM11/18/14
to 2600h...@googlegroups.com
You could try using insecure websockets instead of secure (ws://... instead of wss://...) in Kazoo UI's config.js.

Eamon

unread,
Nov 19, 2014, 3:28:04 PM11/19/14
to 2600h...@googlegroups.com
Hi Sam

switched to port 8080, getting

Registration Error.An Error occurred registering your phone. Check your settings.

log from Kamailio

Nov 19 20:08:31 kazoo1 kamailio[1485]: INFO: <script>: 7cd2fo1c8qs92ov2vgce96|start|recieved UDP request REGISTER sip:sip.kazoo.com
Nov 19 20:08:31 kazoo1 kamailio[1485]: INFO: <script>: 7cd2fo1c8qs92ov2vgce96|log|source 95.83.253.115:47242
Nov 19 20:08:31 kazoo1 kamailio[1485]: INFO: <script>: 7cd2fo1c8qs92ov2vgce96|log|from sip:user...@sip.kazoo.com
Nov 19 20:08:31 kazoo1 kamailio[1485]: INFO: <script>: 7cd2fo1c8qs92ov2vgce96|log|to sip:user...@sip.kazoo.com
Nov 19 20:08:31 kazoo1 kamailio[1485]: INFO: <script>: 7cd2fo1c8qs92ov2vgce96|log|originated from external sources
Nov 19 20:08:31 kazoo1 kamailio[1485]: INFO: <script>: 7cd2fo1c8qs92ov2vgce96|log|this is a websocket request
Nov 19 20:08:31 kazoo1 kamailio[1485]: INFO: <script>: 7cd2fo1c8qs92ov2vgce96|log|correcting NATed contact in registration
Nov 19 20:08:31 kazoo1 kamailio[1485]: INFO: <script>: 7cd2fo1c8qs92ov2vgce96|end|issued new auth challenge to new registration attempt
Nov 19 20:08:31 kazoo1 kamailio[1485]: INFO: <script>: 7cd2fo1c8qs92ov2vgce96|start|recieved UDP request REGISTER sip:sip.kazoo.com
Nov 19 20:08:31 kazoo1 kamailio[1485]: INFO: <script>: 7cd2fo1c8qs92ov2vgce96|log|source 95.83.253.115:47242
Nov 19 20:08:31 kazoo1 kamailio[1485]: INFO: <script>: 7cd2fo1c8qs92ov2vgce96|log|from sip:user...@sip.kazoo.com
Nov 19 20:08:31 kazoo1 kamailio[1485]: INFO: <script>: 7cd2fo1c8qs92ov2vgce96|log|to sip:user...@sip.kazoo.com
Nov 19 20:08:31 kazoo1 kamailio[1485]: INFO: <script>: 7cd2fo1c8qs92ov2vgce96|log|originated from external sources
Nov 19 20:08:31 kazoo1 kamailio[1485]: INFO: <script>: 7cd2fo1c8qs92ov2vgce96|log|this is a websocket request
Nov 19 20:08:31 kazoo1 kamailio[1485]: INFO: <script>: 7cd2fo1c8qs92ov2vgce96|log|correcting NATed contact in registration
Nov 19 20:08:31 kazoo1 kamailio[1485]: INFO: db_kazoo [dbase.c:664]: db_kazoo_query(): query table=subscriber
Nov 19 20:08:31 kazoo1 kamailio[1485]: ERROR: db_kazoo [dbase.c:259]: dbk_creds_build_result(): Json-c error - failed to extract password [{"Defer-Response":"true","Server-ID":"","Node":"whistl...@kazoo1.sip.com","Msg-ID":"3e5228403e14cd17-1485@ip_address","App-Version":"0.4.2","App-Name":"registrar","Event-Name":"authn_err","Event-Category":"directory"}]
Nov 19 20:08:31 kazoo kamailio[1485]: INFO: <script>: 7cd2fo1c8qs92ov2vgce96|end|failed registration attempt from 95.83.253.115:47242 for user...@sip.kazoo.com





On Wednesday, November 19, 2014 5:56:18 PM UTC, G. Arrington wrote:
Sam, do you have any thoughts on my browserphone inbound call issue?  Does your setup work with inbound?

Luis Azedo

unread,
Nov 19, 2014, 3:38:06 PM11/19/14
to 2600h...@googlegroups.com

i know this may seem a bit cryptic but...

Nov 19 20:08:31 kazoo1 kamailio[1485]: ERROR: db_kazoo [dbase.c:259]: dbk_creds_build_result(): Json-c error - failed to extract password [{"Defer-Response":"true","Server-ID":"","Node":"whistl...@kazoo1.sip.com","Msg-ID":"3e5228403e14cd17-1485@ip_address","App-Version":"0.4.2","App-Name":"registrar","Event-Name":"authn_err","Event-Category":"directory"}]
Nov 19 20:08:31 kazoo kamailio[1485]: INFO: <script>: 7cd2fo1c8qs92ov2vgce96|end|failed registration attempt from 95.83.253.115:47242 for user...@sip.kazoo.com


your password is wrong or there's something wrong on kazoo side, check amqp bus messages, check registrar logs, check ecallmgr logs.




--
You received this message because you are subscribed to the Google Groups "2600hz-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 2600hz-dev+...@googlegroups.com.

Eamon

unread,
Nov 19, 2014, 4:54:37 PM11/19/14
to 2600h...@googlegroups.com
I works under user account but not as admin

Luis Azedo

unread,
Nov 19, 2014, 10:14:44 PM11/19/14
to 2600h...@googlegroups.com
does admin have a sip user (device) and you are trying to login with that sip user (device) ?

On Wed, Nov 19, 2014 at 9:54 PM, Eamon <eamon....@gmail.com> wrote:
I works under user account but not as admin

Eamon

unread,
Nov 21, 2014, 1:46:04 PM11/21/14
to 2600h...@googlegroups.com
Hi Luis
yes it does, when i added the app to the UI, a device admin browserphone was created as well.

Te Matau

unread,
Nov 28, 2014, 7:36:23 PM11/28/14
to 2600h...@googlegroups.com
We have seen the following behaviour with browserphone on incoming calls:
1. If browserphone is registered using secure websockets (WSS) then browserphone does not ring. This is probably for the same reason that causes incoming calls to SIP devices registered over TLS to fail. 
2. If browserphone is not using secure websockets then the call can be answered and proceeds for 30 second before being disconnected. This seems to be due to Kamailio sending the ACK message to browserphone over UDP so browserphone doesn't respond appropriately to the ACK. The same problem exists when the far end disconnects the call; the BYE is sent by Kamailio over UDP so browserphone doesn't know the call is disconnected

We're running 3.12 so this may be fixed in a later version.

Blake

unread,
Dec 1, 2014, 11:43:26 AM12/1/14
to 2600h...@googlegroups.com
Is this using Firefox? I Just updated the repo to use SIP.js 0.6.4 which may address those issues.  Try it out and let me know...

Blake

unread,
Mar 23, 2015, 10:05:51 PM3/23/15
to 2600h...@googlegroups.com
I think I found the problem.  Registrations over wss had "transport=wss" in the registration.  RCF 7118 says it should be "ws".  I submitted a pull request to kazoo-configs with a fix.  There is probably a more elegant solution, but this seems to fix it.


Refs:
Message has been deleted

Darren Schreiber

unread,
Mar 23, 2015, 10:06:53 PM3/23/15
to 2600h...@googlegroups.com
I believe using WS:// is deprecated in Chrome and maybe others and you are required to use WSS. 

From: Blake <blakem...@gmail.com>
Reply-To: "2600h...@googlegroups.com" <2600h...@googlegroups.com>
Date: Monday, March 23, 2015 at 6:59 PM
To: "2600h...@googlegroups.com" <2600h...@googlegroups.com>
Subject: Re: ctxSip - Web SIP Client

I think I found the problem.  Phones registered over wss had "transport=wss" on the registration.  RFC 7118 says it should be "ws".  I created a pull request to kazoo-configs with a fix.


I am way outside my lane here, can anyone test it out and see if it breaks anything?

Blake McSwain

unread,
Mar 23, 2015, 10:22:44 PM3/23/15
to 2600h...@googlegroups.com
I think your right on that, and that is the problem being addressed.

There is a problem with websocket registrations made over WSS,  Kamailio had wss as the transport on the contact.  Registrations worked fine.  Outbound worked, but inbound Invites were coming in via UDP instead of over the websocket.  

My small patch changes the registration to show as "ws" on the contact transport, even if it was made over wss.  Fixed the problem in my case.

I am admittedly outside my lane with kamailio, but I am learning.  Is this the right approach?

--
You received this message because you are subscribed to a topic in the Google Groups "2600hz-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/2600hz-dev/r0KgyxzRl8g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 2600hz-dev+...@googlegroups.com.

Darren Schreiber

unread,
Mar 23, 2015, 10:23:36 PM3/23/15
to 2600h...@googlegroups.com
Weird. Ok we will try to find some time to look

Blake McSwain

unread,
Mar 23, 2015, 10:31:01 PM3/23/15
to 2600h...@googlegroups.com
It is.  I have been looking for that one for a while.  

Thanks for checking on it.

Blake

unread,
Mar 24, 2015, 5:33:50 PM3/24/15
to 2600h...@googlegroups.com
Pull request was merged is working for me.  Big thanks to lazedo and k-anderson.

Fixed in : kazoo-configs-3.19-16.el6.noarch.rpm 

Vitalicus

unread,
Apr 20, 2015, 9:20:45 PM4/20/15
to 2600h...@googlegroups.com
21.04.2015 .... Script is not working. Demo error 404.
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

SH

unread,
Aug 13, 2015, 5:15:57 PM8/13/15
to 2600hz-dev
Hi

I wan to use this web based sip phone but need some changes

so do you offer any paid customization support?


On Wednesday, 10 September 2014 02:43:23 UTC+5:30, Blake wrote:
I wrote an open source web sip client.  It is based on SIP.js and I have it working on my Kazoo installation.  It is designed to be a component in a larger web application.

I just posted it on GitHub and it is open source (MIT license).

Project:
https://github.com/collecttix/ctxSip

Demo:

Features:
  • Audio only (SIP.js is video capable, but I don't need it.  It should be trivial to implement.)
  • Hold / Resume, Mute, multiple call support.
  • No plugins required, Works with WebSocket / WebRTC enabled browsers. (Firefox & Chrome, for now Safari 8 when it is released.)
  • Intuitive interface
  • Call log is saved to localStorage.
  • Easy to configure and integrate into your project. (jQuery, Bootstrap)
I am am sure it is rough around the edges.  I would love some input.  Pull requests welcome.

Darren Schreiber

unread,
Aug 13, 2015, 5:17:19 PM8/13/15
to 2600h...@googlegroups.com
Please email people directly for support of this nature, or contact 2600hz’s support team

From: <2600h...@googlegroups.com> on behalf of SH <sumith...@gmail.com>
Reply-To: "2600h...@googlegroups.com" <2600h...@googlegroups.com>
Date: Thursday, August 13, 2015 at 2:14 PM
To: 2600hz-dev <2600h...@googlegroups.com>
Subject: Re: ctxSip - Web SIP Client

--

sumit hembrom

unread,
Aug 13, 2015, 5:20:33 PM8/13/15
to 2600h...@googlegroups.com
Hi

thanks for your kind response

is there any mail address to direct contact to main developer of this webphone?

Thanks

--
You received this message because you are subscribed to a topic in the Google Groups "2600hz-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/2600hz-dev/r0KgyxzRl8g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to 2600hz-dev+...@googlegroups.com.

Darren Schreiber

unread,
Aug 13, 2015, 5:22:45 PM8/13/15
to 2600h...@googlegroups.com
On Google Groups it should let you click the thread and show the email address I believe.

From: <2600h...@googlegroups.com> on behalf of sumit hembrom <sumith...@gmail.com>
Reply-To: "2600h...@googlegroups.com" <2600h...@googlegroups.com>
Date: Thursday, August 13, 2015 at 2:19 PM
To: "2600h...@googlegroups.com" <2600h...@googlegroups.com>
Subject: Re: ctxSip - Web SIP Client

You received this message because you are subscribed to the Google Groups "2600hz-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 2600hz-dev+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages