cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
Please note that Remote Expert Mobile announced end-of-life and support will end on February 28, 2022.
290
Views
1
Helpful
3
Replies
Highlighted
Beginner

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,

Klaas.

Everyone's tags (4)
3 REPLIES 3
Cisco Employee

Re: JabberSDK Ready when first opening webpage

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');

...etc...

Cisco Employee

Re: JabberSDK Ready when first opening webpage

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

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

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

    ready: function(defaults) {

          $('#remotevideocontainer').cwic('createVideoWindow',{

              id: 'videoobject',

              success: function(pluginid) {

                  //Video object has correctly loaded

              }

          });

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

              user: 'labuser1',

              cucm: 'ds-ucm105.cisco.com',

              password: 'password',

              success: function() {

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

              }

          });

    },

    serviceDiscovery: false

  })

...

Beginner

Re: JabberSDK Ready when first opening webpage

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,

Klaas.

CreatePlease to create content
Content for Community-Ad
FusionCharts will render here
This widget could not be displayed.