Return to LanScape's home page Go back a page...       Active TopicsActive Topics   Display List of Forum MembersMember List   Knowledge Base SearchSearch   HelpHelp  RegisterRegister  LoginLogin

LanScape VOIP Media Engine™ - Technical Support
 LanScape Support Forum -> LanScape VOIP Media Engine™ - Technical Support
Subject Topic: Subscribe to Events and Notifcations Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
davidpeek
Intermediate
Intermediate


Joined: December 18 2009
Location: United States
Posts: 10
Posted: April 06 2010 at 2:49pm | IP Logged Quote davidpeek

Hi Randal,

I'm having a little difficulty understanding how to issue an event notification with SendEventNotification using managed code(VB). I know I'm supposed to save the handle from the SipSubscriptionReceived event but I don't see how to instantiate the VoIPMediaEngine.Notify class in order to use it to call SendEventNotification for the specific destination. I don't see how that works? Can you help? Thanks! =Dave
Back to Top View davidpeek's Profile Search for other posts by davidpeek
 
support
Administrator
Administrator


Joined: January 26 2005
Location: United States
Posts: 1666
Posted: April 07 2010 at 7:00pm | IP Logged Quote support

Hello Dave,

Thanks for waiting for this response. It has been busy here…

Instead of trying to explain the details of the managed code SUBSCRIBE/NOTIFY capabilities of the media engine, I thought it would be a good idea to add a new managed code sample to the product. That way you can look at code and shorten your learning curve. There’s nothing like looking at real code to see how everything is supposed to work.

What I did was create a new simple form based vb.NET sample app that will be included in future releases of the LME. Here is a screen shot of the new sample:





Everyone can download the code archive from this link:
SubscribeNotifyVbSampleApp.zip


Summary:
The sample shows the basics of subscribing to SIP events and then generating NOTIFY responses to the event subscriptions. The sample app basically subscribes and notifies itself.

There is additional information in the main form’s vb.NET code module that explains things further. Make sure to look it over.

The sample allows the user to start and stop the media engine. Once the media engine is started, the user can press a GUI button to initiate a SIP SUBSCRIBE request. The subscribe SIP message is transmitted and received by the sample.

In the code, the app handles the SipSubscriptionReceived immediate event. During the processing of this event, the app can deduce if the SUBSRIBE is being requested or is being terminated (it looks at the SIP Expire value). If the expire value is non zero, it’s a SUBSCRIBE start event.

For the app to send out NOTIFY requests, the app need only copy the “NotifyObject” from the “Subscribe Reqest Data” that is passed to the app. View the sample code – you will see exactly what I mean.

Once your app has this “NotifyObject”, you can use it to send SIP NOTIFY requests back to the subscriber by calling the SendEventNotification() member of the “NotifyObject”:

Code:


    status = NotifyObj.SendEventNotification(………);





Use the sample like this:
---------------------------------------
Start the sample.
Set your host’s IP and SIP port as required.
Press the “start media engine” button.
Press the “Subscribe” button.
Press the “Notify” button.

As the media engine does it “thing”, you will see the SIP messages streamed to the GUI.


Please let me know if I have missed something.


Thank you Dave,


Randal

Back to Top View support's Profile Search for other posts by support Visit support's Homepage
 
davidpeek
Intermediate
Intermediate


Joined: December 18 2009
Location: United States
Posts: 10
Posted: April 07 2010 at 7:50pm | IP Logged Quote davidpeek

Hi Randal,

This is great! All my questions are answered and I now see exactly what I need to do. Thanks for creating this sample so quickly!

Thanks,
=Dave
Back to Top View davidpeek's Profile Search for other posts by davidpeek
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum






Contact LanScape Hear what the Lawyers have to say How youm may use this site Read your privacy rights