Making your own CAP provider

  • 1
  • Question
  • Updated 1 year ago
  • Answered
Is there a way that someone could make their own CAP service to use with Rise Vision?

Fro example, could I build a service in PHP that could send a properly formed XML CAP message to the endpoint given in the settings and have the alert display on my screens?

I am asking because I do not see any reason this should not work, yet in my testing so far I cannot get it to accept any CAP formatted messages so far.
Photo of Kevin Lee

Kevin Lee

  • 80 Points 75 badge 2x thumb

Posted 4 years ago

  • 1
Photo of Blake Freeman

Blake Freeman, Official Rep

  • 36,116 Points 20k badge 2x thumb
Kevin,

Thanks for the question. I'm going to look into this and ask around, I'l get back to you when I have an answer!
Photo of Blake Freeman

Blake Freeman, Official Rep

  • 36,116 Points 20k badge 2x thumb
Kevin,

You should be able to send your own alerts as long as they conform to the CAP 1.2 standard.

There is a little more info on this available at http://help.risevision.com/#/user/alerts/what-are-alets
Photo of Kevin Lee

Kevin Lee

  • 80 Points 75 badge 2x thumb
I've been using a Chrome app called Advanced Rest Client to POST some test messages from the official CAP documentation to no avail so far. I haven't attempted in in PHP yet and that is my next step.

The only other question I have is should i be sending it as a raw POST request or should i send a file with the XML data in it?
Photo of nxp tims

nxp tims

  • 90 Points 75 badge 2x thumb
I am also interesed to know the answer from Kevin's question???
Photo of Biologyben

Biologyben

  • 3,558 Points 3k badge 2x thumb
I know nothing about the software, but I stumbled across this link looking for an opensource CAP provider solution. https://github.com/CAPTools/CAPCreator


Google also has a cap validator available.

Good luck and let us know how to do it for ourselves!
(Edited)
Photo of nxp tims

nxp tims

  • 90 Points 75 badge 2x thumb
If I post a CAP (version 1.2) message to Web Service, It responds with no data, which is OK. But why the alerts are not showing in the presentation?
(Edited)
Photo of Biologyben

Biologyben

  • 3,558 Points 3k badge 2x thumb
FYI -This is the same answer I provided in in this post  I am not a developer, so I'm hoping someone will jump on this as it seems it should be relatively easy.  My notes on basic formatting are shared here 

So - the answer seems to be a definite YES!  

I was able to use https://www.hurl.it/ to send just the xml code above to my displays!  Worked great!  

To replicate, first be sure that your settings in the RISE alert Tab are configured (and perhaps limit the displays to a single display to test.  You may also choose to limit the number of minutes the alert is show to keep from tying up the system for too long - 5 minutes is a good start.

Then go to Hurt.it  Choose POST and use your URL from Rise
https://rvaserver2.appspot.com/alerts/cap?id=YOUR_ID_GOES_HERE
Choose basic authentication and insert the Username and Password you set up (at the Rise Alerts tab) 

Ignore headers and parameters - select Body and paste the XML and submit.  (be sure to update the UTC time and set the time code  to your local time(<sent>YYYY-MM-DDTHH:MM:SS-05:00</sent> -- 05:00 for East Coast, -08:00 for Pacific)
<alert xmlns = "urn:oasis:names:tc:emergency:cap:1.2"><identifier>1</identifier><sender>someorg.com</sender><sent>YYYY-MM-DDTHH:MM:SS-05:00</sent><status>Actual</status><msgType>Alert</msgType><scope>Public</scope><info><category>Safety</category><event>test event</event><urgency>Immediate</urgency><severity>Severe</severity><certainty>Observed</certainty><headline>headline goes here</headline><description>description goes here</description><instruction>instruction goes here</instruction></info></alert>
In just a second or three, the alert should show on your screen.  If not,
  • run your XML through the CAP Validator
  • Double check your settings in Rise, and 
  • be sure your XML has the time set properly.


I would think it should be easy to create a simple form with drop down fields for the basic alert categories and fill in the the three items Rise will show.  

Perhaps also it wouldn't be much harder to direct an NWS atom feed directly back to the Displays as well...
Photo of David

David

  • 70 Points
I wrote a small python script to test this (mainly so it could automagically format and populate the sent and expires tags) and couldn't get it working.  Even though my xml passed validation, no alerts were being displayed.

Upon rereading the instructions https://community.risevision.com/rise_vision_inc/topics/how-to-set-up-alerts-on-your-display , I realised that our filter settings in Rise Vision were to blame. 

I made the (incorrect) assumption that not setting any of the filters for Status, Category, Urgency, Severity and Certainty would not filter any alerts.  Quite the opposite is true.  The checkboxes designate the items that must match for the alert to be activated.

So if you leave them all unticked, like I did, you are 100% guaranteed to not get any alerts!

Ticked all the boxes, saved the Alert settings, and hey presto, everything worked.