<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Change LineDN via JabberSDK</title>
  <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_thread?p_l_id=&amp;threadId=8942675" />
  <subtitle>Change LineDN via JabberSDK</subtitle>
  <id>http://developer.cisco.com/c/message_boards/find_thread?p_l_id=&amp;threadId=8942675</id>
  <updated>2013-06-19T02:47:57Z</updated>
  <dc:date>2013-06-19T02:47:57Z</dc:date>
  <entry>
    <title>RE: Change LineDN via JabberSDK</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=9284974" />
    <author>
      <name>Simon Egli</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=9284974</id>
    <updated>2012-12-12T07:02:02Z</updated>
    <published>2012-12-12T07:02:02Z</published>
    <summary type="html">Hi Shawn

Thanks for your quick help. Your sample above works well.
 
Best regards,
Simon</summary>
    <dc:creator>Simon Egli</dc:creator>
    <dc:date>2012-12-12T07:02:02Z</dc:date>
  </entry>
  <entry>
    <title>RE: Change LineDN via JabberSDK</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=9275398" />
    <author>
      <name>Shawn O&amp;#039;Rourke</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=9275398</id>
    <updated>2012-12-11T21:13:32Z</updated>
    <published>2012-12-11T21:13:32Z</published>
    <summary type="html">The third argument to devicesAvailable is a callback function.  The callback function is defined in the API, but it is up to you to call it in your devicesAvailable function.  The callback function takes three arguments: the phone mode, the device, and the line.  To use a line other than the first line on the phone, you must pass the line you want to use to the callback function.  Here is an example:

$('#registerPhone').click(function() {
    var line = 6002;
    $('#phone').cwic('registerPhone', {
        cucm: $('#cucm').val(),     
        user: $('#userName').val(),
        password: $('#password').val(),
        mode: 'DeskPhone',
        line: line,
        success: function(registration) {
            // Action to perform on successful registration...
        },
        devicesAvailable: function(devices, phoneMode, callback) {
            // Determine which device to use.  We're just going to use 
            // the first one in the array.

            // Pass the line into the callback
            callback(phoneMode, devices[0], line);
        }
    });
});
 
This is another area where we need to improve the documentation.
 </summary>
    <dc:creator>Shawn O&amp;#039;Rourke</dc:creator>
    <dc:date>2012-12-11T21:13:32Z</dc:date>
  </entry>
  <entry>
    <title>RE: Change LineDN via JabberSDK</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=9261245" />
    <author>
      <name>Simon Egli</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=9261245</id>
    <updated>2012-12-11T14:03:36Z</updated>
    <published>2012-12-11T14:03:36Z</published>
    <summary type="html">Hi Shawn
May I ask for your help again?
As written this morning, I was able to change the line by calling switchPhoneMode.
But I cannot pass the device and the line to the registerPhone function. That means, I can pass them without script errors, but the line is always the first one once the phone is registered.
I am trying to do this because once the user changed the line (with switchPhoneMode) and reloads the page, the phone gets registered with the first line again. And this is not really handy.
I pass the following arguments to the registerPhone function:
var arguments = {
            user: "TestUserA",
            device: "SEPXXXXXXXXXXX",
            line: "7225",
            cucm: {
                ccmcip: "URL",
                tftp: "URL"
            },
            authenticate: true,
            mode: 'DeskPhone',
            devicesAvailable: function (devices, phoneMode, callback, automatic) {
               
            },
            success: function (registration, a, b, c) {
               
            },
            error: function (error) {
                
            }
        };
}

What am I doing wrong?
Thanks for your help in advance.
Best regards,
Simon</summary>
    <dc:creator>Simon Egli</dc:creator>
    <dc:date>2012-12-11T14:03:36Z</dc:date>
  </entry>
  <entry>
    <title>RE: Change LineDN via JabberSDK</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=9252749" />
    <author>
      <name>Simon Egli</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=9252749</id>
    <updated>2012-12-11T07:41:14Z</updated>
    <published>2012-12-11T07:41:14Z</published>
    <summary type="html">Hi Shawn

Thanks for your reply.
I was able to change the line once I explicitly added the mode.
Thanks for your help!

Best regards,
Simon
 
 </summary>
    <dc:creator>Simon Egli</dc:creator>
    <dc:date>2012-12-11T07:41:14Z</dc:date>
  </entry>
  <entry>
    <title>RE: Change LineDN via JabberSDK</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=9240625" />
    <author>
      <name>Shawn O&amp;#039;Rourke</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=9240625</id>
    <updated>2012-12-10T21:16:08Z</updated>
    <published>2012-12-10T21:16:08Z</published>
    <summary type="html">The error "eLineMustNotBeConfigured" can occur when the mode passed in to switchPhoneMode() is not explicitly set to DeskPhone.  The default is SoftPhone and you can not specify a line when the mode is SoftPhone.  Set the property mode to DeskPhone you call SwitchPhoneMode, like in the example below:

$('#phone').cwic('switchPhoneMode', {
    device: device,
    line: line,
    mode: 'DeskPhone',
    success: function(registration) {
        alert("Now using line: " + registration.line.directoryNumber);
    }
});

If this does not work for you, please send us the JavaScript code where you are calling switchPhoneMode, and send your softphone.log file to: jabbersdk-support@cisco.com, so we can investigate further.

As you pointed out, the correct function name is switchPhoneMode, not switchMode.  We have noted the error you found in the documentation, and we will update it.
 </summary>
    <dc:creator>Shawn O&amp;#039;Rourke</dc:creator>
    <dc:date>2012-12-10T21:16:08Z</dc:date>
  </entry>
  <entry>
    <title>RE: Change LineDN via JabberSDK</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=9185107" />
    <author>
      <name>Shawn O&amp;#039;Rourke</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=9185107</id>
    <updated>2012-12-08T00:24:13Z</updated>
    <published>2012-12-08T00:24:13Z</published>
    <summary type="html">Hi Simon, we are still looking into your question.  We'll update this thread as soon as we have more information.</summary>
    <dc:creator>Shawn O&amp;#039;Rourke</dc:creator>
    <dc:date>2012-12-08T00:24:13Z</dc:date>
  </entry>
  <entry>
    <title>RE: Change LineDN via JabberSDK</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=8961225" />
    <author>
      <name>Ting-Hao Chen</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=8961225</id>
    <updated>2012-11-30T20:40:49Z</updated>
    <published>2012-11-30T20:40:49Z</published>
    <summary type="html">Simon,
I will do some research on this.
Howard</summary>
    <dc:creator>Ting-Hao Chen</dc:creator>
    <dc:date>2012-11-30T20:40:49Z</dc:date>
  </entry>
  <entry>
    <title>Change LineDN via JabberSDK</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=8942674" />
    <author>
      <name>Simon Egli</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=8942674</id>
    <updated>2012-11-30T08:37:41Z</updated>
    <published>2012-11-30T08:37:32Z</published>
    <summary type="html">Hi all,
Today, I came across an issue while trying to change the phone line via the Jabber SDK.
I've configured two lines on a 7942 deskphone. But I'm only able to use the first / default line.
As written in the document “Cisco Web Communicator SDK JavaScript API” ([url=http://developer.cisco.com/documents/4554576/c849c124-a064-4e01-88e4-b108f8a0cb49]http://developer.cisco.com/documents/4554576/c849c124-a064-4e01-88e4-b108f8a0cb49[/url])
I used the function switchMode(settings).
Unfortunately I realized that this function is not included in the cwic.js
plugin. Therefore I used the function switchPhoneMode(options). This function
calls the Cisco Web Communicator Plugin with the necessary parameters written
in the documentation.
 
So I passed a new line (which is correctly configured for the Deskphone in CUCM).
The result was an error saying ”eLineMustNotBeConfigured“. 
Here is the dump from the softphone log:
 
29-Nov-2012
16:01:16,153 +0100 INFO  [0x000014e0] csf.ecc.evt:
CALL_CONTROL_MODE_CHANGE: eNoMode, preferredDeviceName = , preferredLineDN = 
29-Nov-2012
16:01:16,153 +0100 INFO  [0x000014e0] csf.ecc.evt:
CONNECTION_STATUS_CHANGE: eIdle
29-Nov-2012
16:01:16,153 +0100 INFO  [0x000014e0] webuc: Received Connection Change
Event: eIdle
29-Nov-2012 16:01:16,153 +0100 INFO 
[0x000014e0] csf.ecc: &lt;---
29-Nov-2012
16:01:16,153 +0100 INFO  [0x000014e0] csf.ecc: selected device
'SEP002155D4CF83'
29-Nov-2012
16:01:16,154 +0100 ERROR [0x000014e0] csf.ecc: doConnect() failed -
PreferredLineDN must be blank! : eLineMustNotBeConfigured
29-Nov-2012 16:01:16,154 +0100 INFO 
[0x000014e0] csf.ecc: ---&gt;
29-Nov-2012 16:01:16,154 +0100 INFO 
[0x000014e0] csf.ecc: &lt;---
29-Nov-2012
16:01:16,154 +0100 INFO  [0x000014e0] webuc: SwitchMode returned. Code:
eLineMustNotBeConfigured
 
So I did another test and passed the line I wanted to change to with the parameter
PreferredLineDN.
This one gave me the error “eTftpFileInvalid”.
 
The
softphone log said:
29-Nov-2012
17:48:15,431 +0100 ERROR [0x000010c4] csf.ecc: libXML2 msg: "Namespace
prefix xsi for type on device is not defined"
29-Nov-2012
17:48:15,432 +0100 WARN  [0x000010c4] csf.ecc: PhoneConfig::parse(), no
start/stop media port values found, using defaults of 16384 - 32768
29-Nov-2012
17:48:15,432 +0100 WARN  [0x000010c4] csf.ecc: PhoneConfig::parse(), no
sipProfile/dscpForAudio value found, using default of 0
29-Nov-2012
17:48:15,432 +0100 WARN  [0x000010c4] csf.ecc: PhoneConfig::parse(), no
sipProfile/dscpVideo value found, using default of 0
29-Nov-2012
17:48:15,432 +0100 WARN  [0x000010c4] csf.ecc: PhoneConfig::parse(), no
sipProfile/enableVad value found, using default of false
29-Nov-2012
17:48:15,432 +0100 WARN  [0x000010c4] csf.ecc: PhoneConfig::parse(), no
sipProfile/dtmfAvtPayload value found, using default of 101
29-Nov-2012
17:48:15,432 +0100 ERROR [0x000010c4] csf.ecc: insecureRetrieveConfig() file
tftp://labccm60.lab.lan/SEP002155D4CF83.cnf.xml could not be parsed
29-Nov-2012
17:48:15,432 +0100 ERROR [0x000010c4] csf.ecc.api: fetchDeviceConfig() could
not obtain config for SEP002155D4CF83
29-Nov-2012
17:48:15,432 +0100 ERROR [0x000010c4] csf.ecc: doConnect() failed - failed to
fetch device config for SEP002155D4CF83!
29-Nov-2012
17:48:15,432 +0100 ERROR [0x000010c4] csf.ecc: doConnect() returnCode :
eTftpFileInvalid
29-Nov-2012
17:48:15,432 +0100 INFO  [0x000010c4] csf.ecc.evt:
CONNECTION_STATUS_CHANGE: eIdle
29-Nov-2012
17:48:15,432 +0100 INFO  [0x000010c4] webuc: Received Connection Change
Event: eIdle
29-Nov-2012
17:48:15,432 +0100 INFO  [0x000010c4] csf.ecc: ---&gt;
29-Nov-2012
17:48:15,432 +0100 INFO  [0x000010c4] csf.ecc: &lt;---
29-Nov-2012
17:48:15,432 +0100 INFO  [0x000010c4] webuc: SwitchMode returned. Code:
eTftpFileInvalid
 
May I ask
you to help me with this one? 
Thanks in advance.
Simon</summary>
    <dc:creator>Simon Egli</dc:creator>
    <dc:date>2012-11-30T08:37:32Z</dc:date>
  </entry>
</feed>

