CE SIP Messaging Channel for Remote Endpoint Control

Sending messages between endpoints over SIP seems so 2010. If you look at this feature on the surface it does seem limited. It is once you enable it with Macros or an xAPI application does it potential use become more apparent. "xCommand Call FarEndMessage Send" does not get a lot of coverage in discussions online , in fact I was unable to locate a single article even explaining its use but it is a very handy API command worthy of understanding. Here are some of the feature uses I was able to dream up but I am sure there are others:
  • Far end camera control, volume control, and mute control. Anything on the remote endpoint that can be controlled or set by xAPI commands.
  • Control far end external devices such as far end HDMI switch using macros with http commands. You could even adjust lights and blinds etc using this method if they are integrated with the remote codec.

Configuring SIP Messages

By now I am pretty sure most of you understand the theory behind a point to point call with a established call control platform like Communications Manager(CUCM). In my examples I am going to ignore the basics and focus on once the call once it is established. This configuration only works for point to point calls.



Once a call is established, if the endpoint is enabled it can send and receive custom SIP messages. Below is a great macro example of being able to control a camera via this method. If FECC natively works this is overkill but some 3rd party camera do have issues with native FECC control like the Sony SRG300HD.

I have not included the UI controls in the example. So you will have to build a Touch 10 UI that matches up with the valid input required by the macro. The important part of the example is the way in which the SIP message commands are used. The example macro is loaded on both endpoints of a p2p setup and allows both endpoints to control each others camera.


There are two ways to send the messages across the SIP channel using either a macro running on the local CE endpoint or from a application connecting to the local device utilizing  xAPI commands. I personally have done this using a Pi running nodejs sending commands to a Webex Room Kit to send commands to a SX80 to control the camera. The dependency is the remote end must have a macro/application to receive the messages and translate the messages into a action with xAPI.

Key commands for enabling SIP messaging:

Send: xapi.command('Call FarEndMessage Send', { Your command goes here})

Receive: xapi.event.on('FarEndMessage Receive', (event) => {
//Do something with your command })

Enable: xapi.config.set('Conference FarendMessage Mode', 'On')

Nothing to hard and with a lot of potential.

VoIPNorm

Upcoming Topics on VoIPNorm

Here are some upcoming topics I am working on for the blog. If you would like to see a discussion on other features and items please let me know in the comments below.
VoIPNorm

Part 4: Webex Board + Rasp Pi + BlyncLight = Final Project

Project Intro Recap

For a project that I thought would only take me a few hours it was way more intense that I first intended it to be. If your not familiar with the project, here is a quick diagram of what I was aiming to do.
Basically, if my Webex Board is on a call turn the Blynclight from green to red. Once the call is over turn it back to green. It seemed pretty simple and straightforward.

Step 1. Acquire BlyncLight(BL) + Pi + CE Room systems

This was the easy part. Buying the pieces from Amazon that I didn't already own. In my case it was just the Blynclight. I already had some unused Pi's and also a very well used Webex Board in my office. I purchased the wifi version of the BL. My thought was I would probably need this so I can locate the light outside my office in a highly visible place. 


Can't get more visible than this. This is the working BL fully installed.

Step 2. Build Code using Python not Nodejs

This is where the real adventure begins. Not knowing that the manufacture, Enbrava, has since changed the BL's command word, vendor id and product id in the latest hardware release, nothing already existing from a Nodejs point of view was going to work. While the vendor id and product id are easily obtainable the command word is not and had to come from the manufacturer. After several email exchanges with them I resided myself to, "Nodejs is not going to work". 

Embrava who make the BL only support the use of a Objective C SDK and they do not seem to be all that willing to release the details of the command word to control the light. Their last response to me was, "We understand your concerns and thats why I have told you that I will try to get the approval to share the device protocol to you." The bolding was in the email BTW. This was my queue to start looking elsewhere for answers. Could I have used their SDK? I suppose but it seemed like an extra layer of messing around that I didn't want.

Python to the Rescue

While my efforts to get somewhere with Embrava fell short I did manage to find a great Python library. While I have never coded in Python before (outside of "hello world") I thought what the hell, I got this.

The code I had to write for the project was pretty simple. The application is monitoring the call status of my Webex Board using a websocket to communicate and posting events on call status to change the light color. 


The code was the easiest part of the project besides going online to purchase the BL from Amazon. Once I got the hang of working with Lists and Dicts in Python the rest was just adding the logic for turning the light on and off. Easy. I was surprised at the lack of code I had to actually write, although this is not a complex coding project it still surprised me.

Python libraries used in the project:
  • Python library for connecting to a Cisco Collaboration Endpoint using a WebSocket https://github.com/cisco-ce/pyxows . Just be aware the example in the readme has some issues and does not work without some fixing and additional code. 
  • Python BlyncLight library https://pypi.org/project/blynclight/ . The reference to HIDAPI could be a little better but still the library functions great and without it I wouldn't been able to get anything working. I am not sure how he got the command word figured out but credit to him for getting it done.

Step 3. Prep Pi for Python 3.7 and Load Drivers

At one stage I almost considered throwing in the towel at this step. The BL project would be residing in the pile of junk I keep in my office. I call that pile "the to do pile". Thank heavens for people posting stuff on the Internet. It really saved the project and me the embarrassment of telling my wife I paid $85 for something I can't use or figure out.

The first issue, a pip ssl error that kept saying, "pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available".  This was especially annoying as everything I tried failed. I finally stumbled on the blog post below by Josh.

Second issue was reading the USB port on the Pi. It was just not working with the HIDAPI module. This was resolved with some help by a KB article on setting up the HIDAPI module with more clearly defined instructions. The README from the library on github is a little cryptic when it comes to the install instructions for Linux.

Referenced links:
 

Step 4. Stand back and Marvel at My Functional BlyncLight


Even Lord Vader approves.

Project Outcomes

The project was fun despite some struggles.Two things I got out of this is firstly I really enjoyed was writing blog posts again and secondly using Python in a real project. It's been fun doing the updates as I go. While it takes time to do its a nice way to record the project. If I ever have to I can retrace my own steps. While I may never do the BL project again at least it's here if I change my mind. 

I hate learning a new language or scripting and having to step through the whole "hello world" crap every time. Learning really accelerates when you do real world versus lab world. So doing a Python project that applied to real world, although limited to my office, was a lot of fun. It has me thinking about what else I can do with some more Python skills. 

BlyncLight Thoughts and Conclusions

Would I buy a Embrava Wifi Blynclight to put outside every conference room in a company, no. The wifi versions battery life is less than optimal, seems to be about a day. I didn't want to have to charge the thing almost daily. I was also not impressed by the response from their support people. To only have the one SDK and not provide the command word is not what I would have expected. 

The BL was what I considered expensive. Now, if you were buying hundreds of these sure it would be cheaper but the $85 I paid was way to much. So while this was fun to mess around with and there are pieces of the project to learn from, there are more than likely better lighting systems to integrate with than this. I am sure if you want some off the shelf light that works with Jabber, S4B etc. that sits on your cubicle wall this would be great but for this type of project, it's only average. I would also recommend the much cheaper Standard BlyncLight and just use a USB cable if you decide to do this project or something similar.

Hope you enjoyed the project. Let me know what you think in the comments. Comment if you did a project like this you enjoyed or not.

VoIPNorm

Part 3:

Part 3: Webex Board + Rasp Pi + BlyncLight = Pi Driver Nightmare

It's been a rough few days with sleepless nights and hair pulling as I navigate setting up Python 3.7 on a Raspberry Pi. After messing with several different methods of installing Python and PIP only to end up with a PIP SSL error I stumbled upon a blog post by Josh which actually worked. At a high level, you have to download and compile the Python and SSL libraries so that Python actually knows where to locate the SSL library. I didn't see the SSL issue with other versions of Python but this seemed to be a very common issue with 3.7. I tried a number of solutions and Josh's was the only one that worked.

After solving the SSL issue I started putting my project together only to find that HIDAPI Python library was having issues reading the USB device. Rebooting the Pi seemed to do the trick. The HIDAPI library relies on libusb-1.0 which is a C library that gives applications easy access to USB devices. Why this reboot was required to make it work I am not sure but I also looked at another  article which referenced other USB drivers along with HIDAPI that was helpful to understanding how to install the HIDAPI library on the Pi.

I think this section of the project has consumed the most time. Even more so than writing the code for the project itself. It seem to take forever to get the Pi setup to run the code. Not that I haven't run into similar issues with Pi and Nodejs reading USB devices but its still painful to deal with when it happens.

Later this week I will write up a full post on the project with code.

VoIPNorm

Previous posts:

Intro to project:
https://voipnorm.blogspot.com/2019/07/webex-board-rasp-pi-blynclight-no.html

Part 1:
https://voipnorm.blogspot.com/2019/07/part-1-webex-board-rasp-pi-blynclight.html

Part 2:
https://voipnorm.blogspot.com/2019/07/part-2-webex-board-rasp-pi-blynclight.html