05-11-2015 03:13 AM
Hi, I am newbie from MediaSense, I try to get data from MediaSense api (subscriptionUri), but I can't. Please help me.
Thank you for your comment or suggestion.
Trinnachart.
05-11-2015 04:06 AM
Hi trinnachart,
Please describe your question in detail. Show your work. What actually you want to do and what you did so far? And What is the actual error you are getting? Thanks
Generally Using Subscription API you subscribe for Mediasense Call Notification. For this you first write Webservice which will be getting requests on particular URL and you will be using this URL in your Subscription API. And in the response of that API you get the status of your subscription.
05-11-2015 07:51 PM
Hi Bilal Ahmed Yaseen,
I try to use Mediasense API "subscribeToEvents" to subscribe my Mediasense server, see my code below
$data = array(
"requestParameters" => array(
"subscriptionType" => "http",
"subscriptionUri" => "http://APPLICATION_SERVER_IP:81/test/content.php",
"subscriptionFilters" => ["RECORDING_EVENTS"]
)
);
$url = "https://MEDIASENSE_IP:8440/ora/eventService/event/subscribeToEvents";
$header = array(
'Content-Type: application/json',
'Cookie: JSESSIONID=xxxxxxxxxxxxxxxxxxxxxxx'
);
$json = json_encode($data);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_HEADER, true);
$result = curl_exec($ch);
curl_close ($ch); // close curl handle
var_dump($result); // show output
After execute my code, I got the result like this
{"responseMessage":"Success: Your request was successfully completed.","responseCode":2000,"responseBody":{"subscriptionFilters":["SESSION_STARTED_EVENT","SESSION_UPDATED_EVENT","SESSION_ENDED_EVENT"],"subscriptionId":"HfKrs2JXPdpfMVW13"}}"
Thank you for your help.
Trinnachart
05-11-2015 11:25 PM
Hi trinnachart,
According to the response you received from mediasense, It is clear that you subscription process for mediasense notification has been completed successfully. Now, you will be getting notification for the following call events:
"SESSION_STARTED_EVENT","SESSION_UPDATED_EVENT","SESSION_ENDED_EVENT".
Now, Mediasense will push notifications to the URI you mentioned while subscribing, that was:
"http://APPLICATION_SERVER_IP:81/test/content.php"
So, when you will make call from a phone against which recording profile will be enabled, you will get notifications from mediasense on the specified URI.
Now, to receive mediasense notifications, you need to make sure two things:
Please let me know If you further need any assistance. Thanks
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide