Showing results for 
Search instead for 
Did you mean: 

JabberSDK Ready when first opening webpage


Hi Guys,

For demo purpose, we would like to include the discovery start and sign-in procedure (for specific credentials embedded in the js code) when the web page is first loaded. So, after the page is loaded, no additional clicks are needed and the user can dial immediately. It is clear to us that from a security point of view this is a very bad idea but this will be addressed later. We have Plugin V. 11.0.1 & CUCM 11.0 MR1

Using Discovery Start and entering the passphrase manually everything is working fine.

Could you please indicate which method we should use and where in the js or can we add a file with the credentials?

We Thank You in advance for any suggestions.

Best Regards,


3 Replies 3

Cisco Employee
Cisco Employee

I'm not sure I understand the question, but I'm guessing what you're looking for is in js/sample.js. 

Perhaps you want to modify this function to hard code the credentials?

function handleCredentialsRequired(setCredentials, cachedUser) {

  var $submitCredentialsBtn = $('#sdCredentialsSubmit'),

  $status = $('#sdCredReqStatus'),

  $username = $('#sdUsername'),

  $passphrase = $('#sdPassphrase');


A somewhat different take than Nick's, but this may help get you started:

$(document.body).ready(function() {

  $('#container').cwic('init', {

    ready: function(defaults) {


              id: 'videoobject',

              success: function(pluginid) {

                  //Video object has correctly loaded



          $(this).cwic('registerPhone', {

              user: 'labuser1',

              cucm: '',

              password: 'password',

              success: function() {

                  $('#callbtn').attr('disabled', false);




    serviceDiscovery: false



Thanks Nicholas & dstaudt for your quick responses,

However, with the proposed solution of Nicolas i still have to click the "Submit" & "Connect" bottoms before i can use the phone. The proposed solution of dstaudt is likely closer what we are looking for but after a lot of intents and variations i could still not get it to signin automatically after opening the initial "sample.html" page.

And Yes, we are using the original "sample.html" & "sample.js" files included in the "JabberSDK".

Also i forgot to mention that i am a newbee to javascripts, although i have some C++ experience.

The biggest issue with the code example of dstaudt is that we do not recognize or know where exactly to paste it in or

modifying it beginning at "$(document).ready(function() {" and only changing the credentials or leave the code exactly as proposed, will leave the page "dead" and not presenting any output in the "F12" console log of the browser.

When we use the original sample.js script and click on "Start Discovery" the user is already presented in the "user" input field and we only have to type in the passphrase,

meaning that the browser cached the location of the CUCM. after that we still have to press the "Connect" bottom to be able to use the phone which we would also like to be automated when opening the sample.html page initially.

Any further elaborated example code would be greatly appreciated.

Thanks in Advance,


Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Recognize Your Peers