Skip to content

Javascript library to build a web-broswer softphone (WebRTC and SIP)

License

Notifications You must be signed in to change notification settings

mahfuz786/libwebphone

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dist/libwebphone.js library v0.2.0

The goal of this library is to turn the browser in a softphone based on SIP+WebRTC

  1. Initialization of the Library
  2. Methods
  3. Contact

Initialization of the Library

Get the libarary fro dist/libwebphone.js

  1. First of all you need to include the JavaScript in the browser. In order to do so, you need to add the following snippet in your HTML.
<script type="text/javascript"> var phone = new libwebphone(); </script>
  1. Next need to set the parameter to start connect kazoo platform in below function "StartStack"
<script type="text/javascript"> function StartStack() { phone.StartAgenStack ( [Displayname], [DisplayPhoneNumber], [sip:[userid]@vbbZ65Q.sb.2600hz.com, [passowrd]document.getElementById("txtpassword").value, "vbbZ65Q.sb.2600hz.com", "wss://sandbox.2600hz.com:5065/", "[{url:'stun:stun.l.google.com:19302'}]", "udp://vbbZ65Q.sb.2600hz.com", [html_buttonid_for_login], [html_buttonid_for_logout], [html_labelid_for_connectionstatus], [html_labelid_for_callstatus], [html_buttonid_for audio mute/unumte], [html_buttonid_for_par/unpark call], [html_video_buttonid_for_localvideo], [html_video_buttonid_for_remotevideo], [html_audio_for_remote_audio], [html_inputid_for_numbertocall], ); </script>

}

Methods The phone object has below accessible methods:

StartStack() :: Connect to Kazoo platform with credential and other paramaters phone.Disconnect() :: Logout and disconnect from kazoo platform phone.CallAudioOnly([Number to dial]) :: Audio call generation phone.MuteUnMuteCallAudio() :: Mute / UnMute audio call phone.HoldResumCall() :: park / Unpark audio call phone.HangUpCall() :: Hang up ongoing call phone.CallTransfer([Number to transfer]) :: Call transfer phone.CallAudioVideoBoth([Number to dial]) :: Audio and Video call generation phone.MuteUnMuteCallVideo() :: Stop / Sahring video local video stream

Using this, you should now be able to create some cool applications using softphones in your browser!You can use the kazoopjone example project where the libwebphone.js is used

Contact

If you have any question or remark about the library or its documentation, feel free to come talk to us on IRC #2600hz on FreeNode.

About

Javascript library to build a web-broswer softphone (WebRTC and SIP)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 97.8%
  • Rich Text Format 1.2%
  • Other 1.0%