7 Replies Latest reply on May 16, 2014 5:59 AM by bilalahmed54

    MediaSense Event Subscription

    bilalahmed54

      I want to ask 2 things regarding MediaSense Events Subscription:

       

      1. When I subscribe to mediasense events, I am not getting complete JSON Schema when particular event occurs. I get response from 'EventBody' while it should start from

       

      "eventType": "SESSION_EVENT",

      "eventAction": "DELETED",

      "forwardedEvent": "TRUE",

       

      After this EventBody Comes. But I don't get the above three information in my response.

       

      2. I am un-able to understand the un-subscription criteria other than we implicitly do it. When Mediasense server un-subscribes our events subscription ? Is there any limit/conditions after whom we will have to re-subscribe for mediasense events ?

       

      Thanks in Advance

       

      OS Administration

        • 1. Re: MediaSense Event Subscription
          jwolfeld

          For #1, have you checked the BOTTOM of the JSON body?  The JSON spec does not require that individual named properties be presented in any particular order.  The properties may not come in the same order as you see in the documented examples.

           

          For #2, your client program should unsubscribe from events before it exits.  If your client program exits and then restarts, the subscription could still be in place, and you may start receiving events even before you re-subscribe.

           

          That said, MediaSense will automatically unsubscribe you if 30 minutes pass between events that match your subscription's filter criteria, or if MediaSense is unable to deliver events to your client several times in a row.

           

          [EDIT] My above comment about automatic unsubscription after 30 minutes is incorrect.  There is no automatic unsubscription except in failure cases.

          • 2. Re: MediaSense Event Subscription
            bilalahmed54

            1.       Yes, Sorry I could not see earlier that these attributes were mentioned at the end of the response I though order also matters.

             

            2.       Is there any criteria (notification) that may tell us that our subscription of the notifications has been cancelled or we will have to write a script that will used to make an API call after certain time period to check that either our subscription is still alive or not ?

             

            3.       And when you say that MediaSense will automatically unsubscribe you if 30 minutes pass between events that match your subscription's filter criteria what this means that if we have subscribed to “Add Tag” notification and we don’t assign tag to any session within 30 minutes then our subscription of “Adding Tag” will be cancelled ?

             

             

             

            Thanks for your guidance

            • 3. Re: MediaSense Event Subscription
              jwolfeld

              MediaSense offers a verifyEventSubscription API which you should call periodically.  Actually you could just as well re-issue the subscribeToEvents instead, since that's what you'd have to do anyway if the subscription turns out to have been terminated – and there's no harm in subscribing again when it hasn't been terminated.

               

              You should do this more often than every 30 minutes.  If a MediaSense node crashes and reboots, you could miss events until you re-subscribe, because you don't know that there has been a restart, and because subscriptions are not persistent across restarts.

               

              [EDIT] My above comment about automatic unsubscription after 30 minutes is incorrect.  There is no automatic unsubscription except in failure cases.

              • 4. Re: MediaSense Event Subscription
                bilalahmed54

                Right as subscriptions are not persistent across restarts so we don't know. And that is good idea too that we directly make subscribe API call instead firstly verify and then make subscription.

                 

                Except nodes crashes or reboots, just for the sake of clearing my concepts, I want to ask that when you say that MediaSense will automatically unsubscribe you if 30 minutes pass between events that match your subscription's filter criteria what this means that if we have subscribed to “Add Tag” notification and we don’t assign tag to any session within 30 minutes then our subscription of “Adding Tag” will be cancelled ?

                • 5. Re: MediaSense Event Subscription
                  jwolfeld

                  I did some investigation and found that my above comment about automatic unsubscription after 30 minutes is incorrect.  There is no automatic unsubscription except in failure cases.  I've edited my earlier notes on this thread accordingly.

                  • 6. Re: MediaSense Event Subscription
                    bilalahmed54

                    Okay Thank you so Much

                    • 7. Re: MediaSense Event Subscription
                      bilalahmed54

                      I am facing an issue while playing Real Time Streaming. Actually, I want to

                      monitor live sessions. If you have worked with this, can you kindly guide

                      me regarding this issue ?

                       

                      I have shared all my findings and workings regarding this

                      Here<https://communities.cisco.com/thread/43341>

                      .

                       

                      I will wait for your guidance that What is wrong here ? Or I am approaching

                      by wrong way ?

                       

                      Thanks in Advance