Cisco C Series IP Control
I am getting ready to control a CISCO C40 codec via IP. Another programmer said that there is a special hex string I need to send in order to authenticate to the codec but he couldn't recall what they were.
Has anyone ever heard of this? I certainly haven't and neither has google as far as I can find.
Kenny
Has anyone ever heard of this? I certainly haven't and neither has google as far as I can find.
Kenny
0
Comments
You'll just have to decide what kind of session you want to use (Telnet or SSH) and make sure it's enabled on the codec.
Although, I have all my C90s connected via RS-232. I do use Telnet to run/test commands on my C90 from my computer though.
Depending on how in depth your control is going to be, you may want to use serial instead of IP. Each time you connect to the codec (with IP), it is a new session and you'll have to re-register your feedback, etc...
Good luck!
Good point.
I guess I've not had to send/receive strings from a telnet port yet.
Can you post the code when you have a moment? I'm curious to look at it.
Thanks.
Here's the code... basically, it's searching what the Tesira sends back for the specific challenge, then sending specific response strings back, to tell the Tesira basic information, supposedly about how the client handles certain Telnet codes and functions:
while( find_string(rm[2].d[20].buffin, "$FF,$FD,$18, $FF,$FD,$20, $FF,$FD,$23, $FF,$FD,$27, $FF,$FD,$24", 1) ) { rm[2].d[20].buffin = "''" ///clear buffer rm[2].a[1].init = 1 ///Set "Init" response block call 'debug' ("'Sending Tesira Connection Challenge Response 1:',$FF,$FC,$18, $FF,$FC,$20, $FF,$FC,$23, $FF,$FC,$27, $FF,$FC,$24") send_string rm[2].d[20].ipcomm[1].devid, "$FF,$FC,$18, $FF,$FC,$20, $FF,$FC,$23, $FF,$FC,$27, $FF,$FC,$24" } while(find_string( rm[2].d[20].buffin,"$FF,$FB,$03, $FF,$FD,$01, $FF,$FD,'"', $FF,$FD,$1F, $FF,$FB,$05, $FF,$FD,'!'",1 ) ) { rm[2].d[20].buffin = "''" ///clear buffer rm[2].a[1].init = 1 ///Set "Init" response block call 'debug' ("'Sending Tesira Connection Challenge Response 2:', $FF,$FE,$03, $FF,$FC,$01, $FF,$FC,'"', $FF,$FC,$1F, $FF,$FE,$05, $FF,$FC,'!'") send_string rm[2].d[20].ipcomm[1].devid, "$FF,$FE,$03, $FF,$FC,$01, $FF,$FC,'"', $FF,$FC,$1F, $FF,$FE,$05, $FF,$FC,'!'" } while(find_string( rm[2].d[20].buffin,"'Welcome to the Tesira Text Protocol Server...',$0D,$0A",1 ) ) { rm[2].d[20].buffin = "''" ///clear buffer rm[2].a[1].init = 1 ///Set "Init" response block call 'debug' ("'Subscribe to Services...'") // send_string rm[2].d[20].ipcomm[1].devid, "$0D,$0A" //subscribe to something ... rm[2].d[20].buffout = "rm[2].d[20].buffout,'LogicMeter1 subscribe state 1 "2 01 MicButton"', $0A" rm[2].d[20].buffout = "rm[2].d[20].buffout,'LogicMeter1 subscribe state 2 "2 02 MicButton"', $0A" .... (there's a bunch more subscription requests here) .... rm[2].d[20].buffout = "rm[2].d[20].buffout,'DEVICE get serialNumber', $0A"Then elsewhere in response parsing code, I have it looking for the device serial number, and clearing the INIT flag (which suppresses the code from thinking a subscribe response is actually a state change from the logicmeters)
ACTIVE( ( find_string( this_data, "'02292255'", 1 )> 0 || find_string( this_data, "'02292302'", 1 ) > 0 ) && rm[this_rm].a[1].init == 1 ): { //Room Init COMPLETE! call 'debug' ("'Room Init Complete:',itoa(this_rm),' DID:',itoa(this_did),' This SN:',this_data") rm[this_rm].a[1].init = 0 }Hope that helps!Do you know if the hex strings are universal for Telnet comm?
I wouldn't think they would be device specific.
I just looked at the Cisco API Reference Guide (TC 7.1) and I didn't find any reference to initiating a telnet session (yet there is info on connecting via telnet and registering feedback and such).
Yet another review of TELNET During the connection, enhanced characteristics other than those offered by the NVT may be negotiated either by the user or the application. This task is accomplished by embedded commands in the data stream. TELNET command codes are one or more octets in length and are preceded by an interpret as command (IAC) character, which is an octet with each bit set equal to one (FF hex). The following are the TELNET command codes: Commands Code No. Description Dec Hex ---------------------------------------------------------------- data All terminal input/output data. End subNeg 240 FO End of option subnegotiation command. No Operation 241 F1 No operation command. Data Mark 242 F2 End of urgent data stream. Break 243 F3 Operator pressed the Break key or the Attention key. Int process 244 F4 Interrupt current process. Abort output 245 F5 Cancel output from current process. You there? 246 F6 Request acknowledgment. Erase char 247 F7 Request that operator erase the previous character. Erase line 248 F8 Request that operator erase the previous line. Go ahead! 249 F9 End of input for half-duplex connections. SubNegotiate 250 FA Begin option subnegotiation. Will Use 251 FB Agreement to use the specified option. Won’t Use 252 FC Reject the proposed option. Start use 253 FD Request to start using specified option. Stop Use 254 FE Demand to stop using specified option. IAC 255 FF Interpret as command. Each negotiable option has an ID, which immediately follows the command for option negotiation, that is, IAC: command, option code. Following is a list of TELNET option codes: Option ID Option Codes Description Dec Hex ------------------------------------------------------------------- 0 0 Binary Xmit Allows transmission of binary data. 1 1 Echo Data Causes server to echo back all keystrokes. 2 2 Reconnect Reconnects to another TELNET host. 3 3 Suppress GA Disables Go Ahead! command. 4 4 Message Sz Conveys approximate message size. 5 5 Opt Status Lists status of options. 6 6 Timing Mark Marks a data stream position for reference. 7 7 R/C XmtEcho Allows remote control of terminal printers. 8 8 Line Width Sets output line width. 9 9 Page Length Sets page length in lines. 10 A CR Use Determines handling of carriage returns. 11 B Horiz Tabs Sets horizontal tabs. 12 C Hor Tab Use Determines handling of horizontal tabs. 13 D FF Use Determines handling of form feeds. 14 E Vert Tabs Sets vertical tabs. 15 F Ver Tab Use Determines handling of vertical tabs. 16 10 Lf Use Determines handling of line feeds. 17 11 Ext ASCII Defines extended ASCII characters. 18 12 Logout Allows for forced log-off. 19 13 Byte Macro Defines byte macros. 20 14 Data Term Allows subcommands for Data Entry to be sent. 21 15 SUPDUP Allows use of SUPDUP display protocol. 22 16 SUPDUP Outp Allows sending of SUPDUP output. 23 17 Send Locate Allows terminal location to be sent. 24 18 Term Type Allows exchange of terminal type information. 25 19 End Record Allows use of the End of record code (0xEF). 26 1A TACACS ID User ID exchange used to avoid more than 1 log-in. 27 1B Output Mark Allows banner markings to be sent on output. 28 1C Term Loc# A numeric ID used to identify terminals. 29 1D 3270 Regime Allows emulation of 3270 family terminals. 30 1E X.3 PAD Allows use of X.3 protocol emulation. 31 1F Window Size Conveys window size for emulation screen. 32 20 Term Speed Conveys baud rate information. 33 21 Remote Flow Provides flow control (XON, XOFF). 34 22 Linemode Provides linemode bulk character transactions. 255 FF Extended options list Extended options list.It makes sense that the two devices need to understand each other's capabilities.
Yes, that's exactly what is going on with those initialization strings. Thanks for the follow-up on that!