cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
43950
Views
160
Helpful
100
Replies

CE9.2.1 Macro Framework discussions

Magnus Ohm
Cisco Employee
Cisco Employee

The new Macro Framework that came with CE9.2.1 allows you to create your own small "features" that runs natively on the codec. You can also create a user interface for your features by combining the In-Room Control feature with the Macro Framework!

 

Please share your ideas, questions, code and anything else related to the newly released Macro Framework. Happy coding!

 

PS: The Macro Framework is currently not supported on the SX10 (N)

 

Please visit the official DEVNET page for ROOM DEVICES. 

https://developer.cisco.com/site/roomdevices/

100 Replies 100

Hi,

 

Patrick has replied to the WebEx dial button. In regards to sending data to a remote location (survey) it is as Patrick says, not possible with macro code. But you don´t have to use macros for that.

 

You can trigger the survey using a macro but you can trigger a HttpFeedback based on the event from the survey. So, when the survey is filled in and the user clicks "Send" the output is printed in the xAPI, if your register a custom HttpFeedback on that particular event it will be sent to an external url in XML or JSON format.

 

Access the xAPI and type the following depending on the survey type:

#Event for Custom Text Input Prompt
xCommand HttpFeedback Register Expression: "event/userinterface/message/textinput/response" FeedbackSlot: 1 Format: JSON ServerUrl: http://REST.API

#Event for Custom Multiple Choice Question
xCommand HttpFeedback Register Expresssion: "event/userinterface/message/prompt/response" FeedbackSlot: 1 Format: JSON ServerUrl: http://REST.API

This registers a feedback event that will send the data remotely to the http://REST.API (your server) and that server must parse the event (collect the survey response and use it the way you intend).

 

Now you can utilize one of two survey forms: Free text input or multiple choice options:

xCommand UserInterface Message TextInput Display FeedbackId: 1 Placeholder: "Type your feedback here" SubmitText: "Send" Text: "Please let us know if you experienced any call quality issues" Title: "Call quality survey"

Or

xCommand UserInterface Message Prompt Display Option.1: "Very good!" Option.2: "Good" Option.3: "Neutral" Option.4: "Bad" Option.5: "Very bad!" Title: "Call quality survey" Text: "Please let us know what you think of the call quality"

When the user press send or one of the options it generates an event on one of the above httpfeedback expressions, and when that happens it is sent to the server URL in JSON format. The third party "data collector" is something you would have to create as a third party system.

But yes, definitely possible (currently not by using Macros only though :) ).

 

If you want to quickly test the output in the xAPI or see the transmitted data you can register a xfeedback on the same expression like this:

 

xFeedback Register event/userinterface/message/prompt/response
xFeedback Register event/userinterface/message/textinput/response

Enter a response and press send or press one of the options and now you see the event in the xAPI CLI

 

To see what is actually being sent before you have anything to catch it you first set HttpFeedback up to a valid IP address on HTTP, now you can start a pcap (from maintenance->system logs) and view the JOSN blob in the HTTP POST packet.

 

Hope this was helpful.

 

/Magnus

 

 

 

 

 

 

 

Magnus Ohm
Cisco Employee
Cisco Employee

Want to lay back and have Do Not Disturb set to enabled forever? There is a max 24 hour timeout on the Do Not Disturb feature. Someone asked me if we could work around it somehow to enable it longer than this. It is possible with the Macro Framework!

It is an example of how you can tweak the system to suite your needs even if its not a native feature.

 

The beauty is that you can do it your self (or have someone else do it) without waiting for a feature request to go through (or be rejected).

 

This macro has a GUI element with a switch to enable or disable the infinite state. A notification will tell you that it is enabled. When you want to be contacted again you can disable it, and its entirely up to you when you want to disable it :).

 

Please use it as a source of inspiration, learning or use it your self. Feel free to modify it the way you want.

 

Yuki Iwagishi
Cisco Employee
Cisco Employee

This is sample for changing RingTone on CE9.   I'd like to know my way to set spinner's text is correct or not. I noticed loading In-Room Control after running Macro, the text is empty until I tap some buttons.

 

And if we have a way to set ringtone list from "xcommand Audio SoundsAndAlerts Ringtone List" on Macro.

 

Richard Greig
Level 1
Level 1

Hi All,

 

 

Let me know your thoughts on the attached.

 

This is an attempt to address VC rooms where there is a projector as the main output, and a smaller display for monitor 2. Normally (with Cisco units) you are stuck with having the presentation on the smaller display when shared.

Randall White
Level 3
Level 3

Which Unicode characters does the widget text field support?
My DX70 Video Interpreter project does not display Armenian (U+053x thru U+058x)
Chinese, Korean, and Vietnamese all display OK.

 

image.png

 

Thanks, Randy

Hello,

 

I am not a programmer, nor do I have any clue as to how the macro scripting works, but I am trying to use the RoomReset example on the CE firmware, and I am unsure as to how to activate the macro.  I know the macro is turned on, but im not sure where the condition is set to room reset after a period of time.

 

/**
 * Listen to video endpoint's room reset event and do some
 * more clean-up than the default
 */
const xapi = require('xapi');

function resetRoomToDefault() {
  xapi.command('Audio Volume SetToDefault');
  xapi.command('RoomPreset Activate', { PresetId: '1' });
  xapi.command('CallHistory DeleteAll', { Filter: 'Received' });
  xapi.command('Selfview Set', { Mode: 'On', OnMonitorRole: 'First', PIPPosition: 'UpperRight' });
  xapi.command('xCommand Video Input SetMainVideoSource', { ConnectorId: '1' });
}

xapi.event.on('RoomReset SecondsToReset', (event) => {
  if (event.SecondsToReset) {
    xapi.command('UserInterface Message TextLine display',
      {
        Text: `System will be reset to default settings in ${event.SecondsToReset} Seconds`,
        Duration: 5,
      });
  }
});

xapi.event.on('RoomReset Reset', (event) => {
  if (event.SecondsToReset) {
    resetRoomToDefault();
  }
});

 

Also, is there a way to setup a macro to restart the unit every night at Midnight based on the local time zone of the unit?

 

Thanks in advance!

CE devices have only fonts which Touch UI supports. So if you have your selected language is on locale setting, then you can use it on In-Room Control or display name. If not, it shows squared fonts.

 

xconfiguration UserInterface Language: 
Arabic               Finnish              Norwegian
Catalan              French               Polish
ChineseSimplified    FrenchCanadian       Portuguese
ChineseTraditional   German               PortugueseBrazilian
Czech                Hebrew               Russian
Danish               Hungarian            Spanish
Dutch                Italian              SpanishLatin
English              Japanese             Swedish
EnglishUK            Korean               Turkish

Yuki Iwagishi
Cisco Employee
Cisco Employee

When end users don't know other parties signaling protocol, they need to try to call twice h323 and sip.

So I wrote short macro for sip call attempt after a call siconnected by NetworkRejected & H323 call.

 


/** * Once you fail H323 call via protocol Auto: * Try to call same IP Address by protocol SIP. */ const xapi = require('xapi'); function dial(number) { console.log('dial', number); xapi.command('dial', { Number: number }); } function listenToCalls() { xapi.event.on('CallDisconnect', (event) => { if(event.CauseType == "NetworkRejected" && event.Protocol == "H323"){ console.log(event.RequestedURI); dial("sip:"+event.RequestedURI); } }); } listenToCalls();

 

Justin Ferello
Level 5
Level 5

Is there a way to force calls that are between 5 and 20 digits to be sent as audio only and SIP using a macro?

Thank you,
Justin Ferello
Technical Support Specialist, ScanSource KBZ

Hi Justin

I did an attempt to solve your scenario. You might need to do some tweaks as I don´t know your setup but this macro seems to do the job. At least it´s a place to start.. :)

 

const xapi = require('xapi');

function callEvent() {
  //Listen for outgoing calls
  xapi.event.on('OutgoingCallIndication', (event) => {
    //Get the details of the outgoing call
    xapi.status.get('Call ' + event.CallId).then((value)=>{
        //The digits dialed automatically gets a domain attached (at least for me), split it up
        var [digits, domain] = value.RemoteNumber.split('@');
        //Verify that the outgoing call type is Video (else this will create a endless loop) and that the value is numeric
        if (!/\D/.test(digits) && value.CallType === "Video") {
          var d = digits.length;
          //Verify length (between 5 and 20, else do nothing)
          if (d >= 5 && d <= 20) {
            //Disconnect the first call
            xapi.command('Call Disconnect');
            //Start a new call as audio to the same number
            xapi.command('Dial', {
              Number: value.RemoteNumber,
              CallType: 'Audio',
              Protocol: 'SIP',
              CallRate: '64'
            });
          }
        }
      });
    });
}
callEvent();

Hope this helps solve your scenario.

 

/Magnus

Magnus,

Thanks for looking into this, I am not a programmer by any stretch of the imagination :)  I will let you know how it goes.

Thank you,
Justin Ferello
Technical Support Specialist, ScanSource KBZ

If end user dials 9 digits, Macro adds webex domain.

I've just modified Magnus's SIP audio call codes for 6-19 digits .

 

Thanks for this script, i tried to add a rule that if it starts with the number 7 and have 9 digits adds the webex domain but with no luck. Can you help me?

 

berenyi.peter
Level 4
Level 4

Hi,

 

what is the syntax for the multiline xAPI commands if you want to execute them via a macro? (I.e. how do you add the body of the command?)

 

Thanks

 

P.

Yuki Iwagishi
Cisco Employee
Cisco Employee

CE9.x has introduced Halfwake state. Unfortunately there is no configuration of disable halfwake. I wrote halwake state event trigger > Standby Deactivate. I believe there are several approach to implement it. 

This is just one example....

 

const xapi = require('xapi');
xapi.status.on('Standby State', state => {
  console.log('going to ', state);
    if (state === 'Halfwake') xapi.command('Standby Deactivate');
});