]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Creating FreeSwitch.NET project, this is by no means complete yet but too many people...
authorJames Green <james.green@stealthnet.net>
Wed, 13 Sep 2006 15:31:28 +0000 (15:31 +0000)
committerJames Green <james.green@stealthnet.net>
Wed, 13 Sep 2006 15:31:28 +0000 (15:31 +0000)
to keep it under wraps much longer! Feel free to pay me to work on this if it's in your businesses
interests, I need a job ;) Documentation, more code and examples will be on its way soon.

Email the list if there's any questions, i'd love to help people get started helping development.

- james@nerdc0re.com

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2682 d0543943-73ff-0310-b7d9-9358b9ac24b2

72 files changed:
src/dotnet/dotnet/Common.cs [new file with mode: 0755]
src/dotnet/dotnet/FreeSwitch.NET.csproj [new file with mode: 0755]
src/dotnet/dotnet/Makefile [new file with mode: 0644]
src/dotnet/dotnet/Marshaling/BufferMarshaler.cs [new file with mode: 0755]
src/dotnet/dotnet/Marshaling/CallerExtensionMarshaler.cs [new file with mode: 0755]
src/dotnet/dotnet/Marshaling/CallerProfileMarshaler.cs [new file with mode: 0755]
src/dotnet/dotnet/Marshaling/ChannelMarshaler.cs [new file with mode: 0755]
src/dotnet/dotnet/Marshaling/ChannelTimetableMarshaler.cs [new file with mode: 0755]
src/dotnet/dotnet/Marshaling/CoreSessionMarshaler.cs [new file with mode: 0755]
src/dotnet/dotnet/Marshaling/EventMarshaler.cs [new file with mode: 0755]
src/dotnet/dotnet/Marshaling/FileHandleMarshaler.cs [new file with mode: 0755]
src/dotnet/dotnet/Marshaling/MemoryPoolMarshaler.cs [new file with mode: 0755]
src/dotnet/dotnet/Marshaling/StreamHandleMarshaler.cs [new file with mode: 0755]
src/dotnet/dotnet/Marshaling/Types/ApiInterfaceMarshal.cs [new file with mode: 0755]
src/dotnet/dotnet/Marshaling/Types/ApplicationInterfaceMarshal.cs [new file with mode: 0755]
src/dotnet/dotnet/Marshaling/Types/BufferMarshal.cs [new file with mode: 0755]
src/dotnet/dotnet/Marshaling/Types/CallerExtensionMarshal.cs [new file with mode: 0755]
src/dotnet/dotnet/Marshaling/Types/CallerProfileMarshal.cs [new file with mode: 0755]
src/dotnet/dotnet/Marshaling/Types/ChannelFlagMarshal.cs [new file with mode: 0755]
src/dotnet/dotnet/Marshaling/Types/ChannelMarshal.cs [new file with mode: 0755]
src/dotnet/dotnet/Marshaling/Types/ChannelStateMarshal.cs [new file with mode: 0755]
src/dotnet/dotnet/Marshaling/Types/ChannelTimetableMarshal.cs [new file with mode: 0755]
src/dotnet/dotnet/Marshaling/Types/CodecImplementationMarshal.cs [new file with mode: 0755]
src/dotnet/dotnet/Marshaling/Types/CodecInterfaceMarshal.cs [new file with mode: 0755]
src/dotnet/dotnet/Marshaling/Types/CodecMarshal.cs [new file with mode: 0755]
src/dotnet/dotnet/Marshaling/Types/CodecTypeMarshal.cs [new file with mode: 0755]
src/dotnet/dotnet/Marshaling/Types/CoreSessionMarshal.cs [new file with mode: 0755]
src/dotnet/dotnet/Marshaling/Types/EventMarshal.cs [new file with mode: 0755]
src/dotnet/dotnet/Marshaling/Types/FileHandleMarshal.cs [new file with mode: 0755]
src/dotnet/dotnet/Marshaling/Types/FrameMarshal.cs [new file with mode: 0755]
src/dotnet/dotnet/Marshaling/Types/IOEventHooksMarshal.cs [new file with mode: 0755]
src/dotnet/dotnet/Marshaling/Types/LoadableModuleInterfaceMarshal.cs [new file with mode: 0755]
src/dotnet/dotnet/Marshaling/Types/LoadableModuleMarshal.cs [new file with mode: 0755]
src/dotnet/dotnet/Marshaling/Types/StreamHandleMarshal.cs [new file with mode: 0755]
src/dotnet/dotnet/Marshaling/Types/TypesMarshal.cs [new file with mode: 0755]
src/dotnet/dotnet/Module.cs [new file with mode: 0644]
src/dotnet/dotnet/Modules/Api.cs [new file with mode: 0755]
src/dotnet/dotnet/Modules/Application.cs [new file with mode: 0755]
src/dotnet/dotnet/Properties/AssemblyInfo.cs [new file with mode: 0644]
src/dotnet/dotnet/Switch/CallerProfile.cs [new file with mode: 0755]
src/dotnet/dotnet/Switch/Channel.cs [new file with mode: 0755]
src/dotnet/dotnet/Switch/Console.cs [new file with mode: 0644]
src/dotnet/dotnet/Switch/CoreSession.cs [new file with mode: 0755]
src/dotnet/dotnet/Switch/Ivr.cs [new file with mode: 0755]
src/dotnet/dotnet/Switch/LoadableModule.cs [new file with mode: 0755]
src/dotnet/dotnet/Switch/StreamHandle.cs [new file with mode: 0755]
src/dotnet/dotnet/Types/ApiFunction.cs [new file with mode: 0755]
src/dotnet/dotnet/Types/ApplicationFunction.cs [new file with mode: 0755]
src/dotnet/dotnet/Types/ApplicationInterface.cs [new file with mode: 0755]
src/dotnet/dotnet/Types/Buffer.cs [new file with mode: 0755]
src/dotnet/dotnet/Types/CallCause.cs [new file with mode: 0755]
src/dotnet/dotnet/Types/CallerExtension.cs [new file with mode: 0755]
src/dotnet/dotnet/Types/CallerProfile.cs [new file with mode: 0755]
src/dotnet/dotnet/Types/Channel.cs [new file with mode: 0755]
src/dotnet/dotnet/Types/ChannelFlag.cs [new file with mode: 0755]
src/dotnet/dotnet/Types/ChannelState.cs [new file with mode: 0755]
src/dotnet/dotnet/Types/ChannelTimetable.cs [new file with mode: 0755]
src/dotnet/dotnet/Types/CoreSession.cs [new file with mode: 0755]
src/dotnet/dotnet/Types/DtmfCallbackFunction.cs [new file with mode: 0755]
src/dotnet/dotnet/Types/Event.cs [new file with mode: 0755]
src/dotnet/dotnet/Types/FileHandle.cs [new file with mode: 0755]
src/dotnet/dotnet/Types/InputCallbackFunction.cs [new file with mode: 0755]
src/dotnet/dotnet/Types/InputType.cs [new file with mode: 0755]
src/dotnet/dotnet/Types/LoadableModule.cs [new file with mode: 0755]
src/dotnet/dotnet/Types/LoadableModuleInterface.cs [new file with mode: 0755]
src/dotnet/dotnet/Types/MemoryPool.cs [new file with mode: 0755]
src/dotnet/dotnet/Types/Module.cs [new file with mode: 0755]
src/dotnet/dotnet/Types/ModuleInterfaces.cs [new file with mode: 0755]
src/dotnet/dotnet/Types/Status.cs [new file with mode: 0755]
src/dotnet/dotnet/Types/StreamHandle.cs [new file with mode: 0755]
src/dotnet/dotnet/Types/TextChannel.cs [new file with mode: 0755]
src/dotnet/dotnet/public.snk [new file with mode: 0644]

diff --git a/src/dotnet/dotnet/Common.cs b/src/dotnet/dotnet/Common.cs
new file mode 100755 (executable)
index 0000000..aa3849e
--- /dev/null
@@ -0,0 +1,75 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * Common.cs -- 
+ *
+ */\r
+using System;\r
+using System.Reflection;\r
+\r
+namespace FreeSwitch.NET\r
+{\r
+    public class Common\r
+    {\r
+        public static void DumpHex(string label, IntPtr pointer, int length)\r
+        {\r
+            Console.WriteLine("DUMP-{0}:", label);\r
+\r
+            DumpHex(pointer, length);\r
+        }\r
+\r
+        public static void DumpProperties(string label, object dumpObject)\r
+        {\r
+            Type type = dumpObject.GetType();\r
+            PropertyInfo[] properties = type.GetProperties();\r
+\r
+            foreach (PropertyInfo p in properties)\r
+            {\r
+                Console.WriteLine("%%% - {0}: {1}:{2}", label, p.Name, p.GetValue(dumpObject, null));\r
+            }\r
+        }\r
+\r
+        public static void DumpHex(IntPtr pointer, int length)\r
+        {\r
+            if (pointer == IntPtr.Zero)\r
+                throw new NullReferenceException();\r
+\r
+            for (int i = 0; i < length; i++)\r
+            {\r
+                IntPtr offset = new IntPtr(pointer.ToInt32() + i);\r
+\r
+                if (i % 20 == 0)\r
+                    Console.Write("\n0x{0:x}: ", offset.ToInt32());\r
+\r
+                Console.Write("{0:x2} ", System.Runtime.InteropServices.Marshal.ReadByte(offset));\r
+            }\r
+\r
+            Console.WriteLine("\n");\r
+        }\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/FreeSwitch.NET.csproj b/src/dotnet/dotnet/FreeSwitch.NET.csproj
new file mode 100755 (executable)
index 0000000..872a79a
--- /dev/null
@@ -0,0 +1,126 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <PropertyGroup>\r
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
+    <ProductVersion>8.0.50727</ProductVersion>\r
+    <SchemaVersion>2.0</SchemaVersion>\r
+    <ProjectGuid>{251CAABC-16C3-4593-A491-603B908094E0}</ProjectGuid>\r
+    <OutputType>Library</OutputType>\r
+    <AppDesignerFolder>Properties</AppDesignerFolder>\r
+    <RootNamespace>FreeSwitch.NET</RootNamespace>\r
+    <AssemblyName>Freeswitch</AssemblyName>\r
+    <StartupObject>\r
+    </StartupObject>\r
+    <SignAssembly>true</SignAssembly>\r
+    <AssemblyOriginatorKeyFile>public.snk</AssemblyOriginatorKeyFile>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
+    <DebugSymbols>true</DebugSymbols>\r
+    <DebugType>full</DebugType>\r
+    <Optimize>false</Optimize>\r
+    <OutputPath>bin\Debug\</OutputPath>\r
+    <DefineConstants>DEBUG;TRACE</DefineConstants>\r
+    <ErrorReport>prompt</ErrorReport>\r
+    <WarningLevel>4</WarningLevel>\r
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
+    <DebugType>pdbonly</DebugType>\r
+    <Optimize>true</Optimize>\r
+    <OutputPath>bin\Release\</OutputPath>\r
+    <DefineConstants>TRACE</DefineConstants>\r
+    <ErrorReport>prompt</ErrorReport>\r
+    <WarningLevel>4</WarningLevel>\r
+  </PropertyGroup>\r
+  <ItemGroup>\r
+    <Reference Include="System" />\r
+    <Reference Include="System.Data" />\r
+    <Reference Include="System.Deployment" />\r
+    <Reference Include="System.Drawing" />\r
+    <Reference Include="System.Windows.Forms" />\r
+    <Reference Include="System.Xml" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <Compile Include="Common.cs" />\r
+    <Compile Include="Marshaling\BufferMarshaler.cs" />\r
+    <Compile Include="Marshaling\CallerExtensionMarshaler.cs" />\r
+    <Compile Include="Marshaling\CallerProfileMarshaler.cs" />\r
+    <Compile Include="Marshaling\ChannelMarshaler.cs" />\r
+    <Compile Include="Marshaling\ChannelTimetableMarshaler.cs" />\r
+    <Compile Include="Marshaling\StreamHandleMarshaler.cs" />\r
+    <Compile Include="Marshaling\CoreSessionMarshaler.cs" />\r
+    <Compile Include="Marshaling\EventMarshaler.cs" />\r
+    <Compile Include="Marshaling\MemoryPoolMarshaler.cs" />\r
+    <Compile Include="Marshaling\Types\BufferMarshal.cs" />\r
+    <Compile Include="Marshaling\Types\CallerExtensionMarshal.cs" />\r
+    <Compile Include="Marshaling\Types\CallerProfileMarshal.cs" />\r
+    <Compile Include="Marshaling\FileHandleMarshaler.cs" />\r
+    <Compile Include="Marshaling\Types\ChannelFlagMarshal.cs" />\r
+    <Compile Include="Marshaling\Types\ChannelMarshal.cs" />\r
+    <Compile Include="Marshaling\Types\ChannelStateMarshal.cs" />\r
+    <Compile Include="Marshaling\Types\ChannelTimetableMarshal.cs" />\r
+    <Compile Include="Marshaling\Types\ApplicationInterfaceMarshal.cs" />\r
+    <Compile Include="Marshaling\Types\ApiInterfaceMarshal.cs" />\r
+    <Compile Include="Marshaling\Types\CodecImplementationMarshal.cs" />\r
+    <Compile Include="Marshaling\Types\CodecInterfaceMarshal.cs" />\r
+    <Compile Include="Marshaling\Types\CodecMarshal.cs" />\r
+    <Compile Include="Marshaling\Types\CodecTypeMarshal.cs" />\r
+    <Compile Include="Marshaling\Types\StreamHandleMarshal.cs" />\r
+    <Compile Include="Marshaling\Types\TypesMarshal.cs" />\r
+    <Compile Include="Marshaling\Types\FileHandleMarshal.cs" />\r
+    <Compile Include="Marshaling\Types\LoadableModuleInterfaceMarshal.cs" />\r
+    <Compile Include="Marshaling\Types\LoadableModuleMarshal.cs" />\r
+    <Compile Include="Marshaling\Types\CoreSessionMarshal.cs" />\r
+    <Compile Include="Marshaling\Types\EventMarshal.cs" />\r
+    <Compile Include="Marshaling\Types\FrameMarshal.cs" />\r
+    <Compile Include="Marshaling\Types\IOEventHooksMarshal.cs" />\r
+    <Compile Include="Module.cs" />\r
+    <Compile Include="Properties\AssemblyInfo.cs" />\r
+    <Compile Include="Switch\CallerProfile.cs" />\r
+    <Compile Include="Switch\Channel.cs" />\r
+    <Compile Include="Switch\Console.cs" />\r
+    <Compile Include="Switch\StreamHandle.cs" />\r
+    <Compile Include="Switch\CoreSession.cs" />\r
+    <Compile Include="Switch\Ivr.cs" />\r
+    <Compile Include="Switch\LoadableModule.cs" />\r
+    <Compile Include="Modules\Api.cs" />\r
+    <Compile Include="Types\ApiFunction.cs" />\r
+    <Compile Include="Types\ApplicationInterface.cs" />\r
+    <Compile Include="Types\Buffer.cs" />\r
+    <Compile Include="Types\CallerExtension.cs" />\r
+    <Compile Include="Types\CallerProfile.cs" />\r
+    <Compile Include="Types\Channel.cs" />\r
+    <Compile Include="Types\ChannelFlag.cs" />\r
+    <Compile Include="Types\ChannelState.cs" />\r
+    <Compile Include="Types\ChannelTimetable.cs" />\r
+    <Compile Include="Modules\Application.cs" />\r
+    <Compile Include="Types\ApplicationFunction.cs" />\r
+    <Compile Include="Types\CallCause.cs" />\r
+    <Compile Include="Types\InputCallbackFunction.cs" />\r
+    <Compile Include="Types\InputType.cs" />\r
+    <Compile Include="Types\ModuleInterfaces.cs" />\r
+    <Compile Include="Types\StreamHandle.cs" />\r
+    <Compile Include="Types\Module.cs" />\r
+    <Compile Include="Types\DtmfCallbackFunction.cs" />\r
+    <Compile Include="Types\FileHandle.cs" />\r
+    <Compile Include="Types\MemoryPool.cs" />\r
+    <Compile Include="Types\LoadableModule.cs" />\r
+    <Compile Include="Types\LoadableModuleInterface.cs" />\r
+    <Compile Include="Types\TextChannel.cs" />\r
+    <Compile Include="Types\CoreSession.cs" />\r
+    <Compile Include="Types\Event.cs" />\r
+    <Compile Include="Types\Status.cs" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="Makefile" />\r
+    <None Include="public.snk" />\r
+  </ItemGroup>\r
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />\r
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
+       Other similar extension points exist, see Microsoft.Common.targets.\r
+  <Target Name="BeforeBuild">\r
+  </Target>\r
+  <Target Name="AfterBuild">\r
+  </Target>\r
+  -->\r
+</Project>
\ No newline at end of file
diff --git a/src/dotnet/dotnet/Makefile b/src/dotnet/dotnet/Makefile
new file mode 100644 (file)
index 0000000..07b0b92
--- /dev/null
@@ -0,0 +1,78 @@
+all: $(MODNAME).so 
+
+$(MODNAME).so:
+       gmcs -debug -unsafe -t:library -keyfile:public.snk \
+       -out:Freeswitch.dll -reference:Mono.Posix.dll \
+       Properties/AssemblyInfo.cs \
+       Marshaling/Types/ApiInterfaceMarshal.cs \
+       Marshaling/Types/ApplicationInterfaceMarshal.cs \
+       Marshaling/Types/BufferMarshal.cs \
+       Marshaling/Types/CallerExtensionMarshal.cs \
+       Marshaling/Types/CallerProfileMarshal.cs \
+       Marshaling/Types/ChannelFlagMarshal.cs \
+       Marshaling/Types/ChannelMarshal.cs \
+       Marshaling/Types/ChannelStateMarshal.cs \
+       Marshaling/Types/ChannelTimetableMarshal.cs \
+       Marshaling/Types/CodecImplementationMarshal.cs \
+       Marshaling/Types/CodecInterfaceMarshal.cs \
+       Marshaling/Types/CodecMarshal.cs \
+       Marshaling/Types/CodecTypeMarshal.cs \
+       Marshaling/Types/CoreSessionMarshal.cs \
+       Marshaling/Types/EventMarshal.cs \
+       Marshaling/Types/FileHandleMarshal.cs \
+       Marshaling/Types/FrameMarshal.cs \
+       Marshaling/Types/IOEventHooksMarshal.cs \
+       Marshaling/Types/LoadableModuleInterfaceMarshal.cs \
+       Marshaling/Types/LoadableModuleMarshal.cs \
+       Marshaling/Types/TypesMarshal.cs \
+       Marshaling/BufferMarshaler.cs \
+       Marshaling/CallerExtensionMarshaler.cs \
+       Marshaling/CallerProfileMarshaler.cs \
+       Marshaling/ChannelMarshaler.cs \
+       Marshaling/ChannelTimetableMarshaler.cs \
+       Marshaling/CoreSessionMarshaler.cs \
+       Marshaling/EventMarshaler.cs \
+       Marshaling/FileHandleMarshaler.cs \
+       Marshaling/MemoryPoolMarshaler.cs \
+       Marshaling/StreamHandleMarshaler.cs \
+       Modules/Api.cs \
+       Modules/Application.cs \
+       Switch/CallerProfile.cs \
+       Switch/Channel.cs \
+       Switch/Console.cs \
+       Switch/CoreSession.cs \
+       Switch/Ivr.cs \
+       Switch/LoadableModule.cs \
+       Switch/StreamHandle.cs \
+       Types/ApiFunction.cs \
+       Types/ApplicationFunction.cs \
+       Types/ApplicationInterface.cs \
+       Types/Buffer.cs \
+       Types/CallCause.cs \
+       Types/CallerExtension.cs \
+       Types/CallerProfile.cs \
+       Types/Channel.cs \
+       Types/ChannelFlag.cs \
+       Types/ChannelState.cs \
+       Types/ChannelTimetable.cs \
+       Types/CoreSession.cs \
+       Types/DtmfCallbackFunction.cs \
+       Types/Event.cs \
+       Types/FileHandle.cs \
+       Types/LoadableModule.cs \
+       Types/LoadableModuleInterface.cs \
+       Types/MemoryPool.cs \
+       Types/Module.cs \
+       Types/Status.cs \
+       Types/StreamHandle.cs \
+       Types/TextChannel.cs \
+       Common.cs \
+       Core.cs \
+       Ivr.cs \
+       Module.cs \
+       
+clean:
+       rm -fr *.dll
+
+install:
+       cp -f Freeswitch.dll /usr/local/freeswitch/lib/
diff --git a/src/dotnet/dotnet/Marshaling/BufferMarshaler.cs b/src/dotnet/dotnet/Marshaling/BufferMarshaler.cs
new file mode 100755 (executable)
index 0000000..4cde49d
--- /dev/null
@@ -0,0 +1,80 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * BufferMarshaler.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Marshaling.Types;\r
+using FreeSwitch.NET.Types;\r
+\r
+namespace FreeSwitch.NET.Marshaling\r
+{\r
+    class BufferMarshaler : ICustomMarshaler\r
+    {\r
+        private static BufferMarshaler Instance = new BufferMarshaler();\r
+\r
+        public static ICustomMarshaler GetInstance(string s)\r
+        {\r
+            return Instance;\r
+        }\r
+\r
+        public void CleanUpManagedData(object o)\r
+        {\r
+        }\r
+\r
+        public void CleanUpNativeData(IntPtr pNativeData)\r
+        {\r
+        }\r
+\r
+        public int GetNativeDataSize()\r
+        {\r
+            return IntPtr.Size;\r
+        }\r
+\r
+        public IntPtr MarshalManagedToNative(object obj)\r
+        {\r
+            FreeSwitch.NET.Types.Buffer buffer = (FreeSwitch.NET.Types.Buffer)obj;\r
+\r
+            return buffer.marshaledObject.Handle;\r
+        }\r
+\r
+        public object MarshalNativeToManaged(IntPtr bufferPtr)\r
+        {\r
+            FreeSwitch.NET.Types.Buffer buffer        = new FreeSwitch.NET.Types.Buffer();\r
+            BufferMarshal           bufferMarshal = new BufferMarshal();\r
+\r
+            Marshal.PtrToStructure(bufferPtr, bufferMarshal);\r
+\r
+            buffer.marshaledObject = new HandleRef(bufferMarshal, bufferPtr);\r
+\r
+            return buffer;\r
+        }\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Marshaling/CallerExtensionMarshaler.cs b/src/dotnet/dotnet/Marshaling/CallerExtensionMarshaler.cs
new file mode 100755 (executable)
index 0000000..e3d9c28
--- /dev/null
@@ -0,0 +1,80 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * CallerExtensionMarshaler.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Types;\r
+using FreeSwitch.NET.Marshaling.Types;\r
+\r
+namespace FreeSwitch.NET.Marshaling\r
+{\r
+    class CallerExtensionMarshaler : ICustomMarshaler\r
+    {\r
+        private static CallerExtensionMarshaler Instance = new CallerExtensionMarshaler();\r
+\r
+        public static ICustomMarshaler GetInstance(string s)\r
+        {\r
+            return Instance;\r
+        }\r
+\r
+        public void CleanUpManagedData(object o)\r
+        {\r
+        }\r
+\r
+        public void CleanUpNativeData(IntPtr pNativeData)\r
+        {\r
+        }\r
+\r
+        public int GetNativeDataSize()\r
+        {\r
+            return IntPtr.Size;\r
+        }\r
+\r
+        public IntPtr MarshalManagedToNative(object obj)\r
+        {\r
+            CallerExtension callerExtension = (CallerExtension)obj;\r
+\r
+            return callerExtension.marshaledObject.Handle;\r
+        }\r
+\r
+        public object MarshalNativeToManaged(IntPtr callerExtensionPtr)\r
+        {\r
+            CallerExtensionMarshal callerExtensionMarshal = new CallerExtensionMarshal();\r
+            CallerExtension        callerExtension        = new CallerExtension();\r
+\r
+            Marshal.PtrToStructure(callerExtensionPtr, callerExtensionMarshal);\r
+\r
+            callerExtension.marshaledObject = new HandleRef(callerExtensionMarshal, callerExtensionPtr);\r
+\r
+            return callerExtension;\r
+        }\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Marshaling/CallerProfileMarshaler.cs b/src/dotnet/dotnet/Marshaling/CallerProfileMarshaler.cs
new file mode 100755 (executable)
index 0000000..a8eaded
--- /dev/null
@@ -0,0 +1,81 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * CallerProfileMarshaler.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Types;\r
+using FreeSwitch.NET.Marshaling.Types;\r
+\r
+namespace FreeSwitch.NET.Marshaling\r
+{\r
+    class CallerProfileMarshaler : ICustomMarshaler\r
+    {\r
+\r
+        private static CallerProfileMarshaler Instance = new CallerProfileMarshaler();\r
+\r
+        public static ICustomMarshaler GetInstance(string s)\r
+        {\r
+            return Instance;\r
+        }\r
+\r
+        public void CleanUpManagedData(object o)\r
+        {\r
+        }\r
+\r
+        public void CleanUpNativeData(IntPtr pNativeData)\r
+        {\r
+        }\r
+\r
+        public int GetNativeDataSize()\r
+        {\r
+            return IntPtr.Size;\r
+        }\r
+\r
+        public IntPtr MarshalManagedToNative(object obj)\r
+        {\r
+            CallerProfile callerProfile = (CallerProfile) obj;\r
+\r
+            return callerProfile.marshaledObject.Handle;\r
+        }\r
+\r
+        public object MarshalNativeToManaged(IntPtr callerProfilePtr)\r
+        {\r
+            CallerProfileMarshal callerProfileMarshal = new CallerProfileMarshal();\r
+            CallerProfile        callerProfile        = new CallerProfile();\r
+\r
+            Marshal.PtrToStructure(callerProfilePtr, callerProfileMarshal);\r
+\r
+            callerProfile.marshaledObject = new HandleRef(callerProfileMarshal, callerProfilePtr);\r
+\r
+            return callerProfile;\r
+        }\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Marshaling/ChannelMarshaler.cs b/src/dotnet/dotnet/Marshaling/ChannelMarshaler.cs
new file mode 100755 (executable)
index 0000000..f72e59e
--- /dev/null
@@ -0,0 +1,80 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * ChannelMarshaler.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Types;\r
+using FreeSwitch.NET.Marshaling.Types;\r
+\r
+namespace FreeSwitch.NET.Marshaling\r
+{\r
+    class ChannelMarshaler : ICustomMarshaler\r
+    {\r
+        private static ChannelMarshaler Instance = new ChannelMarshaler();\r
+\r
+        public static ICustomMarshaler GetInstance(string s)\r
+        {\r
+            return Instance;\r
+        }\r
+\r
+        public void CleanUpManagedData(object o)\r
+        {\r
+        }\r
+\r
+        public void CleanUpNativeData(IntPtr pNativeData)\r
+        {\r
+        }\r
+\r
+        public int GetNativeDataSize()\r
+        {\r
+            return IntPtr.Size;\r
+        }\r
+\r
+        public IntPtr MarshalManagedToNative(object obj)\r
+        {\r
+            Channel channel = (Channel) obj;\r
+\r
+            return channel.marshaledObject.Handle;\r
+        }\r
+\r
+        public object MarshalNativeToManaged(IntPtr ptr)\r
+        {\r
+            ChannelMarshal channelMarshal = new ChannelMarshal();\r
+            Channel        channel        = new Channel();\r
+\r
+            Marshal.PtrToStructure(ptr, channelMarshal);\r
+\r
+            channel.marshaledObject = new HandleRef(channelMarshal, ptr);\r
+\r
+            return channel;\r
+        }\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Marshaling/ChannelTimetableMarshaler.cs b/src/dotnet/dotnet/Marshaling/ChannelTimetableMarshaler.cs
new file mode 100755 (executable)
index 0000000..a05456d
--- /dev/null
@@ -0,0 +1,80 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * ChannelTimetableMarshaler.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Types;\r
+using FreeSwitch.NET.Marshaling.Types;\r
+\r
+namespace FreeSwitch.NET.Marshaling\r
+{\r
+    class ChannelTimetableMarshaler : ICustomMarshaler\r
+    {\r
+        private static ChannelTimetableMarshaler Instance = new ChannelTimetableMarshaler();\r
+\r
+        public static ICustomMarshaler GetInstance(string s)\r
+        {\r
+            return Instance;\r
+        }\r
+\r
+        public void CleanUpManagedData(object o)\r
+        {\r
+        }\r
+\r
+        public void CleanUpNativeData(IntPtr pNativeData)\r
+        {\r
+        }\r
+\r
+        public int GetNativeDataSize()\r
+        {\r
+            return IntPtr.Size;\r
+        }\r
+\r
+        public IntPtr MarshalManagedToNative(object obj)\r
+        {\r
+            ChannelTimetable channelTimetable = (ChannelTimetable)obj;\r
+\r
+            return channelTimetable.marshaledObject.Handle;\r
+        }\r
+\r
+        public object MarshalNativeToManaged(IntPtr channelTimetablePtr)\r
+        {\r
+            ChannelTimetableMarshal channelTimetableMarshal = new ChannelTimetableMarshal();\r
+            ChannelTimetable        channelTimetable        = new ChannelTimetable();\r
+\r
+            Marshal.PtrToStructure(channelTimetablePtr, channelTimetableMarshal);\r
+\r
+            channelTimetable.marshaledObject = new HandleRef(channelTimetableMarshal, channelTimetablePtr);\r
+\r
+            return channelTimetable;\r
+        }\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Marshaling/CoreSessionMarshaler.cs b/src/dotnet/dotnet/Marshaling/CoreSessionMarshaler.cs
new file mode 100755 (executable)
index 0000000..29e1fd8
--- /dev/null
@@ -0,0 +1,80 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * CoreSessionMarshaler.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Types;\r
+using FreeSwitch.NET.Marshaling.Types;\r
+\r
+namespace FreeSwitch.NET.Marshaling\r
+{\r
+    class CoreSessionMarshaler : ICustomMarshaler\r
+    {\r
+        private static CoreSessionMarshaler Instance = new CoreSessionMarshaler();\r
+\r
+        public static ICustomMarshaler GetInstance(string s)\r
+        {\r
+            return Instance;\r
+        }\r
+\r
+        public void CleanUpManagedData(object o)\r
+        {\r
+        }\r
+\r
+        public void CleanUpNativeData(IntPtr pNativeData)\r
+        {\r
+        }\r
+\r
+        public int GetNativeDataSize()\r
+        {\r
+            return IntPtr.Size;\r
+        }\r
+\r
+        public IntPtr MarshalManagedToNative(object obj)\r
+        {\r
+            CoreSession coreSession = (CoreSession)obj;\r
+            \r
+            return coreSession.marshaledObject.Handle;\r
+        }\r
+\r
+        public object MarshalNativeToManaged(IntPtr coreSessionPtr)\r
+        {\r
+            CoreSessionMarshal coreSessionMarshal = new CoreSessionMarshal();\r
+            CoreSession        coreSession        = new CoreSession();\r
+\r
+            Marshal.PtrToStructure(coreSessionPtr, coreSessionMarshal);\r
+\r
+            coreSession.marshaledObject = new HandleRef(coreSessionMarshal, coreSessionPtr);\r
+\r
+            return coreSession;\r
+        }\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Marshaling/EventMarshaler.cs b/src/dotnet/dotnet/Marshaling/EventMarshaler.cs
new file mode 100755 (executable)
index 0000000..c23f7a5
--- /dev/null
@@ -0,0 +1,81 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * EventMarshaler.cs -- 
+ *
+ */\r
+using System;\r
+using System.Collections;\r
+using FreeSwitch.NET.Marshaling.Types;\r
+using FreeSwitch.NET.Types;\r
+using System.Runtime.InteropServices;\r
+\r
+namespace FreeSwitch.NET.Marshaling\r
+{\r
+    class EventMarshaler : ICustomMarshaler\r
+    {\r
+        private static EventMarshaler Instance = new EventMarshaler();\r
+\r
+        public static ICustomMarshaler GetInstance(string s)\r
+        {\r
+            return Instance;\r
+        }\r
+\r
+        public void CleanUpManagedData(object o)\r
+        {\r
+        }\r
+\r
+        public void CleanUpNativeData(IntPtr pNativeData)\r
+        {\r
+        }\r
+\r
+        public int GetNativeDataSize()\r
+        {\r
+            return IntPtr.Size;\r
+        }\r
+\r
+        public IntPtr MarshalManagedToNative(object obj)\r
+        {\r
+            Event eventObj = (Event)obj;\r
+\r
+            return eventObj.marshaledObject.Handle;\r
+        }\r
+\r
+        public object MarshalNativeToManaged(IntPtr eventPtr)\r
+        {\r
+            EventMarshal eventMarshal = new EventMarshal();\r
+            Event        eventObj     = new Event();\r
+\r
+            Marshal.PtrToStructure(eventPtr, eventMarshal);\r
+\r
+            eventObj.marshaledObject = new HandleRef(eventMarshal, eventPtr);\r
+\r
+            return eventObj;\r
+        }\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Marshaling/FileHandleMarshaler.cs b/src/dotnet/dotnet/Marshaling/FileHandleMarshaler.cs
new file mode 100755 (executable)
index 0000000..1c432aa
--- /dev/null
@@ -0,0 +1,78 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * FileHandleMarshaler.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Types;\r
+using FreeSwitch.NET.Marshaling.Types;\r
+\r
+namespace FreeSwitch.NET.Marshaling\r
+{\r
+    class FileHandleMarshaler : ICustomMarshaler\r
+    {\r
+        private static FileHandleMarshaler Instance = new FileHandleMarshaler();\r
+\r
+        public static ICustomMarshaler GetInstance(string s)\r
+        {\r
+            return Instance;\r
+        }\r
+\r
+        public void CleanUpManagedData(object o)\r
+        {\r
+        }\r
+\r
+        public void CleanUpNativeData(IntPtr pNativeData)\r
+        {\r
+        }\r
+\r
+        public int GetNativeDataSize()\r
+        {\r
+            return IntPtr.Size;\r
+        }\r
+\r
+        public IntPtr MarshalManagedToNative(object obj)\r
+        {\r
+            FileHandle fileHandle = (FileHandle)obj;\r
+\r
+            return fileHandle.marshaledObject.Handle;\r
+        }\r
+\r
+        public object MarshalNativeToManaged(IntPtr file_handle)\r
+        {\r
+            FileHandleMarshal fileHandleMarshal = new FileHandleMarshal();\r
+            FileHandle        fileHandle        = new FileHandle();\r
+\r
+            fileHandle.marshaledObject = new HandleRef(fileHandleMarshal, file_handle);\r
+\r
+            return fileHandle;\r
+        }\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Marshaling/MemoryPoolMarshaler.cs b/src/dotnet/dotnet/Marshaling/MemoryPoolMarshaler.cs
new file mode 100755 (executable)
index 0000000..c71e72d
--- /dev/null
@@ -0,0 +1,77 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * MemoryPoolMarshaler.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Types;\r
+using FreeSwitch.NET.Marshaling.Types;\r
+\r
+namespace FreeSwitch.NET.Marshaling\r
+{\r
+    class MemoryPoolMarshaler : ICustomMarshaler\r
+    {\r
+        private static MemoryPoolMarshaler Instance = new MemoryPoolMarshaler();\r
+\r
+        public static ICustomMarshaler GetInstance(string s)\r
+        {\r
+            return Instance;\r
+        }\r
+\r
+        public void CleanUpManagedData(object o)\r
+        {\r
+        }\r
+\r
+        public void CleanUpNativeData(IntPtr pNativeData)\r
+        {\r
+        }\r
+\r
+        public int GetNativeDataSize()\r
+        {\r
+            return IntPtr.Size;\r
+        }\r
+\r
+        public IntPtr MarshalManagedToNative(object obj)\r
+        {\r
+            MemoryPool memoryPool = (MemoryPool) obj;\r
+            \r
+            return memoryPool.marshaledObject.Handle;\r
+        }\r
+\r
+        public object MarshalNativeToManaged(IntPtr pool)\r
+        {\r
+            MemoryPool memoryPool = new MemoryPool();\r
+\r
+            memoryPool.marshaledObject = new HandleRef(new IntPtr(), pool);\r
+\r
+            return memoryPool;\r
+        }\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Marshaling/StreamHandleMarshaler.cs b/src/dotnet/dotnet/Marshaling/StreamHandleMarshaler.cs
new file mode 100755 (executable)
index 0000000..cd44856
--- /dev/null
@@ -0,0 +1,81 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * StreamHandleMarshaler.cs -- 
+ *
+ */\r
+using System;\r
+using System.Collections;\r
+using FreeSwitch.NET.Marshaling.Types;\r
+using FreeSwitch.NET.Types;\r
+using System.Runtime.InteropServices;\r
+\r
+namespace FreeSwitch.NET.Marshaling\r
+{\r
+    class StreamHandleMarshaler : ICustomMarshaler\r
+    {\r
+        private static StreamHandleMarshaler Instance = new StreamHandleMarshaler();\r
+\r
+        public static ICustomMarshaler GetInstance(string s)\r
+        {\r
+            return Instance;\r
+        }\r
+\r
+        public void CleanUpManagedData(object o)\r
+        {\r
+        }\r
+\r
+        public void CleanUpNativeData(IntPtr pNativeData)\r
+        {\r
+        }\r
+\r
+        public int GetNativeDataSize()\r
+        {\r
+            return IntPtr.Size;\r
+        }\r
+\r
+        public IntPtr MarshalManagedToNative(object obj)\r
+        {\r
+            StreamHandle streamHandleObj = (StreamHandle)obj;\r
+\r
+            return streamHandleObj.marshaledObject.Handle;\r
+        }\r
+\r
+        public object MarshalNativeToManaged(IntPtr streamHandlePtr)\r
+        {\r
+            StreamHandleMarshal streamHandleMarshal = new StreamHandleMarshal();\r
+            StreamHandle        streamHandleObj     = new StreamHandle();\r
+\r
+            Marshal.PtrToStructure(streamHandlePtr, streamHandleMarshal);\r
+\r
+            streamHandleObj.marshaledObject = new HandleRef(streamHandleMarshal, streamHandlePtr);\r
+\r
+            return streamHandleObj;\r
+        }\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Marshaling/Types/ApiInterfaceMarshal.cs b/src/dotnet/dotnet/Marshaling/Types/ApiInterfaceMarshal.cs
new file mode 100755 (executable)
index 0000000..33bad12
--- /dev/null
@@ -0,0 +1,48 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * ApiInterfaceMarshal.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Types;\r
+\r
+namespace FreeSwitch.NET.Marshaling.Types\r
+{\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    internal class ApiInterfaceMarshal\r
+    {\r
+        //[MarshalAs(UnmanagedType.LPStr)]\r
+        internal IntPtr      interface_name;\r
+        //[MarshalAs(UnmanagedType.LPStr)]\r
+        internal IntPtr      desc;\r
+        internal ApiFunction function;\r
+        internal IntPtr      next;\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Marshaling/Types/ApplicationInterfaceMarshal.cs b/src/dotnet/dotnet/Marshaling/Types/ApplicationInterfaceMarshal.cs
new file mode 100755 (executable)
index 0000000..4c09cc3
--- /dev/null
@@ -0,0 +1,52 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * ApplicationInterfaceMarshal.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Types;\r
+\r
+namespace FreeSwitch.NET.Marshaling.Types\r
+{\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    internal class ApplicationInterfaceMarshal\r
+    {\r
+     //   [MarshalAs(UnmanagedType.LPStr)]\r
+        internal IntPtr              interface_name;\r
+        internal ApplicationFunction application_function;\r
+     //   [MarshalAs(UnmanagedType.LPStr)]\r
+        internal IntPtr              long_desc;\r
+        //[MarshalAs(UnmanagedType.LPStr)]\r
+        internal IntPtr              short_desc;\r
+        //[MarshalAs(UnmanagedType.LPStr)]\r
+        internal IntPtr              syntax;\r
+        internal IntPtr              next;\r
+    }\r
+}
\ No newline at end of file
diff --git a/src/dotnet/dotnet/Marshaling/Types/BufferMarshal.cs b/src/dotnet/dotnet/Marshaling/Types/BufferMarshal.cs
new file mode 100755 (executable)
index 0000000..4b91216
--- /dev/null
@@ -0,0 +1,46 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * BufferMarshal.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+\r
+namespace FreeSwitch.NET.Marshaling.Types\r
+{\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    internal class BufferMarshal\r
+    {\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        internal string data;\r
+        internal int    used;\r
+        internal int    datalen;\r
+        internal UInt32 id;\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Marshaling/Types/CallerExtensionMarshal.cs b/src/dotnet/dotnet/Marshaling/Types/CallerExtensionMarshal.cs
new file mode 100755 (executable)
index 0000000..1d1fb6f
--- /dev/null
@@ -0,0 +1,46 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * CallerExtensionMarshal.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+\r
+namespace FreeSwitch.NET.Marshaling.Types\r
+{\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    internal class CallerExtensionMarshal\r
+    {\r
+        internal IntPtr extension_name;\r
+        internal IntPtr extension_number;\r
+        internal IntPtr current_application;\r
+        internal IntPtr last_application;\r
+        internal IntPtr applications;\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Marshaling/Types/CallerProfileMarshal.cs b/src/dotnet/dotnet/Marshaling/Types/CallerProfileMarshal.cs
new file mode 100755 (executable)
index 0000000..829c2cf
--- /dev/null
@@ -0,0 +1,68 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * CallerProfileMarshal.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+\r
+namespace FreeSwitch.NET.Marshaling.Types\r
+{\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    internal class CallerProfileMarshal\r
+    {\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        internal string username;\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        internal string dialplan;\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        internal string caller_id_name;\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        internal string caller_id_number;\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        internal string network_addr;\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        internal string ani;\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        internal string ani2;\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        internal string rdnis;\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        internal string destination_number;\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        internal string source;\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        internal string chan_name;\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        internal string uuid;\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        internal string context;\r
+        internal IntPtr next;\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Marshaling/Types/ChannelFlagMarshal.cs b/src/dotnet/dotnet/Marshaling/Types/ChannelFlagMarshal.cs
new file mode 100755 (executable)
index 0000000..eeb6c79
--- /dev/null
@@ -0,0 +1,46 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * ChannelFlagMarshal.cs -- 
+ *
+ */\r
+using System;\r
+\r
+namespace FreeSwitch.NET.Marshaling.Types\r
+{\r
+    internal enum ChannelFlagMarshal\r
+    {\r
+        CF_SEND_AUDIO,\r
+        CF_RECV_AUDIO,\r
+        CF_ANSWERED,\r
+        CF_OUTBOUND,\r
+        CF_EARLY_MEDIA,\r
+        CF_ORIGINATOR,\r
+        CF_TRANSFER\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Marshaling/Types/ChannelMarshal.cs b/src/dotnet/dotnet/Marshaling/Types/ChannelMarshal.cs
new file mode 100755 (executable)
index 0000000..43d7db6
--- /dev/null
@@ -0,0 +1,66 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * ChannelMarshal.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Types;\r
+\r
+namespace FreeSwitch.NET.Marshaling.Types\r
+{\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    internal class ChannelMarshal\r
+    {\r
+        internal IntPtr       name;\r
+        internal IntPtr       dtmf_buffer;\r
+        internal IntPtr       dtmf_mutex;\r
+        internal IntPtr       flag_mutex;\r
+        internal IntPtr       profile_mutex;\r
+        internal IntPtr       session;\r
+        internal ChannelState state;\r
+        internal UInt32       flags;\r
+        internal IntPtr       caller_profile;\r
+        internal IntPtr       originator_caller_profile;\r
+        internal IntPtr       originatee_caller_profile;\r
+        internal IntPtr       caller_extension;\r
+        [MarshalAs(UnmanagedType.ByValArray, SizeConst=120)]\r
+        internal byte[]       state_handlers;\r
+        internal int          state_handler_index;\r
+        internal IntPtr       variables;\r
+        internal IntPtr       times;\r
+        internal IntPtr       private_info;\r
+        internal IntPtr       hangup_cause;\r
+        internal int          freq;\r
+        internal int          bits;\r
+        internal int          channels;\r
+        internal int          ms;\r
+        internal int          kbps;\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Marshaling/Types/ChannelStateMarshal.cs b/src/dotnet/dotnet/Marshaling/Types/ChannelStateMarshal.cs
new file mode 100755 (executable)
index 0000000..543f16c
--- /dev/null
@@ -0,0 +1,47 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * ChannelStateMarshal.cs -- 
+ *
+ */\r
+using System;\r
+\r
+namespace FreeSwitch.NET.Marshaling.Types\r
+{\r
+    internal enum ChannelStateMarshal\r
+    {\r
+        CS_NEW,\r
+        CS_INIT,\r
+        CS_RING,\r
+        CS_TRANSMIT,\r
+        CS_EXECUTE,\r
+        CS_LOOPBACK,\r
+        CS_HANGUP,\r
+        CS_DONE \r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Marshaling/Types/ChannelTimetableMarshal.cs b/src/dotnet/dotnet/Marshaling/Types/ChannelTimetableMarshal.cs
new file mode 100755 (executable)
index 0000000..088c7d7
--- /dev/null
@@ -0,0 +1,44 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * ChannelTimetableMarshal.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+\r
+namespace FreeSwitch.NET.Marshaling.Types\r
+{\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    internal class ChannelTimetableMarshal\r
+    {\r
+        internal Int64 created;\r
+        internal Int64 answered;\r
+        internal Int64 hungup;\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Marshaling/Types/CodecImplementationMarshal.cs b/src/dotnet/dotnet/Marshaling/Types/CodecImplementationMarshal.cs
new file mode 100755 (executable)
index 0000000..f8cce86
--- /dev/null
@@ -0,0 +1,54 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * CodecImplementationMarshal.cs -- 
+ *
+ */\r
+using System;\r
+using FreeSwitch.NET.Types;\r
+\r
+namespace FreeSwitch.NET.Marshaling.Types\r
+{\r
+    internal class CodecImplementationMarshal\r
+    {\r
+        internal UInt32 samples_per_seconds;\r
+        internal int    bits_per_second;\r
+        internal int    microseconds_per_frame;\r
+        internal UInt32 samples_per_frame;\r
+        internal UInt32 bytes_per_frame;\r
+        internal UInt32 encoded_bytes_per_frame;\r
+        internal Byte   number_of_channels;\r
+        internal int    pref_frames_per_packet;\r
+        internal int    max_frames_per_packet;\r
+        //internal CodecInitMarshal init;\r
+        //internal CodecEncodeMarshal encode;\r
+        //internal CodecDecode decode;\r
+        //internal CodecDestroy destroy;\r
+        internal IntPtr next;\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Marshaling/Types/CodecInterfaceMarshal.cs b/src/dotnet/dotnet/Marshaling/Types/CodecInterfaceMarshal.cs
new file mode 100755 (executable)
index 0000000..9494c4d
--- /dev/null
@@ -0,0 +1,63 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * CodecInterfaceMarshal.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Types;\r
+\r
+namespace FreeSwitch.NET.Marshaling.Types\r
+{\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    internal class CodecInterfaceMarshal\r
+    {\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        internal string interface_name;\r
+        /*\r
+        internal CodecImplementation application_function;\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        internal string              long_desc;\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        internal string              short_desc;\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        internal string              syntax;\r
+        internal IntPtr              next;\r
+}\r
+\r
+\r
+struct switch_codec_interface {
+       ! the name of the interface 
+       const char *interface_name;
+       ! a list of codec implementations related to the codec 
+       const switch_codec_implementation_t *implementations;
+       const struct switch_codec_interface *next;
+};*/\r
+    }\r
+}
\ No newline at end of file
diff --git a/src/dotnet/dotnet/Marshaling/Types/CodecMarshal.cs b/src/dotnet/dotnet/Marshaling/Types/CodecMarshal.cs
new file mode 100755 (executable)
index 0000000..9c1e62a
--- /dev/null
@@ -0,0 +1,46 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * CodecMarshal.cs -- 
+ *
+ */\r
+using System;\r
+using System.Text;\r
+\r
+namespace FreeSwitch.NET.Marshaling.Types\r
+{\r
+    internal class CodecMarshal\r
+    {\r
+        internal IntPtr codec_interface;\r
+        internal IntPtr implementation;\r
+        //internal CodecSettingsMarshal codec_settings;\r
+        internal UInt32 flags;\r
+        //internal MemoryPoolMarshal memory_pool;\r
+        internal IntPtr private_info;\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Marshaling/Types/CodecTypeMarshal.cs b/src/dotnet/dotnet/Marshaling/Types/CodecTypeMarshal.cs
new file mode 100755 (executable)
index 0000000..e8df170
--- /dev/null
@@ -0,0 +1,43 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * CodecTypeMarshal.cs -- 
+ *
+ */\r
+using System;\r
+\r
+namespace FreeSwitch.NET.Marshaling.Types\r
+{\r
+    internal enum CodecTypesMarshal\r
+    {\r
+        SWITCH_CODEC_TYPE_AUDIO,\r
+        SWITCH_CODEC_TYPE_VIDEO,\r
+        SWITCH_CODEC_TYPE_T38,\r
+        SWITCH_CODEC_TYPE_APP\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Marshaling/Types/CoreSessionMarshal.cs b/src/dotnet/dotnet/Marshaling/Types/CoreSessionMarshal.cs
new file mode 100755 (executable)
index 0000000..0011c80
--- /dev/null
@@ -0,0 +1,80 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * CoreSessionMarshal.cs -- 
+ *
+ */\r
+using System;\r
+using System.Text;\r
+using System.Runtime.InteropServices;\r
+\r
+namespace FreeSwitch.NET.Marshaling.Types\r
+{\r
+    [StructLayout(LayoutKind.Sequential, Pack=1)]\r
+    internal class CoreSessionMarshal\r
+    {\r
+        internal UInt32              id;\r
+        [MarshalAs(UnmanagedType.ByValArray, SizeConst=80)]\r
+        internal byte[]              name; \r
+        internal int                 thread_running;\r
+        internal IntPtr              pool;\r
+        internal IntPtr              channel;\r
+        internal IntPtr              thread;\r
+        internal IntPtr              endpoint_interface;\r
+        internal IOEventHooksMarshal event_hooks;\r
+        internal IntPtr              read_codec;\r
+        internal IntPtr              write_codec;\r
+        internal IntPtr              raw_write_buffer;\r
+        internal FrameMarshal        raw_write_frame;\r
+        internal FrameMarshal        enc_write_frame;\r
+        [MarshalAs(UnmanagedType.ByValArray, SizeConst=2048)]\r
+        internal byte[]              raw_write_buf;\r
+        [MarshalAs(UnmanagedType.ByValArray, SizeConst=2048)]\r
+        internal byte[]              enc_write_buf;\r
+        internal IntPtr              raw_read_buffer;\r
+        internal FrameMarshal        raw_read_frame;\r
+        internal FrameMarshal        enc_read_frame;\r
+        [MarshalAs(UnmanagedType.ByValArray, SizeConst=2048)]\r
+        internal byte[]              raw_read_buf;\r
+        [MarshalAs(UnmanagedType.ByValArray, SizeConst=2048)]\r
+        internal byte[]              enc_read_buf;\r
+        internal IntPtr              read_resampler;
+        internal IntPtr              write_resampler;
+        internal IntPtr              mutex;
+        internal IntPtr              cond;
+        internal IntPtr              rwlock;
+        [MarshalAs(UnmanagedType.ByValArray, SizeConst=128)]
+        internal IntPtr[]            streams;
+        internal int                 stream_count;
+        /* 36 + 1 char string, but need to grab 40 bytes */
+        [MarshalAs(UnmanagedType.ByValArray, SizeConst=40)]
+        internal byte[]              uuid_str;\r
+        internal IntPtr              private_info;
+        internal IntPtr              event_queue;
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Marshaling/Types/EventMarshal.cs b/src/dotnet/dotnet/Marshaling/Types/EventMarshal.cs
new file mode 100755 (executable)
index 0000000..e8d8b1d
--- /dev/null
@@ -0,0 +1,59 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * EventMarshal.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Types;\r
+\r
+namespace FreeSwitch.NET.Marshaling.Types\r
+{\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    internal class EventMarshal\r
+    {\r
+        internal EventType event_id;\r
+        internal Priority  priority;\r
+        internal IntPtr    owner;\r
+        internal IntPtr    subclass;\r
+        internal IntPtr    headers;\r
+        internal IntPtr    body;\r
+        internal IntPtr    bind_user_data;\r
+        internal IntPtr    event_user_data;\r
+        internal IntPtr    next;\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    internal class EventHeaderMarshal\r
+    {\r
+        internal string name;\r
+        internal string value;\r
+        internal IntPtr next;\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Marshaling/Types/FileHandleMarshal.cs b/src/dotnet/dotnet/Marshaling/Types/FileHandleMarshal.cs
new file mode 100755 (executable)
index 0000000..2a0e5a7
--- /dev/null
@@ -0,0 +1,57 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * FileHandleMarshal.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+\r
+namespace FreeSwitch.NET.Marshaling.Types\r
+{\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    internal class FileHandleMarshal\r
+    {\r
+        internal IntPtr file_interface;\r
+        internal UInt32 flags;\r
+        internal IntPtr fd;\r
+        internal uint   samples;\r
+        internal UInt32 samplerate;\r
+        internal Byte   channels;\r
+        internal uint   format;\r
+        internal uint   sections;\r
+        internal int    seekable;\r
+        internal uint   sample_count;\r
+        internal int    speed;\r
+        internal IntPtr memory_pool;\r
+        internal IntPtr private_info;\r
+        internal Int64  pos;\r
+        internal IntPtr audio_buffer;\r
+    }\r
+\r
+}\r
diff --git a/src/dotnet/dotnet/Marshaling/Types/FrameMarshal.cs b/src/dotnet/dotnet/Marshaling/Types/FrameMarshal.cs
new file mode 100755 (executable)
index 0000000..37cd669
--- /dev/null
@@ -0,0 +1,54 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * FrameMarshal.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Types;\r
+\r
+namespace FreeSwitch.NET.Marshaling.Types\r
+{\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    internal class FrameMarshal\r
+    {\r
+        internal IntPtr codec;\r
+        internal IntPtr source;\r
+        internal IntPtr packet;\r
+        internal UInt32 packetlen;\r
+        internal IntPtr data;\r
+        internal UInt32 datalen;\r
+        internal UInt32 buflen;\r
+        internal UInt32 samples;\r
+        internal UInt32 rate;\r
+        internal byte payload;\r
+        internal UInt32 timestamp;\r
+        internal byte flags;\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Marshaling/Types/IOEventHooksMarshal.cs b/src/dotnet/dotnet/Marshaling/Types/IOEventHooksMarshal.cs
new file mode 100755 (executable)
index 0000000..8e23640
--- /dev/null
@@ -0,0 +1,51 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * IOEventHooksMarshal.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+\r
+namespace FreeSwitch.NET.Marshaling.Types\r
+{\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    internal class IOEventHooksMarshal\r
+    {\r
+        internal IntPtr outgoing_channel;\r
+        internal IntPtr answer_channel;\r
+        internal IntPtr receive_message;\r
+        internal IntPtr receive_event;\r
+        internal IntPtr read_frame;\r
+        internal IntPtr write_frame;\r
+        internal IntPtr kill_channel;\r
+        internal IntPtr waitfor_read;\r
+        internal IntPtr waitfor_write;\r
+        internal IntPtr send_dtmf;\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Marshaling/Types/LoadableModuleInterfaceMarshal.cs b/src/dotnet/dotnet/Marshaling/Types/LoadableModuleInterfaceMarshal.cs
new file mode 100755 (executable)
index 0000000..4a3949f
--- /dev/null
@@ -0,0 +1,52 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * LoadableModuleInterfaceMarshal.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Types;\r
+\r
+namespace FreeSwitch.NET.Marshaling.Types\r
+{\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    internal class LoadableModuleInterfaceMarshal\r
+    {\r
+        internal IntPtr module_name;\r
+        internal IntPtr endpoint_interface;\r
+        internal IntPtr timer_interface;\r
+        internal IntPtr dialplan_interface;\r
+        internal IntPtr codec_interface;\r
+        internal IntPtr application_interface;\r
+        internal IntPtr api_interface;\r
+        internal IntPtr file_interface;\r
+        internal IntPtr speech_interface;\r
+        internal IntPtr directory_interface;\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Marshaling/Types/LoadableModuleMarshal.cs b/src/dotnet/dotnet/Marshaling/Types/LoadableModuleMarshal.cs
new file mode 100755 (executable)
index 0000000..14e848f
--- /dev/null
@@ -0,0 +1,54 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * LoadableModuleMarshal.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Types;\r
+\r
+namespace FreeSwitch.NET.Marshaling.Types\r
+{\r
+\r
+\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    public class LoadableModuleMarshal\r
+    {\r
+        public IntPtr         filename;\r
+        public IntPtr         module_interface;\r
+        public IntPtr         lib;\r
+        public ModuleLoad     module_load;\r
+        public ModuleReload   module_reload;\r
+        public ModulePause    module_pause;\r
+        public ModuleResume   module_resume;\r
+        public ModuleStatus   module_status;\r
+        public ModuleRuntime  module_runtime;\r
+        public ModuleShutdown module_shutdown;\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Marshaling/Types/StreamHandleMarshal.cs b/src/dotnet/dotnet/Marshaling/Types/StreamHandleMarshal.cs
new file mode 100755 (executable)
index 0000000..29f73e1
--- /dev/null
@@ -0,0 +1,48 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * StreamHandleMarshal.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Types;\r
+\r
+namespace FreeSwitch.NET.Marshaling.Types\r
+{\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    internal class StreamHandleMarshal\r
+    {\r
+        internal IntPtr write_function;\r
+        internal IntPtr data;\r
+        internal IntPtr end;\r
+        internal int    data_size;\r
+        internal int    data_len;\r
+        internal IntPtr _event;\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Marshaling/Types/TypesMarshal.cs b/src/dotnet/dotnet/Marshaling/Types/TypesMarshal.cs
new file mode 100755 (executable)
index 0000000..8aadcbc
--- /dev/null
@@ -0,0 +1,45 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * TypesMarshal.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Types;\r
+\r
+namespace FreeSwitch.NET.Marshaling.Types\r
+{\r
+    public delegate\r
+        Status DtmfCallbackFunctionMarshal(\r
+            [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(CoreSessionMarshaler))]\r
+            CoreSession session,\r
+            string dtmf,\r
+            IntPtr buf,\r
+            uint buflen);\r
+}\r
diff --git a/src/dotnet/dotnet/Module.cs b/src/dotnet/dotnet/Module.cs
new file mode 100644 (file)
index 0000000..c195c7e
--- /dev/null
@@ -0,0 +1,205 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * Module.cs -- 
+ *
+ */
+using System;\r
+using System.Collections;\r
+using System.Reflection;\r
+using System.Runtime.InteropServices;\r
+using System.Text;\r
+using FreeSwitch.NET;\r
+using FreeSwitch.NET.Types;\r
+using FreeSwitch.NET.Modules;\r
+using FreeSwitch.NET.Marshaling.Types;
+
+namespace FreeSwitch.NET
+{
+    /// <summary>\r
+    /// Base class for all Freeswitch.NET modules\r
+    /// </summary>
+    /// <example>
+    /// public class Example : Module\r
+    /// {\r
+    ///     public Example()\r
+    ///     {\r
+    ///         AddApiInterface(new ExampleApi());\r
+    ///         AddApplicationInterface(new ExampleApplication());\r
+    ///                  \r
+    ///         Register();\r
+    ///     }    \r
+    /// }
+    /// </example>
+       public class Module
+       {\r
+        private LoadableModuleInterfaceMarshal module_interface = new LoadableModuleInterfaceMarshal();\r
+        private LoadableModuleMarshal          module           = new LoadableModuleMarshal();\r
+\r
+        private ArrayList applicationInterfaces = new ArrayList();\r
+        private ArrayList apiInterfaces         = new ArrayList();\r
+\r
+        private ModuleLoad load;\r
+        private string     name;\r
+        private string     filename = Assembly.GetCallingAssembly().GetName().Name;\r
+        \r
+        /// <summary>\r
+        /// Module constructor\r
+        /// </summary>\r
+               public Module()
+               {\r
+            Console.WriteLine("*** Creating new module object");
+
+            load = new ModuleLoad(Load);
+               }
+
+        /// <summary>\r
+        /// Implementation of ModuleLoad Delegate\r
+        /// </summary>\r
+        /// <param name="module"></param>\r
+        /// <param name="name"></param>\r
+        /// <returns></returns>
+        public Status Load(ref IntPtr module, string name)\r
+        {\r
+            /* Allocate some unmanaged mem for the ModuleInterface */\r
+            module = Marshal.AllocHGlobal(Marshal.SizeOf(module_interface));\r
+            \r
+            /* Set the module_name field of the LoadableModuleInterface */\r
+            module_interface.module_name = Marshal.StringToHGlobalAnsi(filename);\r
+\r
+            /* Grab the first ApiInterface in our array and add a pointer to this in our ModuleInterface*/\r
+            Api apiIndex = (Api)apiInterfaces[0];\r
+            \r
+            module_interface.api_interface = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(ApiInterfaceMarshal)));\r
+            \r
+            Marshal.StructureToPtr(apiIndex.handle.Wrapper, module_interface.api_interface, true);\r
+            \r
+            /* For each Application interface */\r
+            Application applicationIndex = (Application)applicationInterfaces[0];\r
+            \r
+            module_interface.application_interface = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(ApplicationInterfaceMarshal)));\r
+            \r
+            Marshal.StructureToPtr(applicationIndex.handle.Wrapper, module_interface.application_interface, true);                \r
+\r
+            /* Finally, marshal the moduleinterface class and return */\r
+            Marshal.StructureToPtr(module_interface, module, true);\r
+                        \r
+            return Status.Success;\r
+        }
+
+        /// <summary>\r
+        /// AddApiInterface\r
+        /// </summary>\r
+        /// <param name="apiInterface"></param>
+        public void AddApiInterface(Api apiInterface)
+        {\r
+            /* Create a new ApiInterface type and allocate unmanaged mem */\r
+            ApiInterfaceMarshal apiInterfaceMarshal = new ApiInterfaceMarshal();\r
+            IntPtr              apiInterfacePtr     = Marshal.AllocHGlobal(Marshal.SizeOf(apiInterfaceMarshal));\r
+\r
+            /* Allocate umanaged mem to to interface fields so GC doesn't disturb them */\r
+            apiInterfaceMarshal.interface_name = Marshal.StringToHGlobalAnsi(apiInterface.Name);\r
+            apiInterfaceMarshal.desc           = Marshal.StringToHGlobalAnsi(apiInterface.Description);\r
+            apiInterfaceMarshal.function       = new ApiFunction(apiInterface.ApiFunction);\r
+            \r
+            /* Set the handle of the managed object */\r
+            apiInterface.handle = new HandleRef(apiInterfaceMarshal, apiInterfacePtr);\r
+\r
+            Marshal.StructureToPtr(apiInterfaceMarshal, apiInterface.handle.Handle, true);\r
+\r
+            /* Check to see whether there is already an interface defined, if there is then\r
+             * we want to set the *next pointer of the last element before adding the new\r
+             * interface to the array\r
+             */\r
+            if (apiInterfaces.Count > 0)\r
+            {\r
+                Api                 apiInterfaceElement = (Api)apiInterfaces[apiInterfaces.Count - 1];\r
+                ApiInterfaceMarshal apiInterfacePrev    = (ApiInterfaceMarshal)apiInterfaceElement.handle.Wrapper;\r
+\r
+                apiInterfacePrev.next = apiInterface.handle.Handle;\r
+            }\r
+\r
+            /* Finally, add our new interface to the array */\r
+            apiInterfaces.Add(apiInterface);\r
+        }\r
+\r
+        /// <summary>\r
+        /// AddApplicationInterface\r
+        /// </summary>\r
+        /// <param name="applicationInterface"></param>\r
+        public void AddApplicationInterface(Application applicationInterface)\r
+        {\r
+            /* Create a new ApplicationInterface type and allocate unmanaged mem */\r
+            ApplicationInterfaceMarshal applicationInterfaceMarshal = new ApplicationInterfaceMarshal();\r
+            IntPtr                      applicationInterfacePtr     = Marshal.AllocHGlobal(Marshal.SizeOf(applicationInterfaceMarshal));\r
+\r
+            /* Allocate umanaged mem to to interface fields so GC doesn't disturb them */\r
+            applicationInterfaceMarshal.interface_name = Marshal.StringToHGlobalAnsi(applicationInterface.Name);\r
+            applicationInterfaceMarshal.syntax         = Marshal.StringToHGlobalAnsi(applicationInterface.Syntax);\r
+            applicationInterfaceMarshal.long_desc      = Marshal.StringToHGlobalAnsi(applicationInterface.LongDescription);\r
+            applicationInterfaceMarshal.short_desc     = Marshal.StringToHGlobalAnsi(applicationInterface.ShortDescription);\r
+\r
+            applicationInterfaceMarshal.application_function = new ApplicationFunction(applicationInterface.ApplicationFunction);\r
+\r
+            /* Set the handle of the managed object */\r
+            applicationInterface.handle = new HandleRef(applicationInterfaceMarshal, applicationInterfacePtr);\r
+\r
+            Marshal.StructureToPtr(applicationInterfaceMarshal, applicationInterface.handle.Handle, true);\r
+\r
+            /* Check to see whether there is already an interface defined, if there is then\r
+             * we want to set the *next pointer of the last element before adding the new\r
+             * interface to the array\r
+             */\r
+            if (applicationInterfaces.Count > 0)\r
+            {\r
+                Application                 applicationInterfaceElement = (Application)applicationInterfaces[applicationInterfaces.Count - 1];\r
+                ApplicationInterfaceMarshal applicationInterfacePrev    = (ApplicationInterfaceMarshal)applicationInterfaceElement.handle.Wrapper;\r
+\r
+                applicationInterfacePrev.next = applicationInterface.handle.Handle;\r
+            }\r
+\r
+            /* Finally, add our new interface to the array */\r
+            applicationInterfaces.Add(applicationInterface);\r
+        }
+
+        /// <summary>\r
+        /// Register\r
+        /// </summary>
+        public void Register()
+        {\r
+            module.module_load = new ModuleLoad(Load);\r
+\r
+            Switch.switch_loadable_module_build_dynamic(filename,
+                                                        module.module_load,
+                                                        module.module_runtime,
+                                                        module.module_shutdown);
+        }\r
+\r
+        
+       }
+}      
diff --git a/src/dotnet/dotnet/Modules/Api.cs b/src/dotnet/dotnet/Modules/Api.cs
new file mode 100755 (executable)
index 0000000..36aea93
--- /dev/null
@@ -0,0 +1,65 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * Api.cs -- 
+ *
+ */\r
+using System;\r
+using System.Collections;\r
+using System.Text;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Types;\r
+\r
+namespace FreeSwitch.NET.Modules\r
+{\r
+    public class Api\r
+    {\r
+        private string name;\r
+        private string description;\r
+        private ApiFunction apiFunction;\r
+        public HandleRef handle;\r
+\r
+        public string Name\r
+        {\r
+            set { name = value; }\r
+            get { return name; }\r
+        }\r
+\r
+        public string Description\r
+        {\r
+            set { description = value; }\r
+            get { return description; }\r
+        }\r
+\r
+        public ApiFunction ApiFunction\r
+        {\r
+            set { apiFunction = value; }\r
+            get { return apiFunction; }\r
+        }\r
+    }\r
+}
\ No newline at end of file
diff --git a/src/dotnet/dotnet/Modules/Application.cs b/src/dotnet/dotnet/Modules/Application.cs
new file mode 100755 (executable)
index 0000000..045e10c
--- /dev/null
@@ -0,0 +1,81 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * Application.cs -- 
+ *
+ */\r
+using System;\r
+using System.Collections;\r
+using System.Text;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Marshaling;\r
+using FreeSwitch.NET.Types;\r
+using FreeSwitch.NET.Marshaling.Types;\r
+\r
+namespace FreeSwitch.NET.Modules\r
+{\r
+    public class Application\r
+    {\r
+        private string name;\r
+        private string longDescription;\r
+        private string shortDescription;\r
+        private string syntax;\r
+        private ApplicationFunction applicationFunction;\r
+        public HandleRef handle;\r
+\r
+        public string Name\r
+        {\r
+            set { name = value; }\r
+            get { return name; }\r
+        }\r
+\r
+        public string ShortDescription\r
+        {\r
+            set { shortDescription = value; }\r
+            get { return shortDescription; }\r
+        }\r
+\r
+        public string LongDescription\r
+        {\r
+            set { longDescription = value; }\r
+            get { return longDescription; }\r
+        }\r
+\r
+        public string Syntax\r
+        {\r
+            set { syntax = value; }\r
+            get { return syntax; }\r
+        }\r
+\r
+        public ApplicationFunction ApplicationFunction\r
+        {\r
+            set { applicationFunction = value; }\r
+            get { return applicationFunction; }\r
+        }\r
+    }\r
+}
\ No newline at end of file
diff --git a/src/dotnet/dotnet/Properties/AssemblyInfo.cs b/src/dotnet/dotnet/Properties/AssemblyInfo.cs
new file mode 100644 (file)
index 0000000..895c50f
--- /dev/null
@@ -0,0 +1,5 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+[assembly: AssemblyTitle("Freeswitch API")]
+[assembly: AssemblyDescription("mod_mono allows you to load .NET assemblies that can interact with Freeswitch's module system.")]
\ No newline at end of file
diff --git a/src/dotnet/dotnet/Switch/CallerProfile.cs b/src/dotnet/dotnet/Switch/CallerProfile.cs
new file mode 100755 (executable)
index 0000000..6003d34
--- /dev/null
@@ -0,0 +1,92 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * CallerProfile.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.CompilerServices;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Types;\r
+using FreeSwitch.NET.Marshaling;\r
+using FreeSwitch.NET.Marshaling.Types;\r
+\r
+namespace FreeSwitch.NET\r
+{\r
+    public partial class Switch\r
+    {\r
+        /*\r
+         * TODO: Figure out how to stop mono from trying to free the returned string.\r
+         */\r
+        [DllImport("freeswitch")]\r
+        //[return: MarshalAs(UnmanagedType.LPStr)]\r
+        public extern static\r
+            IntPtr switch_caller_get_field_by_name(\r
+                [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CallerProfileMarshaler))]\r
+                CallerProfile caller_profile,\r
+                [MarshalAs(UnmanagedType.LPStr)]\r
+                string name);\r
+        /*\r
+        [DllImport("freeswitch")]\r
+        [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CallerProfileMarshaler))]\r
+        public extern static\r
+            CallerProfile switch_caller_profile_clone(\r
+                [MarshalAs\r
+            switch_core_session_t *session, switch_caller_profile_t *tocopy)\r
+        */\r
+\r
+        [DllImport("freeswitch")]\r
+        [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CallerProfileMarshaler))]\r
+        public extern static\r
+            CallerProfile switch_caller_profile_new(\r
+                [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(MemoryPoolMarshaler))]\r
+                MemoryPool pool,\r
+                [MarshalAs(UnmanagedType.LPStr)]\r
+                string username,\r
+                [MarshalAs(UnmanagedType.LPStr)]\r
+                string dialplan,\r
+                [MarshalAs(UnmanagedType.LPStr)]\r
+                string callerIdName,\r
+                [MarshalAs(UnmanagedType.LPStr)]\r
+                string callerIdNumber,\r
+                [MarshalAs(UnmanagedType.LPStr)]\r
+                string networkAddress,\r
+                [MarshalAs(UnmanagedType.LPStr)]\r
+                string ani,\r
+                [MarshalAs(UnmanagedType.LPStr)]\r
+                string ani2,\r
+                [MarshalAs(UnmanagedType.LPStr)]\r
+                string rdnis,\r
+                [MarshalAs(UnmanagedType.LPStr)]\r
+                string source,\r
+                [MarshalAs(UnmanagedType.LPStr)]\r
+                string context,\r
+                [MarshalAs(UnmanagedType.LPStr)]\r
+                string destinationNumber);  \r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Switch/Channel.cs b/src/dotnet/dotnet/Switch/Channel.cs
new file mode 100755 (executable)
index 0000000..7b695c8
--- /dev/null
@@ -0,0 +1,114 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * Channel.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.CompilerServices;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Types;\r
+using FreeSwitch.NET.Marshaling;\r
+\r
+namespace FreeSwitch.NET\r
+{\r
+    public partial class Switch\r
+    {\r
+        [DllImport("freeswitch")]\r
+        public extern static\r
+            ChannelState switch_channel_set_state(\r
+                [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ChannelMarshaler))]\r
+                Channel channel,\r
+                ChannelState channelState);\r
+\r
+        [DllImport("freeswitch")]\r
+        public extern static\r
+            ChannelState switch_channel_get_state(\r
+                [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ChannelMarshaler))]\r
+                Channel channel);\r
+\r
+        [DllImport("freeswitch")]\r
+        public extern static\r
+            Status switch_channel_answer(\r
+                [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ChannelMarshaler))]\r
+                Channel channel);\r
+\r
+        [DllImport("freeswitch")]\r
+        public extern static\r
+            ChannelState switch_channel_perform_hangup(
+                [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ChannelMarshaler))]
+                Channel channel,
+                [MarshalAs(UnmanagedType.LPStr)]
+                string file,
+                [MarshalAs(UnmanagedType.LPStr)]
+                string func,
+                int line,
+                CallCause hangup_cause);\r
+\r
+        [DllImport("freeswitch")]\r
+        [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CallerExtensionMarshaler))]\r
+        public extern static\r
+            CallerExtension switch_channel_get_caller_extension(\r
+                [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ChannelMarshaler))]\r
+                Channel channel);\r
+\r
+        [DllImport("freeswitch")]\r
+        [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(CallerProfileMarshaler))]\r
+        public extern static\r
+            CallerProfile switch_channel_get_caller_profile(\r
+                [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ChannelMarshaler))]\r
+                Channel channel);\r
+\r
+        [DllImport("freeswitch")]\r
+        [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CallerProfileMarshaler))]\r
+        public extern static\r
+            CallerProfile switch_channel_get_originator_caller_profile(\r
+                [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ChannelMarshaler))]\r
+                Channel channel);\r
+\r
+        [DllImport("freeswitch")]\r
+        [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(CallerProfileMarshaler))]\r
+        public extern static\r
+            CallerProfile switch_channel_get_originatee_caller_profile(\r
+                [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ChannelMarshaler))]\r
+                Channel channel);\r
+\r
+        [DllImport("freeswitch")]\r
+        public extern static\r
+            ChannelState switch_channel_hangup(\r
+                [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ChannelMarshaler))]\r
+                Channel channel,\r
+                CallCause hangup_cause);\r
+\r
+        [DllImport("freeswitch")]\r
+        public extern static\r
+            uint switch_channel_ready(\r
+                [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ChannelMarshaler))]\r
+                Channel channel);\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Switch/Console.cs b/src/dotnet/dotnet/Switch/Console.cs
new file mode 100644 (file)
index 0000000..58d40fb
--- /dev/null
@@ -0,0 +1,42 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * Console.cs -- 
+ *
+ */
+using System;
+using System.Runtime.CompilerServices;\r
+using System.Diagnostics;\r
+using System.Text;
+
+namespace FreeSwitch.NET
+{
+       public partial class Switch
+       {\r
+    }
+}      
diff --git a/src/dotnet/dotnet/Switch/CoreSession.cs b/src/dotnet/dotnet/Switch/CoreSession.cs
new file mode 100755 (executable)
index 0000000..6130caf
--- /dev/null
@@ -0,0 +1,70 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * CoreSession.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.CompilerServices;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Types;\r
+using FreeSwitch.NET.Marshaling;\r
+\r
+namespace FreeSwitch.NET\r
+{\r
+    public partial class Switch\r
+    {\r
+        [DllImport("freeswitch")]\r
+        [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ChannelMarshaler))]\r
+        public extern static\r
+            Channel switch_core_session_get_channel(\r
+                [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CoreSessionMarshaler))]\r
+                CoreSession session);\r
+\r
+        [DllImport("freeswitch")]\r
+        [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(MemoryPoolMarshaler))]\r
+        public extern static\r
+            MemoryPool switch_core_session_get_pool(\r
+                [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CoreSessionMarshaler))]\r
+                CoreSession session);\r
+\r
+        [DllImport("freeswitch")]\r
+        public extern static\r
+            Status switch_core_session_outgoing_channel(\r
+                [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CoreSessionMarshaler))]\r
+                CoreSession session,\r
+                [MarshalAs(UnmanagedType.LPStr)]\r
+                string endpointName,\r
+                [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CallerProfileMarshaler))]\r
+                CallerProfile caller_profile,\r
+                [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CoreSessionMarshaler))]\r
+                ref CoreSession new_session,\r
+                [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(MemoryPoolMarshaler))]\r
+                MemoryPool pool);\r
+    }\r
+}
\ No newline at end of file
diff --git a/src/dotnet/dotnet/Switch/Ivr.cs b/src/dotnet/dotnet/Switch/Ivr.cs
new file mode 100755 (executable)
index 0000000..33219b5
--- /dev/null
@@ -0,0 +1,82 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * Ivr.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.CompilerServices;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Types;\r
+using FreeSwitch.NET.Marshaling;\r
+using FreeSwitch.NET.Marshaling.Types;\r
+\r
+namespace FreeSwitch.NET\r
+{\r
+    public partial class Switch\r
+    {\r
+        [DllImport("freeswitch")]\r
+        extern public static\r
+            Status switch_ivr_play_file(\r
+                [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(CoreSessionMarshaler))]\r
+                CoreSession session,\r
+                [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(FileHandleMarshaler))]\r
+                FileHandle fh,\r
+                [MarshalAs(UnmanagedType.LPStr)]\r
+                string file,\r
+                [MarshalAs(UnmanagedType.LPStr)]\r
+                string timer_name,\r
+                InputCallbackFunction input_callback,\r
+                IntPtr buf,\r
+                uint buflen);\r
+\r
+        [DllImport("freeswitch")]\r
+        public extern static\r
+            Status switch_ivr_multi_threaded_bridge(\r
+                [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CoreSessionMarshaler))]\r
+                CoreSession session,\r
+                [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CoreSessionMarshaler))]\r
+                CoreSession peer_session,\r
+                uint timelimit,\r
+                IntPtr dtmf_callback,\r
+                IntPtr session_data,\r
+                IntPtr peer_session_data);\r
+\r
+        [DllImport("freeswitch")]\r
+        public extern static\r
+            Status switch_ivr_record_file(\r
+                [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CoreSessionMarshaler))]\r
+                CoreSession session,\r
+                [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(FileHandleMarshaler))]\r
+                FileHandle fh,\r
+                IntPtr file,\r
+                InputCallbackFunction input_callback,\r
+                IntPtr buf,\r
+                uint buflen);\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Switch/LoadableModule.cs b/src/dotnet/dotnet/Switch/LoadableModule.cs
new file mode 100755 (executable)
index 0000000..60bcbda
--- /dev/null
@@ -0,0 +1,71 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * LoadableModule.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Types;\r
+using FreeSwitch.NET.Marshaling.Types;\r
+\r
+namespace FreeSwitch.NET\r
+{\r
+    /*\r
+     * SWITCH_DECLARE(switch_status_t) switch_loadable_module_load_module(char *dir, char *fname)\r
+     * SWITCH_DECLARE(switch_status_t) switch_loadable_module_build_dynamic(char *filename,\r
+     * SWITCH_DECLARE(switch_status_t) switch_loadable_module_init()\r
+     * SWITCH_DECLARE(void) switch_loadable_module_shutdown(void)\r
+     * SWITCH_DECLARE(switch_endpoint_interface_t *) switch_loadable_module_get_endpoint_interface(char *name)\r
+     * SWITCH_DECLARE(switch_codec_interface_t *) switch_loadable_module_get_codec_interface(char *name)\r
+     * SWITCH_DECLARE(switch_dialplan_interface_t *) switch_loadable_module_get_dialplan_interface(char *name)\r
+     * SWITCH_DECLARE(switch_timer_interface_t *) switch_loadable_module_get_timer_interface(char *name)\r
+     * SWITCH_DECLARE(switch_application_interface_t *) switch_loadable_module_get_application_interface(char *name)\r
+     * SWITCH_DECLARE(switch_api_interface_t *) switch_loadable_module_get_api_interface(char *name)\r
+     * SWITCH_DECLARE(switch_file_interface_t *) switch_loadable_module_get_file_interface(char *name)\r
+     * SWITCH_DECLARE(switch_speech_interface_t *) switch_loadable_module_get_speech_interface(char *name)\r
+     * SWITCH_DECLARE(switch_directory_interface_t *) switch_loadable_module_get_directory_interface(char *name)\r
+     * SWITCH_DECLARE(int) switch_loadable_module_get_codecs(switch_memory_pool_t *pool, switch_codec_interface_t **array,\r
+     * SWITCH_DECLARE(int) switch_loadable_module_get_codecs_sorted(switch_codec_interface_t **array,\r
+     * SWITCH_DECLARE(switch_status_t) switch_api_execute(char *cmd, char *arg, char *retbuf, switch_size_t len)\r
+     */\r
+    public partial class Switch\r
+    {\r
+        [DllImport("__Internal")]\r
+        public static extern\r
+            Status\r
+                switch_loadable_module_build_dynamic(\r
+                    string filename,\r
+                    [MarshalAs(UnmanagedType.FunctionPtr)]\r
+                    ModuleLoad switch_module_load,\r
+                    [MarshalAs(UnmanagedType.FunctionPtr)]\r
+                    ModuleRuntime switch_module_runtime,\r
+                    [MarshalAs(UnmanagedType.FunctionPtr)]\r
+                    ModuleShutdown switch_module_shutdown);\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Switch/StreamHandle.cs b/src/dotnet/dotnet/Switch/StreamHandle.cs
new file mode 100755 (executable)
index 0000000..fa1315a
--- /dev/null
@@ -0,0 +1,61 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * LoadableModule.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Types;\r
+using FreeSwitch.NET.Marshaling.Types;\r
+\r
+namespace FreeSwitch.NET\r
+{\r
+    /*\r
+     * SWITCH_DECLARE(switch_status_t) switch_loadable_module_load_module(char *dir, char *fname)\r
+     * SWITCH_DECLARE(switch_status_t) switch_loadable_module_build_dynamic(char *filename,\r
+     * SWITCH_DECLARE(switch_status_t) switch_loadable_module_init()\r
+     * SWITCH_DECLARE(void) switch_loadable_module_shutdown(void)\r
+     * SWITCH_DECLARE(switch_endpoint_interface_t *) switch_loadable_module_get_endpoint_interface(char *name)\r
+     * SWITCH_DECLARE(switch_codec_interface_t *) switch_loadable_module_get_codec_interface(char *name)\r
+     * SWITCH_DECLARE(switch_dialplan_interface_t *) switch_loadable_module_get_dialplan_interface(char *name)\r
+     * SWITCH_DECLARE(switch_timer_interface_t *) switch_loadable_module_get_timer_interface(char *name)\r
+     * SWITCH_DECLARE(switch_application_interface_t *) switch_loadable_module_get_application_interface(char *name)\r
+     * SWITCH_DECLARE(switch_api_interface_t *) switch_loadable_module_get_api_interface(char *name)\r
+     * SWITCH_DECLARE(switch_file_interface_t *) switch_loadable_module_get_file_interface(char *name)\r
+     * SWITCH_DECLARE(switch_speech_interface_t *) switch_loadable_module_get_speech_interface(char *name)\r
+     * SWITCH_DECLARE(switch_directory_interface_t *) switch_loadable_module_get_directory_interface(char *name)\r
+     * SWITCH_DECLARE(int) switch_loadable_module_get_codecs(switch_memory_pool_t *pool, switch_codec_interface_t **array,\r
+     * SWITCH_DECLARE(int) switch_loadable_module_get_codecs_sorted(switch_codec_interface_t **array,\r
+     * SWITCH_DECLARE(switch_status_t) switch_api_execute(char *cmd, char *arg, char *retbuf, switch_size_t len)\r
+     */\r
+    public partial class Switch\r
+    {\r
+\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Types/ApiFunction.cs b/src/dotnet/dotnet/Types/ApiFunction.cs
new file mode 100755 (executable)
index 0000000..e912518
--- /dev/null
@@ -0,0 +1,31 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * ApiFunction.cs -- 
+ *
+ */
\ No newline at end of file
diff --git a/src/dotnet/dotnet/Types/ApplicationFunction.cs b/src/dotnet/dotnet/Types/ApplicationFunction.cs
new file mode 100755 (executable)
index 0000000..c3f7fd5
--- /dev/null
@@ -0,0 +1,37 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * ApplicationFunction.cs -- 
+ *
+ */\r
+using System;\r
+\r
+namespace FreeSwitch.NET.Types\r
+{\r
+    \r
+}\r
diff --git a/src/dotnet/dotnet/Types/ApplicationInterface.cs b/src/dotnet/dotnet/Types/ApplicationInterface.cs
new file mode 100755 (executable)
index 0000000..91a49a6
--- /dev/null
@@ -0,0 +1,50 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * ApplicationInterface.cs -- 
+ *
+ */
+using System;
+using System.Collections;
+using System.Runtime.InteropServices;
+using System.Text;
+
+namespace FreeSwitch.NET.Types
+{
+    /*
+    public class ApplicationInterface
+    {
+           private string interface_name;
+           private IntPtr application_function;
+           private string long_desc;
+           private string short_desc;
+           private     string syntax;
+           //const struct switch_application_interface *next;
+    }
+     * */
+}
diff --git a/src/dotnet/dotnet/Types/Buffer.cs b/src/dotnet/dotnet/Types/Buffer.cs
new file mode 100755 (executable)
index 0000000..cd7a755
--- /dev/null
@@ -0,0 +1,56 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * Buffer.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+\r
+namespace FreeSwitch.NET.Types\r
+{\r
+    public class Buffer\r
+    {\r
+        internal HandleRef marshaledObject;\r
+\r
+        public string Data\r
+        {\r
+            get { throw new NotImplementedException(); }\r
+        }\r
+\r
+        public int Used\r
+        {\r
+            get { throw new NotImplementedException(); }\r
+        }\r
+\r
+        public int Length\r
+        {\r
+            get { throw new NotImplementedException(); }\r
+        }\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Types/CallCause.cs b/src/dotnet/dotnet/Types/CallCause.cs
new file mode 100755 (executable)
index 0000000..274b92a
--- /dev/null
@@ -0,0 +1,83 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * CallCause.cs -- 
+ *
+ */\r
+using System;\r
+\r
+namespace FreeSwitch.NET.Types\r
+{\r
+    public enum CallCause\r
+    {\r
+        Unallocated,\r
+           NoRouteTransitNet,\r
+        NoRouteDestination,\r
+        ChannelUnacceptable,\r
+        CallAwardedDelivered,\r
+        NormalClearing,\r
+        UserBusy,\r
+        NoUserResponse,\r
+        NoAnswer,\r
+        CallRejected,\r
+        NumberChanged,\r
+        DestinationOutOfOrder,\r
+        InvalidNumberFormat,\r
+        FacilityRejected,\r
+        ResponseToStatusEnquiry,\r
+        NormalUnspecified,\r
+        NormalCircuitCongestion,\r
+        NetworkOutOfOrder,\r
+        NormalTemporaryFailure,\r
+        SwitchCongestion,\r
+        AccessInfoDescarded,\r
+        RequestedChannelUnavailable,\r
+        PreEmpted,\r
+        FacilityNotSubscribed,\r
+        OutgoingCallBarred,\r
+        IncomingCallBarred,\r
+        BearerCapabilityNotAuth,\r
+        BearerCapabilityNotAvail,\r
+        BearerCapabilityNotImpl,\r
+        ChanNotImplemented,\r
+        FacilityNotImplemented,\r
+           InvalidCallReference,\r
+        IncompatibleDestination,\r
+        InvalidMsgUnspecified,\r
+        MandatoryIeMissing,\r
+        MessageTypeNonExistant,\r
+        WrongMessage,\r
+        IoNonExistant,\r
+        InvalidIeContents,\r
+        WrongCallState,\r
+        RecoveryOnTimeExpire,\r
+           MandatoryIeLengthError,\r
+        ProtocolError,\r
+        Internetworking\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Types/CallerExtension.cs b/src/dotnet/dotnet/Types/CallerExtension.cs
new file mode 100755 (executable)
index 0000000..79f07c8
--- /dev/null
@@ -0,0 +1,62 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * CallerExtension.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Marshaling.Types;\r
+\r
+namespace FreeSwitch.NET.Types\r
+{\r
+    public class CallerExtension\r
+    {\r
+        internal HandleRef marshaledObject;\r
+\r
+        public string ExtensionName\r
+        {\r
+            get\r
+            {\r
+                CallerExtensionMarshal callerExtension = (CallerExtensionMarshal)marshaledObject.Wrapper;\r
+\r
+                return Marshal.PtrToStringAnsi(callerExtension.extension_name);\r
+            }\r
+        }\r
+\r
+        public string ExtensionNumber\r
+        {\r
+            get\r
+            {\r
+                CallerExtensionMarshal callerExtension = (CallerExtensionMarshal)marshaledObject.Wrapper;\r
+\r
+                return Marshal.PtrToStringAnsi(callerExtension.extension_number);\r
+            }\r
+        }\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Types/CallerProfile.cs b/src/dotnet/dotnet/Types/CallerProfile.cs
new file mode 100755 (executable)
index 0000000..bd114fc
--- /dev/null
@@ -0,0 +1,139 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * CallerProfile.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Marshaling.Types;\r
+\r
+namespace FreeSwitch.NET.Types\r
+{\r
+    public class CallerProfile\r
+    {\r
+        internal HandleRef marshaledObject;\r
+\r
+        public static CallerProfile New(MemoryPool pool,\r
+                             string username,\r
+                             string dialplan,\r
+                             string callerIdName,\r
+                             string callerIdNumber,\r
+                             string networkAddress,\r
+                             string ani,\r
+                             string ani2,\r
+                             string rdnis,\r
+                             string source,\r
+                             string context,\r
+                             string destinationNumber)\r
+        {\r
+            return Switch.switch_caller_profile_new(pool, username, dialplan, callerIdName, callerIdNumber, networkAddress, ani, ani2, rdnis, source, context, destinationNumber);\r
+        }\r
+\r
+        public string GetFieldByName(string field)\r
+        {\r
+            IntPtr ptr;\r
+            \r
+            ptr = Switch.switch_caller_get_field_by_name(this, field);\r
+\r
+            if (ptr != IntPtr.Zero)\r
+                return Marshal.PtrToStringAnsi(ptr);\r
+            else\r
+                return "";\r
+        }\r
+\r
+\r
+               /*\r
+         * Properties\r
+         */\r
+        public string Dialplan\r
+        {\r
+            get { return GetFieldByName("dialplan"); }\r
+        }\r
+\r
+        public string CallerIdName\r
+        {\r
+            get { return GetFieldByName("caller_id_name"); }\r
+        }\r
+\r
+        public string CallerIdNumber\r
+        {\r
+            get { return GetFieldByName("caller_id_number"); }\r
+        }\r
+\r
+        public string NetworkAddress\r
+        {\r
+            get { return GetFieldByName("network_addr"); }\r
+        }\r
+\r
+        public string Ani\r
+        {\r
+            get { return GetFieldByName("ani"); }\r
+        }\r
+\r
+        public string Ani2\r
+        {\r
+            get { return GetFieldByName("ani2"); }\r
+        }\r
+\r
+        public string Rdnis\r
+        {\r
+            get { return GetFieldByName("rdnis"); }\r
+        }\r
+\r
+        public string Source\r
+        {\r
+            get { return GetFieldByName("source"); }\r
+        }\r
+\r
+        public string Context\r
+        {\r
+            get { return GetFieldByName("context"); }\r
+        }\r
+\r
+        public string DestinationNumber\r
+        {\r
+            get { return GetFieldByName("destination_number"); }\r
+        }\r
+\r
+        public string ChannelName\r
+        {\r
+            get { return GetFieldByName("chan_name"); }\r
+        }\r
+\r
+        public string Uuid\r
+        {\r
+            get{ return GetFieldByName("uuid"); }\r
+        }\r
+\r
+        public string Username\r
+        {\r
+            get { return GetFieldByName("username"); }\r
+        }\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Types/Channel.cs b/src/dotnet/dotnet/Types/Channel.cs
new file mode 100755 (executable)
index 0000000..4f6baae
--- /dev/null
@@ -0,0 +1,223 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * Channel.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Marshaling.Types;\r
+\r
+namespace FreeSwitch.NET.Types\r
+{\r
+    /*\r
+     *         char *name;
+       switch_buffer_t *dtmf_buffer;
+       switch_mutex_t *dtmf_mutex;
+       switch_mutex_t *flag_mutex;
+       switch_mutex_t *profile_mutex;
+       switch_core_session_t *session;
+       switch_channel_state_t state;
+       uint32_t flags;
+       switch_caller_profile_t *caller_profile;
+       switch_caller_profile_t *originator_caller_profile;
+       switch_caller_profile_t *originatee_caller_profile;
+       switch_caller_extension_t *caller_extension;
+       const switch_state_handler_table_t *state_handlers[SWITCH_MAX_STATE_HANDLERS];
+       int state_handler_index;
+       switch_hash_t *variables;
+       switch_channel_timetable_t *times;
+       void *private_info;
+       switch_call_cause_t hangup_cause;
+       int freq;
+       int bits;
+       int channels;
+       int ms;
+       int kbps;\r
+     */\r
+    public class Channel\r
+    {\r
+        internal HandleRef marshaledObject;\r
+\r
+        public string Name\r
+        {\r
+            get\r
+            {\r
+                ChannelMarshal channel = (ChannelMarshal) marshaledObject.Wrapper;\r
+\r
+                return Marshal.PtrToStringAnsi(channel.name);\r
+            }\r
+        }\r
+\r
+        public Buffer DtmfBuffer\r
+        {\r
+            get\r
+            {\r
+                Console.WriteLine("Buffer");\r
+                return new Buffer();\r
+                //throw new NotImplementedException();\r
+            }\r
+        }\r
+\r
+        public ChannelState State\r
+        {\r
+            set\r
+            {\r
+                Switch.switch_channel_set_state(this, value);\r
+            }\r
+            get\r
+            {\r
+                return Switch.switch_channel_get_state(this);\r
+            }\r
+        }\r
+\r
+        public bool IsReady\r
+        {\r
+            get\r
+            {\r
+                uint isReady = Switch.switch_channel_ready(this);\r
+\r
+                if (isReady != 0)\r
+                    return true;\r
+                else\r
+                    return false;\r
+            }\r
+        }\r
+\r
+        public ChannelFlag Flags\r
+        {\r
+            get\r
+            {\r
+                Console.WriteLine("ChannelFlag");\r
+                return new ChannelFlag();\r
+                //throw new NotImplementedException();\r
+            }\r
+        }\r
+\r
+        public CallerProfile CallerProfile\r
+        {\r
+            get\r
+            {\r
+                return Switch.switch_channel_get_caller_profile(this);\r
+            }\r
+        }\r
+\r
+        public CallerProfile OriginatorCallerProfile\r
+        {\r
+            get\r
+            {\r
+                return Switch.switch_channel_get_originator_caller_profile(this);\r
+            }\r
+        }\r
+\r
+        public CallerProfile OriginateeCallerProfile\r
+        {\r
+            get\r
+            {\r
+                return Switch.switch_channel_get_originatee_caller_profile(this);\r
+            }\r
+        }\r
+\r
+        public CallerExtension CallerExtension\r
+        {\r
+            get\r
+            {\r
+                return Switch.switch_channel_get_caller_extension(this);\r
+            }\r
+        }\r
+\r
+        public ChannelTimetable Times\r
+        {\r
+            get\r
+            {\r
+                Console.WriteLine("Channel Timetable");\r
+                return new ChannelTimetable();\r
+              //  throw new NotImplementedException();\r
+            }\r
+        }\r
+\r
+        public int Freq\r
+        {\r
+            get\r
+            {\r
+                ChannelMarshal channel = (ChannelMarshal) marshaledObject.Wrapper;\r
+\r
+                return channel.freq;\r
+            }\r
+        }\r
+\r
+        public int Bits\r
+        {\r
+            get\r
+            {\r
+                ChannelMarshal channel = (ChannelMarshal) marshaledObject.Wrapper;\r
+\r
+                return channel.bits;\r
+            }\r
+        }\r
+\r
+        public int Channels\r
+        {\r
+            get\r
+            {\r
+                ChannelMarshal channel = (ChannelMarshal) marshaledObject.Wrapper;\r
+\r
+                return channel.channels;\r
+            }\r
+        }\r
+\r
+        public int Ms\r
+        {\r
+            get\r
+            {\r
+                ChannelMarshal channel = (ChannelMarshal) marshaledObject.Wrapper;\r
+\r
+                return channel.ms;\r
+            }\r
+        }\r
+\r
+        public int Kbps\r
+        {\r
+            get {\r
+                ChannelMarshal channel = (ChannelMarshal) marshaledObject.Wrapper;\r
+\r
+                return channel.kbps;\r
+            }\r
+        }\r
+\r
+        public void PerformHangup()\r
+        {\r
+            Switch.switch_channel_perform_hangup(this, "file", "func", 100, CallCause.OutgoingCallBarred);\r
+        }\r
+\r
+        public Status Answer()\r
+        {\r
+            return Switch.switch_channel_answer(this);\r
+        }\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Types/ChannelFlag.cs b/src/dotnet/dotnet/Types/ChannelFlag.cs
new file mode 100755 (executable)
index 0000000..78c9e64
--- /dev/null
@@ -0,0 +1,46 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * ChannelFlag.cs -- 
+ *
+ */\r
+using System;\r
+\r
+namespace FreeSwitch.NET.Types\r
+{\r
+    public enum ChannelFlag\r
+    {\r
+        CF_SEND_AUDIO,\r
+        CF_RECV_AUDIO,\r
+        CF_ANSWERED,\r
+        CF_OUTBOUND,\r
+        CF_EARLY_MEDIA,\r
+        CF_ORIGINATOR,\r
+        CF_TRANSFER\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Types/ChannelState.cs b/src/dotnet/dotnet/Types/ChannelState.cs
new file mode 100755 (executable)
index 0000000..52e6887
--- /dev/null
@@ -0,0 +1,47 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * ChannelState.cs -- 
+ *
+ */\r
+using System;\r
+\r
+namespace FreeSwitch.NET.Types\r
+{\r
+    public enum ChannelState\r
+    {\r
+        CS_NEW,\r
+        CS_INIT,\r
+        CS_RING,\r
+        CS_TRANSMIT,\r
+        CS_EXECUTE,\r
+        CS_LOOPBACK,\r
+        CS_HANGUP,\r
+        CS_DONE \r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Types/ChannelTimetable.cs b/src/dotnet/dotnet/Types/ChannelTimetable.cs
new file mode 100755 (executable)
index 0000000..1e3cdcb
--- /dev/null
@@ -0,0 +1,56 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * ChannelTimetable.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+\r
+namespace FreeSwitch.NET.Types\r
+{\r
+    public class ChannelTimetable\r
+    {\r
+        internal HandleRef marshaledObject;\r
+\r
+        public Int64 Created\r
+        {\r
+            get { throw new NotImplementedException(); }\r
+        }\r
+\r
+        public Int64 Answered\r
+        {\r
+            get { throw new NotImplementedException(); }\r
+        }\r
+\r
+        public Int64 Hungup\r
+        {\r
+            get { throw new NotImplementedException(); }\r
+        }\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Types/CoreSession.cs b/src/dotnet/dotnet/Types/CoreSession.cs
new file mode 100755 (executable)
index 0000000..6c9165f
--- /dev/null
@@ -0,0 +1,175 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * CoreSession.cs -- 
+ *
+ */\r
+using System;\r
+using System.Collections;\r
+using System.Runtime.InteropServices;\r
+using System.Text;\r
+using FreeSwitch.NET.Marshaling.Types;\r
+\r
+namespace FreeSwitch.NET.Types\r
+{\r
+    /*\r
+     *         uint32_t id;
+       char name[80];
+       int thread_running;
+       switch_memory_pool_t *pool;
+       switch_channel_t *channel;
+       switch_thread_t *thread;
+       const switch_endpoint_interface_t *endpoint_interface;
+       switch_io_event_hooks_t event_hooks;
+       switch_codec_t *read_codec;
+       switch_codec_t *write_codec;
+
+       switch_buffer_t *raw_write_buffer;
+       switch_frame_t raw_write_frame;
+       switch_frame_t enc_write_frame;
+       uint8_t raw_write_buf[SWITCH_RECCOMMENDED_BUFFER_SIZE];
+       uint8_t enc_write_buf[SWITCH_RECCOMMENDED_BUFFER_SIZE];
+
+       switch_buffer_t *raw_read_buffer;
+       switch_frame_t raw_read_frame;
+       switch_frame_t enc_read_frame;
+       uint8_t raw_read_buf[SWITCH_RECCOMMENDED_BUFFER_SIZE];
+       uint8_t enc_read_buf[SWITCH_RECCOMMENDED_BUFFER_SIZE];
+
+
+       switch_audio_resampler_t *read_resampler;
+       switch_audio_resampler_t *write_resampler;
+
+       switch_mutex_t *mutex;
+       switch_thread_cond_t *cond;
+
+       switch_thread_rwlock_t *rwlock;
+
+       void *streams[SWITCH_MAX_STREAMS];
+       int stream_count;
+
+       char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1];
+       void *private_info;
+       switch_queue_t *event_queue;\r
+     */\r
+    public class CoreSession\r
+    {\r
+        public HandleRef marshaledObject;\r
+\r
+        /*\r
+         * Properties\r
+         */\r
+        public UInt32 Id\r
+        {\r
+            get\r
+            {\r
+                CoreSessionMarshal coreSessionMarshal = (CoreSessionMarshal)marshaledObject.Wrapper;\r
+\r
+                return coreSessionMarshal.id;\r
+            }\r
+        }\r
+\r
+        public string Name\r
+        {\r
+            get\r
+            {\r
+                CoreSessionMarshal coreSessionMarshal = (CoreSessionMarshal) marshaledObject.Wrapper;\r
+\r
+                return Encoding.ASCII.GetString(coreSessionMarshal.name);\r
+            }\r
+        }\r
+\r
+        public bool IsThreadRunning\r
+        {\r
+            get\r
+            {\r
+                CoreSessionMarshal coreSessionMarshal = (CoreSessionMarshal)marshaledObject.Wrapper;\r
+\r
+                if (coreSessionMarshal.thread_running <= 0)\r
+                    return false;\r
+                else\r
+                    return true;\r
+            }\r
+        }\r
+\r
+        public MemoryPool Pool\r
+        {\r
+            get\r
+            {\r
+                return Switch.switch_core_session_get_pool(this);\r
+            }\r
+        }\r
+\r
+\r
+        public Channel Channel\r
+        {\r
+            get\r
+            {\r
+                return Switch.switch_core_session_get_channel(this);\r
+            }\r
+        }\r
+\r
+        public string Uuid\r
+        {\r
+            get\r
+            {\r
+                CoreSessionMarshal coreSessionMarshal = (CoreSessionMarshal)marshaledObject.Wrapper;\r
+\r
+                return Encoding.ASCII.GetString(coreSessionMarshal.uuid_str);\r
+            }\r
+        }\r
+\r
+\r
+        public CoreSession OutgoingChannel(string endpointName, CallerProfile callerProfile)\r
+        {\r
+            CoreSession newSession = new CoreSession();\r
+            MemoryPool  pool       = new MemoryPool();\r
+\r
+            Status status = Switch.switch_core_session_outgoing_channel(this, endpointName, callerProfile, ref newSession, pool);\r
+\r
+            if (status != Status.Success)\r
+                throw new Exception("Unsuccessful");\r
+\r
+\r
+            return newSession;\r
+        }\r
+\r
+        public CoreSession()\r
+        {\r
+            //CoreSessionMarshal coreSessionMarshal = new CoreSessionMarshal();\r
+            //IntPtr coreSessionPtr = Marshal.AllocHGlobal(Marshal.SizeOf(coreSessionMarshal));\r
+\r
+            //marshaledObject = new HandleRef(coreSessionMarshal, coreSessionPtr);\r
+        }\r
+\r
+        public Status DtmfCallbackFunctionWrapper(CoreSession session, string dtmf, IntPtr buf, uint buflen)\r
+        {\r
+            return Status.Success;\r
+        }\r
+    }\r
+}
\ No newline at end of file
diff --git a/src/dotnet/dotnet/Types/DtmfCallbackFunction.cs b/src/dotnet/dotnet/Types/DtmfCallbackFunction.cs
new file mode 100755 (executable)
index 0000000..53c41eb
--- /dev/null
@@ -0,0 +1,37 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * DtmfCallbackFunction.cs -- 
+ *
+ */\r
+using System;\r
+\r
+namespace FreeSwitch.NET.Types\r
+{\r
+    public delegate Status DtmfCallbackFunction(CoreSession session, string dtmf);\r
+}\r
diff --git a/src/dotnet/dotnet/Types/Event.cs b/src/dotnet/dotnet/Types/Event.cs
new file mode 100755 (executable)
index 0000000..de064fb
--- /dev/null
@@ -0,0 +1,120 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * Event.cs -- 
+ *
+ */\r
+using System;\r
+using System.Collections;\r
+using System.Text;\r
+using System.Runtime.InteropServices;\r
+\r
+namespace FreeSwitch.NET.Types\r
+{\r
+    public enum Priority\r
+    {\r
+        SWITCH_PRIORITY_NORMAL,\r
+        SWITCH_PRIORITY_LOW,\r
+        SWITCH_PRIORITY_HIGH\r
+    }\r
+\r
+    public class Event\r
+    {\r
+        internal HandleRef marshaledObject;\r
+\r
+        public EventType EventId\r
+        {\r
+            get { throw new NotImplementedException(); }\r
+        }\r
+\r
+        public Priority Priority\r
+        {\r
+            get { throw new NotImplementedException(); }\r
+        }\r
+\r
+        public string Owner\r
+        {\r
+            get { throw new NotImplementedException(); }\r
+        }\r
+\r
+        public IntPtr Subclass\r
+        {\r
+            get { throw new NotImplementedException(); }\r
+        }\r
+\r
+        public ArrayList Headers\r
+        {\r
+            get { throw new NotImplementedException(); }\r
+        }\r
+\r
+        public string Body\r
+        {\r
+            get { throw new NotImplementedException(); }\r
+        }\r
+\r
+        public IntPtr BindUserData\r
+        {\r
+            get { throw new NotImplementedException(); }\r
+        }\r
+\r
+        public IntPtr EventUserData\r
+        {\r
+            get { throw new NotImplementedException(); }\r
+        }\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    public class EventSubclass\r
+    {\r
+        private string owner;\r
+        private string name;\r
+    }\r
+\r
+    [StructLayout(LayoutKind.Sequential)]\r
+    public class EventHeader\r
+    {\r
+        public string Name;\r
+        public string Value;\r
+    }\r
+\r
+    public enum EventType\r
+    {\r
+        SWITCH_EVENT_CUSTOM,\r
+        SWITCH_EVENT_CHANNEL_STATE,\r
+        SWITCH_EVENT_CHANNEL_ANSWER,\r
+        SWITCH_EVENT_CHANNEL_HANGUP,\r
+        SWITCH_EVENT_API,\r
+        SWITCH_EVENT_LOG,\r
+        SWITCH_EVENT_INBOUND_CHAN,\r
+        SWITCH_EVENT_OUTBOUND_CHAN,\r
+        SWITCH_EVENT_STARTUP,\r
+        SWITCH_EVENT_SHUTDOWN,\r
+        SWITCH_EVENT_ALL\r
+    }\r
+\r
+}\r
diff --git a/src/dotnet/dotnet/Types/FileHandle.cs b/src/dotnet/dotnet/Types/FileHandle.cs
new file mode 100755 (executable)
index 0000000..707e496
--- /dev/null
@@ -0,0 +1,42 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * FileHandle.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Marshaling.Types;\r
+\r
+namespace FreeSwitch.NET.Types\r
+{\r
+    public class FileHandle\r
+    {\r
+        internal HandleRef marshaledObject;\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Types/InputCallbackFunction.cs b/src/dotnet/dotnet/Types/InputCallbackFunction.cs
new file mode 100755 (executable)
index 0000000..e233eef
--- /dev/null
@@ -0,0 +1,47 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * DtmfCallbackFunction.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Marshaling;\r
+\r
+namespace FreeSwitch.NET.Types\r
+{\r
+    public delegate Status InputCallbackFunction(\r
+        [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(StreamHandleMarshaler))]\r
+        CoreSession session,\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        string input,\r
+        InputType inputType,\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        string buffer,\r
+        int bufferLength);\r
+}\r
diff --git a/src/dotnet/dotnet/Types/InputType.cs b/src/dotnet/dotnet/Types/InputType.cs
new file mode 100755 (executable)
index 0000000..170aaab
--- /dev/null
@@ -0,0 +1,41 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * ChannelState.cs -- 
+ *
+ */\r
+using System;\r
+\r
+namespace FreeSwitch.NET.Types\r
+{\r
+    public enum InputType\r
+    {\r
+           INPUT_TYPE_DTMF,
+           INPUT_TYPE_EVENT
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Types/LoadableModule.cs b/src/dotnet/dotnet/Types/LoadableModule.cs
new file mode 100755 (executable)
index 0000000..7253577
--- /dev/null
@@ -0,0 +1,146 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * Channel.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+\r
+namespace FreeSwitch.NET.Types\r
+{\r
+    public class LoadableModule\r
+    {\r
+        internal IntPtr address;\r
+        \r
+        private  string           name;\r
+        private  Buffer           dtmfBuffer;\r
+        internal IntPtr           dtmf_mutex;\r
+        internal IntPtr           session;\r
+        private  ChannelState     state;\r
+        private  ChannelFlag      flags;\r
+        private  CallerProfile    callerProfile;\r
+        private  CallerProfile    originatorCallerProfile;\r
+        private  CallerProfile    originateeCallerProfile;\r
+        private  CallerExtension  callerExtension;\r
+        internal byte[]           state_handlers;\r
+        internal int              state_handler_index;\r
+        internal IntPtr           variables;\r
+        private  ChannelTimetable times;\r
+        internal IntPtr           privateInfo;\r
+        private  int              freq;\r
+        private  int              bits;\r
+        private  int              channels;\r
+        private  int              ms;\r
+        private  int              kbps;\r
+\r
+        public string Name\r
+        {\r
+            set { name = value; }\r
+            get { return name; }\r
+        }\r
+\r
+        public Buffer DtmfBuffer\r
+        {\r
+            set { dtmfBuffer = value; }\r
+            get { return dtmfBuffer; }\r
+        }\r
+\r
+        public ChannelState State\r
+        {\r
+            set { state = value; }\r
+            get { return state; }\r
+        }\r
+\r
+        public ChannelFlag Flags\r
+        {\r
+            set { flags = value; }\r
+            get { return flags; }\r
+        }\r
+\r
+        public CallerProfile CallerProfile\r
+        {\r
+            set { callerProfile = value; }\r
+            get { return callerProfile; }\r
+        }\r
+\r
+        public CallerProfile OriginatorCallerProfile\r
+        {\r
+            set { originatorCallerProfile = value; }\r
+            get { return originatorCallerProfile; }\r
+        }\r
+\r
+        public CallerProfile OriginateeCallerProfile\r
+        {\r
+            set { originateeCallerProfile = value; }\r
+            get { return originateeCallerProfile; }\r
+        }\r
+\r
+        public CallerExtension CallerExtension\r
+        {\r
+            set { callerExtension = value; }\r
+            get { return callerExtension; }\r
+        }\r
+\r
+        public ChannelTimetable Times\r
+        {\r
+            set { times = value; }\r
+            get { return times; }\r
+        }\r
+\r
+        public int Freq\r
+        {\r
+            set { freq = value; }\r
+            get { return freq; }\r
+        }\r
+\r
+        public int Bits\r
+        {\r
+            set { bits = value; }\r
+            get { return bits; }\r
+        }\r
+\r
+        public int Channels\r
+        {\r
+            set { channels = value; }\r
+            get { return channels; }\r
+        }\r
+\r
+        public int Ms\r
+        {\r
+            set { ms = value; }\r
+            get { return ms; }\r
+        }\r
+\r
+        public int Kbps\r
+        {\r
+            set { kbps = value; }\r
+            get { return kbps; }\r
+        }\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Types/LoadableModuleInterface.cs b/src/dotnet/dotnet/Types/LoadableModuleInterface.cs
new file mode 100755 (executable)
index 0000000..f0832f1
--- /dev/null
@@ -0,0 +1,61 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * LoadableModuleInterfaces.cs -- 
+ *
+ */\r
+using System;\r
+using System.Collections;\r
+using System.Runtime.InteropServices;\r
+using System.Text;\r
+using FreeSwitch.NET.Marshaling;\r
+\r
+namespace FreeSwitch.NET.Types\r
+{\r
+    public delegate Status WriteFunction(\r
+        [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(StreamHandleMarshaler))]\r
+        StreamHandle streamHandle,\r
+        [MarshalAs(UnmanagedType.LPStr)]\r
+        string fmt);\r
+\r
+    //public delegate void ModuleLoad();\r
+\r
+    public class LoadableModuleInterface\r
+    {\r
+        private string module_name;\r
+        //private EndpointInterface endpoint_interface;\r
+        //private TimerInterface timer_interface;\r
+        //private DialplanInterface dialplan_interface;\r
+        //private CodecInterface codec_interface;\r
+        //private ApplicationInterface application_interface;\r
+        //private ApiInterface api_interface;\r
+        //private FileInterface file_interface;\r
+        //private SpeechInterface speech_interface;\r
+        //private DirectoryInterface directory_interface;\r
+    }\r
+}
diff --git a/src/dotnet/dotnet/Types/MemoryPool.cs b/src/dotnet/dotnet/Types/MemoryPool.cs
new file mode 100755 (executable)
index 0000000..5b0aad3
--- /dev/null
@@ -0,0 +1,10 @@
+using System;\r
+using System.Runtime.InteropServices;\r
+\r
+namespace FreeSwitch.NET.Types\r
+{\r
+    public class MemoryPool\r
+    {\r
+        public HandleRef marshaledObject;\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Types/Module.cs b/src/dotnet/dotnet/Types/Module.cs
new file mode 100755 (executable)
index 0000000..1d313c8
--- /dev/null
@@ -0,0 +1,59 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * Module.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Marshaling;\r
+\r
+namespace FreeSwitch.NET.Types\r
+{\r
+    public delegate Status ModuleReload();\r
+    public delegate bool   ModulePause();\r
+    public delegate bool   ModuleResume();\r
+    public delegate bool   ModuleStatus();\r
+    public delegate Status ModuleRuntime();\r
+    public delegate bool   ModuleShutdown();\r
+    public delegate Status ModuleLoad(ref IntPtr module, string name);\r
+\r
+    public delegate void\r
+        ApplicationFunction(\r
+            [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(CoreSessionMarshaler))]\r
+            CoreSession session,\r
+            [MarshalAs(UnmanagedType.LPStr)]\r
+            string data);\r
+\r
+    public delegate Status\r
+        ApiFunction(\r
+            [MarshalAs(UnmanagedType.LPStr)]\r
+            string command,\r
+            [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(StreamHandleMarshaler))]\r
+            StreamHandle streamHandle);\r
+}\r
diff --git a/src/dotnet/dotnet/Types/ModuleInterfaces.cs b/src/dotnet/dotnet/Types/ModuleInterfaces.cs
new file mode 100755 (executable)
index 0000000..5bff3ff
--- /dev/null
@@ -0,0 +1,69 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * ApplicationInterface.cs -- 
+ *
+ */
+using System;
+using System.Collections;
+using System.Runtime.InteropServices;
+using System.Text;
+
+namespace FreeSwitch.NET.Types
+{
+    /*
+    public class ApplicationInterface
+    {
+           private string interface_name;
+           private ApplicationFunction application_function;
+           private string long_desc;
+           private string short_desc;
+           private     string syntax;
+           //const struct switch_application_interface *next;\r
+\r
+        public string InterfaceName\r
+        {\r
+            get { return interface_name; }\r
+        }\r
+\r
+        public ApplicationFunction ApplicationFunction\r
+        {\r
+            get { return application_function; }\r
+        }\r
+\r
+        public string LongDesc\r
+        {\r
+            get { return long_desc; }\r
+        }\r
+\r
+        public string ShortDesc\r
+        {\r
+            get { return short_desc; }\r
+        }
+    }*/
+}
diff --git a/src/dotnet/dotnet/Types/Status.cs b/src/dotnet/dotnet/Types/Status.cs
new file mode 100755 (executable)
index 0000000..bc7314b
--- /dev/null
@@ -0,0 +1,51 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * Status.cs -- 
+ *
+ */\r
+using System;\r
+\r
+namespace FreeSwitch.NET.Types\r
+{\r
+    public enum Status\r
+    {\r
+        Success,\r
+        False, \r
+        Timeout,       \r
+        Restart,       \r
+        Terminate,\r
+        NotImplemented,\r
+        MemoryError,   \r
+        NoOp,  \r
+        Resample,      \r
+        GeneralError,  \r
+        InUse,         \r
+        Break \r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Types/StreamHandle.cs b/src/dotnet/dotnet/Types/StreamHandle.cs
new file mode 100755 (executable)
index 0000000..2c7ed33
--- /dev/null
@@ -0,0 +1,51 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * StreamHandle.cs -- 
+ *
+ */\r
+using System;\r
+using System.Runtime.InteropServices;\r
+using FreeSwitch.NET.Marshaling.Types;\r
+\r
+namespace FreeSwitch.NET.Types\r
+{\r
+    public class StreamHandle\r
+    {\r
+        internal HandleRef     marshaledObject;\r
+        internal WriteFunction writeFunction;\r
+\r
+        public void Write(string data)\r
+        {\r
+            StreamHandleMarshal streamHandleMarshal = (StreamHandleMarshal)marshaledObject.Wrapper;\r
+            WriteFunction       writeFunction       = (WriteFunction)Marshal.GetDelegateForFunctionPointer(streamHandleMarshal.write_function, typeof(WriteFunction));\r
+\r
+            writeFunction(this, data);\r
+        }\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/Types/TextChannel.cs b/src/dotnet/dotnet/Types/TextChannel.cs
new file mode 100755 (executable)
index 0000000..2e45fc1
--- /dev/null
@@ -0,0 +1,42 @@
+/* 
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2006, James Martelletti <james@nerdc0re.com>
+ *
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ *
+ * The Initial Developer of the Original Code is
+ * James Martelletti <james@nerdc0re.com>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ * 
+ * James Martelletti <james@nerdc0re.com>
+ *
+ *
+ * TextChannel.cs -- 
+ *
+ */\r
+using System;\r
+\r
+namespace FreeSwitch.NET.Types\r
+{\r
+    public enum TextChannel\r
+    {\r
+        ChannelIdConsole,\r
+        ChannelIdConsoleClean,\r
+        ChannelIdEvent\r
+    }\r
+}\r
diff --git a/src/dotnet/dotnet/public.snk b/src/dotnet/dotnet/public.snk
new file mode 100644 (file)
index 0000000..60ac3d5
Binary files /dev/null and b/src/dotnet/dotnet/public.snk differ