473,568 Members | 2,795 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to set TLS security using RTC API's

Hi,

I am developing simple peer-peer RTC application for monitoring the SDP packets and i need to set the TLS security for the transport.
But iam struggling to achieving this.

Iam using IP addresses as SIP URI for communication.

I am using IRTCClientProvi sioning::GetPro file()
IRTCClientProfi le::EnablePrsen ceEx()
IRTCClientProvi sioning::Enable ProfileEx()
But iam not able to establish a connection between 2 endpoints as iam not able to register to the server.

This is the code snippet :

using System;
using System.Collecti ons.Generic;
using System.Componen tModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows. Forms;
using RTCCORELib;
using System.Xml;
using System.Xml.Seri alization;

namespace RTC_1._api
{
public partial class Form1 : Form
{
RTCClientClass _rtc = new RTCClientClass( );
IRTCClientProvi sioning2 userCreation;
IRTCSession _session; //To create and initializes a session of communication.
IRTCProfile userprofile; //An object for the profile of the user
IRTCClientPrese nce2 presence;

public Form1()
{
InitializeCompo nent();
}

public void RTC_IRTCEventNo tification_Even t_Event(RTC_EVE NT RTC_event, object pEvent)
{

switch (RTC_event)
{
case RTC_EVENT.RTCE_ SESSION_STATE_C HANGE:
{
IRTCSessionStat eChangeEvent sessionEvent = null;
sessionEvent = (IRTCSessionSta teChangeEvent)p Event;
OnIRTCSessionSt ateChangeEvent( sessionEvent);
break;
}
case RTC_EVENT.RTCE_ MEDIA:
{
IRTCMediaEvent mediaEvent = null;
mediaEvent = (IRTCMediaEvent )pEvent;
OnIRTCMediaEven t(mediaEvent);
break;
}
case RTC_EVENT.RTCE_ MESSAGING:
{
IRTCMessagingEv ent IMEvent = null;
IMEvent = (IRTCMessagingE vent)pEvent;
OnIRTCIMEvent(I MEvent);
break;
}
case RTC_EVENT.RTCE_ PROFILE:
{
MessageBox.Show ("RTCE_PROFILE" );
IRTCProfileEven t2 profileEvent = null;
profileEvent = (IRTCProfileEve nt2)pEvent;
OnProfileEvent( profileEvent);
break;
}
case RTC_EVENT.RTCE_ REGISTRATION_ST ATE_CHANGE:
{
MessageBox.Show ("RTCE_REGISTRA TION_STATE_CHAN GE");
IRTCRegistratio nStateChangeEve nt regEvent = null;
regEvent = (IRTCRegistrati onStateChangeEv ent)pEvent;
OnRegChangeEven t(regEvent);
break;
}
case RTC_EVENT.RTCE_ CLIENT:
{
IRTCClientEvent clientEvent;
clientEvent = (IRTCClientEven t)pEvent;
OnClientEvent(c lientEvent);
break;
}
}
}

private void OnClientEvent(I RTCClientEvent clientEvent)
{
RTC_CLIENT_EVEN T_TYPE clientState;
clientState = clientEvent.Eve ntType;
if (clientState == RTC_CLIENT_EVEN T_TYPE.RTCCET_A SYNC_CLEANUP_DO NE)
{
MessageBox.Show ("srinivas akella");
}
}

private void OnRegChangeEven t(IRTCRegistrat ionStateChangeE vent regEvent)
{
RTC_REGISTRATIO N_STATE regState;
regState = regEvent.State;
switch (regState)
{
case RTC_REGISTRATIO N_STATE.RTCRS_R EGISTERING:
MessageBox.Show ("RTCRS_REGISTE RING");
break;
case RTC_REGISTRATIO N_STATE.RTCRS_R EGISTERED:
MessageBox.Show ("RTCRS_REGISTE RED");
break;
case RTC_REGISTRATIO N_STATE.RTCRS_L OGGED_OFF:
MessageBox.Show ("RTCRS_LOGGED_ OFF");
break;
case RTC_REGISTRATIO N_STATE.RTCRS_E RROR:
MessageBox.Show ("RTCRS_ERROR") ;
break;

}

}

private void OnProfileEvent( IRTCProfileEven t2 pEvent)
{
if(pEvent.Event Type == RTC_PROFILE_EVE NT_TYPE.RTCPFET _PROFILE_GET)
{
if (pEvent.StatusC ode == 0)
{
MessageBox.Show ("1");
userprofile = (IRTCProfile)pE vent.Profile;
presence.Enable PresenceEx(user profile, "bb", 0);
presence.SetLoc alPresenceInfo( RTC_PRESENCE_ST ATUS.RTCXS_PRES ENCE_ONLINE, null);
userCreation.En ableProfileEx(u serprofile, 0x0000000F, 0x0000000F);
MessageBox.Show ("1");
}

}
}
void OnIRTCIMEvent(I RTCMessagingEve nt IMEvent)
{
if (IMEvent.EventT ype == RTC_MESSAGING_E VENT_TYPE.RTCMS ET_MESSAGE)
{
string messageReceived FromUserUri = IMEvent.Partici pant.UserURI;
string messageHeader =IMEvent.Messag eHeader;
string message = IMEvent.Message ;
MessageBox.Show (messageReceive dFromUserUri + " : " + message);

}

}
void OnIRTCSessionSt ateChangeEvent( IRTCSessionStat eChangeEvent sessionevent)
{

RTC_SESSION_STA TE sessionState;
sessionState = sessionevent.St ate;
switch (sessionState)
{

case RTC_SESSION_STA TE.RTCSS_IDLE:
textBox3.Text = "Session is IDLE";
break;

case RTC_SESSION_STA TE.RTCSS_INCOMI NG:

textBox3.Text = "Session is INCOMING";
//Play a ring on the local PC to alert user of incoming call.
objRTC.PlayRing (RTC_RING_TYPE. RTCRT_PHONE, true);
//Get the incoming session.
objSession = sessionevent.Se ssion;
objSession.Answ er();
break;

case RTC_SESSION_STA TE.RTCSS_ANSWER ING:
textBox3.Text = "Session is ANSWERING";
// Stop the ringing
objRTC.PlayRing (RTC_RING_TYPE. RTCRT_PHONE, false);
break;

case RTC_SESSION_STA TE.RTCSS_INPROG RESS:
textBox3.Text = "Session is INPROGRESS";
break;

case RTC_SESSION_STA TE.RTCSS_CONNEC TED:
textBox3.Text = "Session is CONNECTED";
break;

case RTC_SESSION_STA TE.RTCSS_DISCON NECTED:
textBox3.Text = "Session is DISCONNECTED";
objSession = null;
break;
}
}

void OnIRTCMediaEven t(IRTCMediaEven t mediaEvent)
{
RTC_MEDIA_EVENT _TYPE mediaType;
IVideoWindow videoWindow = null;

mediaType = mediaEvent.Even tType;
switch (mediaType)
{
case RTC_MEDIA_EVENT _TYPE.RTCMET_ST ARTED:
{
videoWindow = objRTC.get_IVid eoWindow(RTC_VI DEO_DEVICE.RTCV D_RECEIVE);
videoWindow.Set WindowPosition( 100, 100, 400, 400);
videoWindow.Vis ible = 1;
textBox4.Text = "Video Window is Openend";
break;
}

case RTC_MEDIA_EVENT _TYPE.RTCMET_FA ILED:
{
textBox4.Text = "Video Session is failed";
break;
}

case RTC_MEDIA_EVENT _TYPE.RTCMET_ST OPPED:
{
textBox4.Text = "Video Session is closed";
videoWindow.Vis ible = 0;
videoWindow = null;
break;

}
}
}
RTCClientClass objRTC = new RTCClientClass( );
IRTCSession objSession;
private void Connect_Click(o bject sender, EventArgs e)
{
userCreation = _rtc;
presence = _rtc;
_rtc.Initialize ();
_rtc.SetPreferr edMediaTypes(0x 0000001F, true);
_rtc.EventFilte r = 0x00000080 | 0x00000004 | 0x00000020 | 0x00000400 | 0x00000002;
_rtc.IRTCEventN otification_Eve nt_Event += new IRTCEventNotifi cation_EventEve ntHandler(RTC_I RTCEventNotific ation_Event_Eve nt);
_rtc.ListenForI ncomingSessions = RTC_LISTEN_MODE .RTCLM_BOTH;
userCreation.Ge tProfile(null, null, "172.25.218.48" , "172.25.218 .1", 4, 0);
MessageBox.Show ("Over");
}

private void CreateSession_C lick(object sender, EventArgs e)
{
_session = _rtc.CreateSess ion(RTC_SESSION _TYPE.RTCST_PC_ TO_PC, null, userprofile, 0x00000001);
_session.AddPar ticipant("172.2 5.218.144", "srinivas") ;

}

}
}
what could be the problem in registering the profile with the server.

how to register for a server if IP addresses are used for peer-peer communication.

I would be greatful to u if u provide any pointers.

Jun 27 '08 #1
0 1587

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2028
by: Nick | last post by:
I am working on an application for a client that will involve using remoting. They do not want to use integrated security so I was going to store usernames and hashed passwords in a SQL Database. I have a table in the database that will also contain their session information which it will encrypt and store as a class on the client end. Each...
2
1931
by: Lapchien | last post by:
Is it possible to restrict usage of a command button on a form to only certain users (i'm on a windows 2000 domain) or users with membership of a domain/group..? Lap
3
4509
by: Jefferson Cowart | last post by:
Is there any way I can have a C# program check to see if Anti-Virus software is installed using the same methods that the Windows XP SP2 security center checks. I'm writing a program that verifys a user has anti-virus software installed and running before allowing the user to proceed. If I can avoid having to re-write all the code and just hook...
1
2642
by: Danko Greiner | last post by:
Thanx Willy, this was very helpful. But i also need (and want to know) how to do this from code. Can you plase give me right topic in MSDN? is there good example? Thanx p.s. this is copy/paste from previous thread, don't ask why... "Grei" <danko.greinerREMOVE@zg.htnet.hr> wrote in message news:d1vihg$m3b$1@ss405.t-com.hr...
2
4970
by: Boris Condarco | last post by:
Hi gurus, I was reading some documentation about security in .NET Framework, it mention that it is possible to make custom Role Based security for example: check the authentication with Windows Integrated and once do that, create a Generic Identity in orde to create a Generic Principal with custom roles for that user. Finally, replace the...
4
2448
by: Dean Slindee | last post by:
I would like to provide a menu item that the users can click that launches the same "Windows Security" window that doing a Ctrl+Alt+Delete launches, but thru a Process.Start. Is this possible, and what is the name of the ..exe and it's location? Thanks, Dean Slindee
4
2602
by: MSSQLServerDeveloper | last post by:
I am running in a windows 2000 environment and have the following scenario / question. I have a vb.net application. Before allowing the user the go into the app, I would like to validate against the windows password. Is there any easy way to do this? tia
8
13845
by: Bryan Dickerson | last post by:
The full message is: Request for permission of the type 'System.Security.Permissions.RegistryPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. It happened while trying to execute a small program, from a network share, that will tests the correct installation of some ODBC/OLE drivers. It...
3
3795
by: michael sorens | last post by:
In the interests of increasing security, I came upon the DPAPI security library available from the GotDotNet user samples repository. What I want to do is create an applications that accesses a database with one single password embedded in the program, so it may be run by any user on any machine. I observe that one may specify a UserStore or a...
2
4472
by: Baheri | last post by:
If I use WSE3.0 security to authenticate my user does the client need to install WSE3.0 or any other installation? Does he need to use the WSE API to send requestes to my service?How does a Java client running on a UNIX machine achive this? If we need a client side installation or dependency on an WSE 3.0 API.
0
7916
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8117
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7660
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2101
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
932
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.