summaryrefslogtreecommitdiffstats
path: root/bindings/csharp/test_xcap
diff options
context:
space:
mode:
Diffstat (limited to 'bindings/csharp/test_xcap')
-rw-r--r--bindings/csharp/test_xcap/Program.cs107
-rw-r--r--bindings/csharp/test_xcap/Properties/AssemblyInfo.cs36
-rw-r--r--bindings/csharp/test_xcap/test_xcap.csproj188
3 files changed, 331 insertions, 0 deletions
diff --git a/bindings/csharp/test_xcap/Program.cs b/bindings/csharp/test_xcap/Program.cs
new file mode 100644
index 0000000..3c88733
--- /dev/null
+++ b/bindings/csharp/test_xcap/Program.cs
@@ -0,0 +1,107 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace test_xcap
+{
+ class Program
+ {
+ const String REALM = "micromethod.com";
+ const String USER = "mamadou";
+ const String PASSWORD = "mamadou";
+ const String HOST = "192.168.0.10";
+ const int PORT = 8080;
+
+ static void Main(string[] args)
+ {
+ xcapStack = new MyXcapStack(new MyXcapCallback(), String.Format("sip:{0}@{1}", USER, REALM), PASSWORD, String.Format("http://{0}:{1}/services", HOST, PORT));
+ xcapSelector = new XcapSelector(xcapStack);
+
+ if (!xcapStack.start())
+ {
+ Console.WriteLine("Failed to start the XCAP stack");
+ }
+
+ xcapStack.addHeader("Connection", "Keep-Alive");
+ xcapStack.addHeader("User-Agent", "XDM-client/OMA1.1");
+ xcapStack.addHeader("X-3GPP-Intended-Identity", String.Format("sip:{0}@{1}", USER, REALM));
+
+ //xcapSelector.setAUID("resource-lists").
+ // setAttribute("list", "name", "rcs").
+ // setAttribute("entry", "uri", String.Format("sip:{0}@{1}", USER, REALM)).
+ // setName("display-name");
+
+ //xcapSelector.setAUID("xcap-caps");
+ // xcapStack.getDocument(xcapSelector.getString());
+ // xcapSelector.reset();
+ // Console.ReadLine();
+
+ xcapSelector.setAUID("resource-lists");
+ xcapStack.getDocument(xcapSelector.getString());
+ xcapSelector.reset();
+ Console.ReadLine();
+
+ xcapStack.stop();
+
+ Console.ReadLine();
+
+ xcapStack.start();
+
+ xcapSelector.setAUID("xcap-caps");
+ xcapStack.getDocument(xcapSelector.getString());
+ xcapSelector.reset();
+ Console.ReadLine();
+
+ Console.ReadLine();
+ }
+
+ static XcapSelector xcapSelector;
+ static MyXcapStack xcapStack;
+
+
+ class MyXcapStack : XcapStack
+ {
+ public MyXcapStack(MyXcapCallback callback, string xui, string password, string xcap_root)
+ : base(callback, xui, password, xcap_root)
+ {
+ }
+ }
+
+ class MyXcapCallback : XcapCallback
+ {
+ public MyXcapCallback()
+ :base()
+ {
+ }
+
+ public override int onEvent(XcapEvent e)
+ {
+ XcapMessage message = e.getXcapMessage();
+ String content_type;
+
+ if(message == null){
+ Console.WriteLine("Invalid Xcap message");
+ return -1;
+ }
+
+ Console.WriteLine("code={0} and Phrase={1}", message.getCode(), message.getPhrase());
+
+ if((content_type = message.getXcapHeaderValue("Content-Type")) != null){
+ Console.WriteLine("Content-Type={0}", content_type);
+ uint clen = message.getXcapContentLength();
+ if (clen > 0)
+ {
+ byte[] content = new byte[clen];
+ uint read = message.getXcapContent(content, (uint)content.Length);
+ Console.WriteLine("Content-Value ==> {0}", Encoding.UTF8.GetString(content));
+ }
+ }
+
+
+
+ return base.onEvent(e);
+ }
+ }
+ }
+}
diff --git a/bindings/csharp/test_xcap/Properties/AssemblyInfo.cs b/bindings/csharp/test_xcap/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..e0ca0e6
--- /dev/null
+++ b/bindings/csharp/test_xcap/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("test_xcap")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("test_xcap")]
+[assembly: AssemblyCopyright("Copyright © 2010")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("1bafc67e-7616-4f2e-a5de-412b21396127")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/bindings/csharp/test_xcap/test_xcap.csproj b/bindings/csharp/test_xcap/test_xcap.csproj
new file mode 100644
index 0000000..064e7d7
--- /dev/null
+++ b/bindings/csharp/test_xcap/test_xcap.csproj
@@ -0,0 +1,188 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.21022</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{FCC7ACB3-6809-4FA6-A5AC-961B7B874B57}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>test_xcap</RootNamespace>
+ <AssemblyName>test_xcap</AssemblyName>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Core">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Xml.Linq">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data.DataSetExtensions">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="..\CallEvent.cs">
+ <Link>CallEvent.cs</Link>
+ </Compile>
+ <Compile Include="..\CallSession.cs">
+ <Link>CallSession.cs</Link>
+ </Compile>
+ <Compile Include="..\DDebugCallback.cs">
+ <Link>DDebugCallback.cs</Link>
+ </Compile>
+ <Compile Include="..\DialogEvent.cs">
+ <Link>DialogEvent.cs</Link>
+ </Compile>
+ <Compile Include="..\MessagingEvent.cs">
+ <Link>MessagingEvent.cs</Link>
+ </Compile>
+ <Compile Include="..\MessagingSession.cs">
+ <Link>MessagingSession.cs</Link>
+ </Compile>
+ <Compile Include="..\OptionsEvent.cs">
+ <Link>OptionsEvent.cs</Link>
+ </Compile>
+ <Compile Include="..\OptionsSession.cs">
+ <Link>OptionsSession.cs</Link>
+ </Compile>
+ <Compile Include="..\ProxyAudioConsumer.cs">
+ <Link>ProxyAudioConsumer.cs</Link>
+ </Compile>
+ <Compile Include="..\ProxyAudioProducer.cs">
+ <Link>ProxyAudioProducer.cs</Link>
+ </Compile>
+ <Compile Include="..\ProxyVideoConsumer.cs">
+ <Link>ProxyVideoConsumer.cs</Link>
+ </Compile>
+ <Compile Include="..\ProxyVideoFrame.cs">
+ <Link>ProxyVideoFrame.cs</Link>
+ </Compile>
+ <Compile Include="..\ProxyVideoProducer.cs">
+ <Link>ProxyVideoProducer.cs</Link>
+ </Compile>
+ <Compile Include="..\PublicationEvent.cs">
+ <Link>PublicationEvent.cs</Link>
+ </Compile>
+ <Compile Include="..\PublicationSession.cs">
+ <Link>PublicationSession.cs</Link>
+ </Compile>
+ <Compile Include="..\RegistrationEvent.cs">
+ <Link>RegistrationEvent.cs</Link>
+ </Compile>
+ <Compile Include="..\RegistrationSession.cs">
+ <Link>RegistrationSession.cs</Link>
+ </Compile>
+ <Compile Include="..\SafeObject.cs">
+ <Link>SafeObject.cs</Link>
+ </Compile>
+ <Compile Include="..\SipCallback.cs">
+ <Link>SipCallback.cs</Link>
+ </Compile>
+ <Compile Include="..\SipEvent.cs">
+ <Link>SipEvent.cs</Link>
+ </Compile>
+ <Compile Include="..\SipMessage.cs">
+ <Link>SipMessage.cs</Link>
+ </Compile>
+ <Compile Include="..\SipSession.cs">
+ <Link>SipSession.cs</Link>
+ </Compile>
+ <Compile Include="..\SipStack.cs">
+ <Link>SipStack.cs</Link>
+ </Compile>
+ <Compile Include="..\SipUri.cs">
+ <Link>SipUri.cs</Link>
+ </Compile>
+ <Compile Include="..\StackEvent.cs">
+ <Link>StackEvent.cs</Link>
+ </Compile>
+ <Compile Include="..\SubscriptionEvent.cs">
+ <Link>SubscriptionEvent.cs</Link>
+ </Compile>
+ <Compile Include="..\SubscriptionSession.cs">
+ <Link>SubscriptionSession.cs</Link>
+ </Compile>
+ <Compile Include="..\thttp_event_type_t.cs">
+ <Link>thttp_event_type_t.cs</Link>
+ </Compile>
+ <Compile Include="..\tinyWRAP.cs">
+ <Link>tinyWRAP.cs</Link>
+ </Compile>
+ <Compile Include="..\tinyWRAPPINVOKE.cs">
+ <Link>tinyWRAPPINVOKE.cs</Link>
+ </Compile>
+ <Compile Include="..\tmedia_chroma_t.cs">
+ <Link>tmedia_chroma_t.cs</Link>
+ </Compile>
+ <Compile Include="..\tsip_event_type_t.cs">
+ <Link>tsip_event_type_t.cs</Link>
+ </Compile>
+ <Compile Include="..\tsip_invite_event_type_t.cs">
+ <Link>tsip_invite_event_type_t.cs</Link>
+ </Compile>
+ <Compile Include="..\tsip_message_event_type_t.cs">
+ <Link>tsip_message_event_type_t.cs</Link>
+ </Compile>
+ <Compile Include="..\tsip_options_event_type_t.cs">
+ <Link>tsip_options_event_type_t.cs</Link>
+ </Compile>
+ <Compile Include="..\tsip_publish_event_type_t.cs">
+ <Link>tsip_publish_event_type_t.cs</Link>
+ </Compile>
+ <Compile Include="..\tsip_register_event_type_t.cs">
+ <Link>tsip_register_event_type_t.cs</Link>
+ </Compile>
+ <Compile Include="..\tsip_subscribe_event_type_t.cs">
+ <Link>tsip_subscribe_event_type_t.cs</Link>
+ </Compile>
+ <Compile Include="..\XcapCallback.cs">
+ <Link>XcapCallback.cs</Link>
+ </Compile>
+ <Compile Include="..\XcapEvent.cs">
+ <Link>XcapEvent.cs</Link>
+ </Compile>
+ <Compile Include="..\XcapMessage.cs">
+ <Link>XcapMessage.cs</Link>
+ </Compile>
+ <Compile Include="..\XcapSelector.cs">
+ <Link>XcapSelector.cs</Link>
+ </Compile>
+ <Compile Include="..\XcapStack.cs">
+ <Link>XcapStack.cs</Link>
+ </Compile>
+ <Compile Include="Program.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project> \ No newline at end of file
OpenPOWER on IntegriCloud