====== Call Support button ====== You can easily create one click buttons on your website that allows customers to contact your support center. You need only a few lines of code: **ringAudio** is an audio object used to play a ringback signal to the user so that she can hear her call is being made. **suppbtn** is the support button that you can place on your website. Usually a button like this: {{:ixnx:wrtc:js:callsupport.gif}} **hangup** is the hang up button that appears once customer has called support, so that she can hang up the call after it is finished. Usually a button like this: {{:ixnx:wrtc:js:hangup.png?32}} **[[ixnx:wrtc:js:api:wrtc:init|wrtc.init]]** is an obligatory initialization function for webrtc that you can use for initializations. In this simple example just the app name is set. **[[ixnx:wrtc:js:api:wrtc:onconnecting|wrtc.onConnecting]]** is called once user has clicked on the Call Support button. We use this function to display the hangup button. **[[ixnx:wrtc:js:api:wrtc:ondenied|wrtc.onDenied]]**, **[[ixnx:wrtc:js:api:wrtc:onhungup|wrtc.onHungUp]]** and **[[ixnx:wrtc:js:api:wrtc:ongothungup|wrtc.onGotHungUp]]** are three different ways the call can end: either support denies to answer the call, or the call is made and after it finishes either the customer or the support center hangs up. In all three cases the hung up button should be hidden again. **[[ixnx:wrtc:js:api:wrtc:onringing|wrtc.onRinging]]** is called once customer has clicked on the Call Support button and the phone starts ringing at the support center. It is good to have an audio feedback of the remote ring signal so the customer knows her call has made it to the support center and (hopefully) someone will pick it up soon. **[[ixnx:wrtc:js:api:wrtc:call|wrtc.call]]** is the main function that makes the actual call once customer clicks on the Call Support button. You must replace "support@company.com" with your own support's SIP address. **[[ixnx:wrtc:js:api:wrtc:hangup|wrtc.hangup]]** is the function used to end a call. If you want an extremely basic implementation then you only need wrtc.init and wrtc.call. The rest of the code is there only to give the customer a better experience with a ring tone and a hang up button. ===== See Also ===== [[ixnx:wrtc:js:tutorial:start|wrtc_kit Javascript tutorial]]