×

Warning message

  • Cisco Support Forums is in Read Only mode while the site is being migrated.
  • Cisco Support Forums is in Read Only mode while the site is being migrated.
Wayne DeNardi Mon, 03/24/2014 - 18:10
User Badges:
  • Green, 3000 points or more
  • Cisco Designated VIP,

    2017 TelePresence

I haven't done if via a Python script, but I have done some scripts over ssh before from a DOS command line using the PuTTY PLINK.EXE.  You can also use telnet, a serial connection or HTTP/HTTPS to pass the commands to the codec.

The commands (and connection methods) are all documented in the API Reference Guide.

Wayne
--
Please remember to rate responses and to mark your question as answered if appropriate.

Michael Tue, 03/25/2014 - 07:54
User Badges:

Thank you for your response, but I the limitations that I am under require me to use Python for this.

The funny thing is that I do this via Python for other equipment, but it just does not seem to work with the CISCO endpoints for whatever reason.  I figure that there must be something different about the process when CISCO is involved...but I don't know what it is.

Wayne DeNardi Tue, 03/25/2014 - 17:49
User Badges:
  • Green, 3000 points or more
  • Cisco Designated VIP,

    2017 TelePresence

There really isn't any difference on the Cisco SX20 endpoints than any other equipment (they're effectively just a Linux device).

Have you checked that ssh is enabled on the SX20?

Are you using the correct username and password?

Can you manually ssh to the codec from the box you are trying to connect to via Python (or are there network connectivity issues)?

Are you able to try telnet rather than ssh?  (as a test).

Wayne
--
Please remember to rate responses and to mark your question as answered if appropriate.

Gabe Flores Tue, 11/04/2014 - 04:20
User Badges:

Maybe I am a little late to this party here but I have something that can help you out. I was searching myself to find a way to get this to be easier to manage and found this method.

 

#!/usr/bin/env python

import pxssh
import getpass
try:
    s = pxssh.pxssh(timeout=1, maxread=2000000)
    s.force_password = True
    hostname = raw_input('hostname: ')
    username = raw_input('username: ')
    password = getpass.getpass('password: ')
    s.PROMPT= 'SSH> '
    s.login (hostname, username, password, auto_prompt_reset=False)
    s.prompt()
    s.sendline('xConfiguration Conference 1 AutoAnswer Mode: On')
    s.prompt()
    s.sendline('xConfiguration Conference 1 DefaultCall Rate: 2000')
    s.prompt()
    data = s.before
    print data
    s.sendline('bye')
except pxssh.ExceptionPxssh, e:
    print "pxssh failed on login."
    print str(e)

 

You can modify the "xConfiguration" part to your liking. You can probably even make it a variable. I have before but figured you probably at least understand the basics of python and could figure it out.

 

Goodluck!

Gabe

Actions

This Discussion