Creating FreeSwitch.NET project, this is by no means complete yet but too many people are interested

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
This commit is contained in:
James Green 2006-09-13 15:31:28 +00:00
parent 231c1d09f0
commit ca773a60c6
72 changed files with 4915 additions and 0 deletions

75
src/dotnet/dotnet/Common.cs Executable file
View File

@ -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 --
*
*/
using System;
using System.Reflection;
namespace FreeSwitch.NET
{
public class Common
{
public static void DumpHex(string label, IntPtr pointer, int length)
{
Console.WriteLine("DUMP-{0}:", label);
DumpHex(pointer, length);
}
public static void DumpProperties(string label, object dumpObject)
{
Type type = dumpObject.GetType();
PropertyInfo[] properties = type.GetProperties();
foreach (PropertyInfo p in properties)
{
Console.WriteLine("%%% - {0}: {1}:{2}", label, p.Name, p.GetValue(dumpObject, null));
}
}
public static void DumpHex(IntPtr pointer, int length)
{
if (pointer == IntPtr.Zero)
throw new NullReferenceException();
for (int i = 0; i < length; i++)
{
IntPtr offset = new IntPtr(pointer.ToInt32() + i);
if (i % 20 == 0)
Console.Write("\n0x{0:x}: ", offset.ToInt32());
Console.Write("{0:x2} ", System.Runtime.InteropServices.Marshal.ReadByte(offset));
}
Console.WriteLine("\n");
}
}
}

View File

@ -0,0 +1,126 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{251CAABC-16C3-4593-A491-603B908094E0}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>FreeSwitch.NET</RootNamespace>
<AssemblyName>Freeswitch</AssemblyName>
<StartupObject>
</StartupObject>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>public.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Common.cs" />
<Compile Include="Marshaling\BufferMarshaler.cs" />
<Compile Include="Marshaling\CallerExtensionMarshaler.cs" />
<Compile Include="Marshaling\CallerProfileMarshaler.cs" />
<Compile Include="Marshaling\ChannelMarshaler.cs" />
<Compile Include="Marshaling\ChannelTimetableMarshaler.cs" />
<Compile Include="Marshaling\StreamHandleMarshaler.cs" />
<Compile Include="Marshaling\CoreSessionMarshaler.cs" />
<Compile Include="Marshaling\EventMarshaler.cs" />
<Compile Include="Marshaling\MemoryPoolMarshaler.cs" />
<Compile Include="Marshaling\Types\BufferMarshal.cs" />
<Compile Include="Marshaling\Types\CallerExtensionMarshal.cs" />
<Compile Include="Marshaling\Types\CallerProfileMarshal.cs" />
<Compile Include="Marshaling\FileHandleMarshaler.cs" />
<Compile Include="Marshaling\Types\ChannelFlagMarshal.cs" />
<Compile Include="Marshaling\Types\ChannelMarshal.cs" />
<Compile Include="Marshaling\Types\ChannelStateMarshal.cs" />
<Compile Include="Marshaling\Types\ChannelTimetableMarshal.cs" />
<Compile Include="Marshaling\Types\ApplicationInterfaceMarshal.cs" />
<Compile Include="Marshaling\Types\ApiInterfaceMarshal.cs" />
<Compile Include="Marshaling\Types\CodecImplementationMarshal.cs" />
<Compile Include="Marshaling\Types\CodecInterfaceMarshal.cs" />
<Compile Include="Marshaling\Types\CodecMarshal.cs" />
<Compile Include="Marshaling\Types\CodecTypeMarshal.cs" />
<Compile Include="Marshaling\Types\StreamHandleMarshal.cs" />
<Compile Include="Marshaling\Types\TypesMarshal.cs" />
<Compile Include="Marshaling\Types\FileHandleMarshal.cs" />
<Compile Include="Marshaling\Types\LoadableModuleInterfaceMarshal.cs" />
<Compile Include="Marshaling\Types\LoadableModuleMarshal.cs" />
<Compile Include="Marshaling\Types\CoreSessionMarshal.cs" />
<Compile Include="Marshaling\Types\EventMarshal.cs" />
<Compile Include="Marshaling\Types\FrameMarshal.cs" />
<Compile Include="Marshaling\Types\IOEventHooksMarshal.cs" />
<Compile Include="Module.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Switch\CallerProfile.cs" />
<Compile Include="Switch\Channel.cs" />
<Compile Include="Switch\Console.cs" />
<Compile Include="Switch\StreamHandle.cs" />
<Compile Include="Switch\CoreSession.cs" />
<Compile Include="Switch\Ivr.cs" />
<Compile Include="Switch\LoadableModule.cs" />
<Compile Include="Modules\Api.cs" />
<Compile Include="Types\ApiFunction.cs" />
<Compile Include="Types\ApplicationInterface.cs" />
<Compile Include="Types\Buffer.cs" />
<Compile Include="Types\CallerExtension.cs" />
<Compile Include="Types\CallerProfile.cs" />
<Compile Include="Types\Channel.cs" />
<Compile Include="Types\ChannelFlag.cs" />
<Compile Include="Types\ChannelState.cs" />
<Compile Include="Types\ChannelTimetable.cs" />
<Compile Include="Modules\Application.cs" />
<Compile Include="Types\ApplicationFunction.cs" />
<Compile Include="Types\CallCause.cs" />
<Compile Include="Types\InputCallbackFunction.cs" />
<Compile Include="Types\InputType.cs" />
<Compile Include="Types\ModuleInterfaces.cs" />
<Compile Include="Types\StreamHandle.cs" />
<Compile Include="Types\Module.cs" />
<Compile Include="Types\DtmfCallbackFunction.cs" />
<Compile Include="Types\FileHandle.cs" />
<Compile Include="Types\MemoryPool.cs" />
<Compile Include="Types\LoadableModule.cs" />
<Compile Include="Types\LoadableModuleInterface.cs" />
<Compile Include="Types\TextChannel.cs" />
<Compile Include="Types\CoreSession.cs" />
<Compile Include="Types\Event.cs" />
<Compile Include="Types\Status.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Makefile" />
<None Include="public.snk" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -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/

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Marshaling.Types;
using FreeSwitch.NET.Types;
namespace FreeSwitch.NET.Marshaling
{
class BufferMarshaler : ICustomMarshaler
{
private static BufferMarshaler Instance = new BufferMarshaler();
public static ICustomMarshaler GetInstance(string s)
{
return Instance;
}
public void CleanUpManagedData(object o)
{
}
public void CleanUpNativeData(IntPtr pNativeData)
{
}
public int GetNativeDataSize()
{
return IntPtr.Size;
}
public IntPtr MarshalManagedToNative(object obj)
{
FreeSwitch.NET.Types.Buffer buffer = (FreeSwitch.NET.Types.Buffer)obj;
return buffer.marshaledObject.Handle;
}
public object MarshalNativeToManaged(IntPtr bufferPtr)
{
FreeSwitch.NET.Types.Buffer buffer = new FreeSwitch.NET.Types.Buffer();
BufferMarshal bufferMarshal = new BufferMarshal();
Marshal.PtrToStructure(bufferPtr, bufferMarshal);
buffer.marshaledObject = new HandleRef(bufferMarshal, bufferPtr);
return buffer;
}
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Types;
using FreeSwitch.NET.Marshaling.Types;
namespace FreeSwitch.NET.Marshaling
{
class CallerExtensionMarshaler : ICustomMarshaler
{
private static CallerExtensionMarshaler Instance = new CallerExtensionMarshaler();
public static ICustomMarshaler GetInstance(string s)
{
return Instance;
}
public void CleanUpManagedData(object o)
{
}
public void CleanUpNativeData(IntPtr pNativeData)
{
}
public int GetNativeDataSize()
{
return IntPtr.Size;
}
public IntPtr MarshalManagedToNative(object obj)
{
CallerExtension callerExtension = (CallerExtension)obj;
return callerExtension.marshaledObject.Handle;
}
public object MarshalNativeToManaged(IntPtr callerExtensionPtr)
{
CallerExtensionMarshal callerExtensionMarshal = new CallerExtensionMarshal();
CallerExtension callerExtension = new CallerExtension();
Marshal.PtrToStructure(callerExtensionPtr, callerExtensionMarshal);
callerExtension.marshaledObject = new HandleRef(callerExtensionMarshal, callerExtensionPtr);
return callerExtension;
}
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Types;
using FreeSwitch.NET.Marshaling.Types;
namespace FreeSwitch.NET.Marshaling
{
class CallerProfileMarshaler : ICustomMarshaler
{
private static CallerProfileMarshaler Instance = new CallerProfileMarshaler();
public static ICustomMarshaler GetInstance(string s)
{
return Instance;
}
public void CleanUpManagedData(object o)
{
}
public void CleanUpNativeData(IntPtr pNativeData)
{
}
public int GetNativeDataSize()
{
return IntPtr.Size;
}
public IntPtr MarshalManagedToNative(object obj)
{
CallerProfile callerProfile = (CallerProfile) obj;
return callerProfile.marshaledObject.Handle;
}
public object MarshalNativeToManaged(IntPtr callerProfilePtr)
{
CallerProfileMarshal callerProfileMarshal = new CallerProfileMarshal();
CallerProfile callerProfile = new CallerProfile();
Marshal.PtrToStructure(callerProfilePtr, callerProfileMarshal);
callerProfile.marshaledObject = new HandleRef(callerProfileMarshal, callerProfilePtr);
return callerProfile;
}
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Types;
using FreeSwitch.NET.Marshaling.Types;
namespace FreeSwitch.NET.Marshaling
{
class ChannelMarshaler : ICustomMarshaler
{
private static ChannelMarshaler Instance = new ChannelMarshaler();
public static ICustomMarshaler GetInstance(string s)
{
return Instance;
}
public void CleanUpManagedData(object o)
{
}
public void CleanUpNativeData(IntPtr pNativeData)
{
}
public int GetNativeDataSize()
{
return IntPtr.Size;
}
public IntPtr MarshalManagedToNative(object obj)
{
Channel channel = (Channel) obj;
return channel.marshaledObject.Handle;
}
public object MarshalNativeToManaged(IntPtr ptr)
{
ChannelMarshal channelMarshal = new ChannelMarshal();
Channel channel = new Channel();
Marshal.PtrToStructure(ptr, channelMarshal);
channel.marshaledObject = new HandleRef(channelMarshal, ptr);
return channel;
}
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Types;
using FreeSwitch.NET.Marshaling.Types;
namespace FreeSwitch.NET.Marshaling
{
class ChannelTimetableMarshaler : ICustomMarshaler
{
private static ChannelTimetableMarshaler Instance = new ChannelTimetableMarshaler();
public static ICustomMarshaler GetInstance(string s)
{
return Instance;
}
public void CleanUpManagedData(object o)
{
}
public void CleanUpNativeData(IntPtr pNativeData)
{
}
public int GetNativeDataSize()
{
return IntPtr.Size;
}
public IntPtr MarshalManagedToNative(object obj)
{
ChannelTimetable channelTimetable = (ChannelTimetable)obj;
return channelTimetable.marshaledObject.Handle;
}
public object MarshalNativeToManaged(IntPtr channelTimetablePtr)
{
ChannelTimetableMarshal channelTimetableMarshal = new ChannelTimetableMarshal();
ChannelTimetable channelTimetable = new ChannelTimetable();
Marshal.PtrToStructure(channelTimetablePtr, channelTimetableMarshal);
channelTimetable.marshaledObject = new HandleRef(channelTimetableMarshal, channelTimetablePtr);
return channelTimetable;
}
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Types;
using FreeSwitch.NET.Marshaling.Types;
namespace FreeSwitch.NET.Marshaling
{
class CoreSessionMarshaler : ICustomMarshaler
{
private static CoreSessionMarshaler Instance = new CoreSessionMarshaler();
public static ICustomMarshaler GetInstance(string s)
{
return Instance;
}
public void CleanUpManagedData(object o)
{
}
public void CleanUpNativeData(IntPtr pNativeData)
{
}
public int GetNativeDataSize()
{
return IntPtr.Size;
}
public IntPtr MarshalManagedToNative(object obj)
{
CoreSession coreSession = (CoreSession)obj;
return coreSession.marshaledObject.Handle;
}
public object MarshalNativeToManaged(IntPtr coreSessionPtr)
{
CoreSessionMarshal coreSessionMarshal = new CoreSessionMarshal();
CoreSession coreSession = new CoreSession();
Marshal.PtrToStructure(coreSessionPtr, coreSessionMarshal);
coreSession.marshaledObject = new HandleRef(coreSessionMarshal, coreSessionPtr);
return coreSession;
}
}
}

View File

@ -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 --
*
*/
using System;
using System.Collections;
using FreeSwitch.NET.Marshaling.Types;
using FreeSwitch.NET.Types;
using System.Runtime.InteropServices;
namespace FreeSwitch.NET.Marshaling
{
class EventMarshaler : ICustomMarshaler
{
private static EventMarshaler Instance = new EventMarshaler();
public static ICustomMarshaler GetInstance(string s)
{
return Instance;
}
public void CleanUpManagedData(object o)
{
}
public void CleanUpNativeData(IntPtr pNativeData)
{
}
public int GetNativeDataSize()
{
return IntPtr.Size;
}
public IntPtr MarshalManagedToNative(object obj)
{
Event eventObj = (Event)obj;
return eventObj.marshaledObject.Handle;
}
public object MarshalNativeToManaged(IntPtr eventPtr)
{
EventMarshal eventMarshal = new EventMarshal();
Event eventObj = new Event();
Marshal.PtrToStructure(eventPtr, eventMarshal);
eventObj.marshaledObject = new HandleRef(eventMarshal, eventPtr);
return eventObj;
}
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Types;
using FreeSwitch.NET.Marshaling.Types;
namespace FreeSwitch.NET.Marshaling
{
class FileHandleMarshaler : ICustomMarshaler
{
private static FileHandleMarshaler Instance = new FileHandleMarshaler();
public static ICustomMarshaler GetInstance(string s)
{
return Instance;
}
public void CleanUpManagedData(object o)
{
}
public void CleanUpNativeData(IntPtr pNativeData)
{
}
public int GetNativeDataSize()
{
return IntPtr.Size;
}
public IntPtr MarshalManagedToNative(object obj)
{
FileHandle fileHandle = (FileHandle)obj;
return fileHandle.marshaledObject.Handle;
}
public object MarshalNativeToManaged(IntPtr file_handle)
{
FileHandleMarshal fileHandleMarshal = new FileHandleMarshal();
FileHandle fileHandle = new FileHandle();
fileHandle.marshaledObject = new HandleRef(fileHandleMarshal, file_handle);
return fileHandle;
}
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Types;
using FreeSwitch.NET.Marshaling.Types;
namespace FreeSwitch.NET.Marshaling
{
class MemoryPoolMarshaler : ICustomMarshaler
{
private static MemoryPoolMarshaler Instance = new MemoryPoolMarshaler();
public static ICustomMarshaler GetInstance(string s)
{
return Instance;
}
public void CleanUpManagedData(object o)
{
}
public void CleanUpNativeData(IntPtr pNativeData)
{
}
public int GetNativeDataSize()
{
return IntPtr.Size;
}
public IntPtr MarshalManagedToNative(object obj)
{
MemoryPool memoryPool = (MemoryPool) obj;
return memoryPool.marshaledObject.Handle;
}
public object MarshalNativeToManaged(IntPtr pool)
{
MemoryPool memoryPool = new MemoryPool();
memoryPool.marshaledObject = new HandleRef(new IntPtr(), pool);
return memoryPool;
}
}
}

View File

@ -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 --
*
*/
using System;
using System.Collections;
using FreeSwitch.NET.Marshaling.Types;
using FreeSwitch.NET.Types;
using System.Runtime.InteropServices;
namespace FreeSwitch.NET.Marshaling
{
class StreamHandleMarshaler : ICustomMarshaler
{
private static StreamHandleMarshaler Instance = new StreamHandleMarshaler();
public static ICustomMarshaler GetInstance(string s)
{
return Instance;
}
public void CleanUpManagedData(object o)
{
}
public void CleanUpNativeData(IntPtr pNativeData)
{
}
public int GetNativeDataSize()
{
return IntPtr.Size;
}
public IntPtr MarshalManagedToNative(object obj)
{
StreamHandle streamHandleObj = (StreamHandle)obj;
return streamHandleObj.marshaledObject.Handle;
}
public object MarshalNativeToManaged(IntPtr streamHandlePtr)
{
StreamHandleMarshal streamHandleMarshal = new StreamHandleMarshal();
StreamHandle streamHandleObj = new StreamHandle();
Marshal.PtrToStructure(streamHandlePtr, streamHandleMarshal);
streamHandleObj.marshaledObject = new HandleRef(streamHandleMarshal, streamHandlePtr);
return streamHandleObj;
}
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Types;
namespace FreeSwitch.NET.Marshaling.Types
{
[StructLayout(LayoutKind.Sequential)]
internal class ApiInterfaceMarshal
{
//[MarshalAs(UnmanagedType.LPStr)]
internal IntPtr interface_name;
//[MarshalAs(UnmanagedType.LPStr)]
internal IntPtr desc;
internal ApiFunction function;
internal IntPtr next;
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Types;
namespace FreeSwitch.NET.Marshaling.Types
{
[StructLayout(LayoutKind.Sequential)]
internal class ApplicationInterfaceMarshal
{
// [MarshalAs(UnmanagedType.LPStr)]
internal IntPtr interface_name;
internal ApplicationFunction application_function;
// [MarshalAs(UnmanagedType.LPStr)]
internal IntPtr long_desc;
//[MarshalAs(UnmanagedType.LPStr)]
internal IntPtr short_desc;
//[MarshalAs(UnmanagedType.LPStr)]
internal IntPtr syntax;
internal IntPtr next;
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
namespace FreeSwitch.NET.Marshaling.Types
{
[StructLayout(LayoutKind.Sequential)]
internal class BufferMarshal
{
[MarshalAs(UnmanagedType.LPStr)]
internal string data;
internal int used;
internal int datalen;
internal UInt32 id;
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
namespace FreeSwitch.NET.Marshaling.Types
{
[StructLayout(LayoutKind.Sequential)]
internal class CallerExtensionMarshal
{
internal IntPtr extension_name;
internal IntPtr extension_number;
internal IntPtr current_application;
internal IntPtr last_application;
internal IntPtr applications;
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
namespace FreeSwitch.NET.Marshaling.Types
{
[StructLayout(LayoutKind.Sequential)]
internal class CallerProfileMarshal
{
[MarshalAs(UnmanagedType.LPStr)]
internal string username;
[MarshalAs(UnmanagedType.LPStr)]
internal string dialplan;
[MarshalAs(UnmanagedType.LPStr)]
internal string caller_id_name;
[MarshalAs(UnmanagedType.LPStr)]
internal string caller_id_number;
[MarshalAs(UnmanagedType.LPStr)]
internal string network_addr;
[MarshalAs(UnmanagedType.LPStr)]
internal string ani;
[MarshalAs(UnmanagedType.LPStr)]
internal string ani2;
[MarshalAs(UnmanagedType.LPStr)]
internal string rdnis;
[MarshalAs(UnmanagedType.LPStr)]
internal string destination_number;
[MarshalAs(UnmanagedType.LPStr)]
internal string source;
[MarshalAs(UnmanagedType.LPStr)]
internal string chan_name;
[MarshalAs(UnmanagedType.LPStr)]
internal string uuid;
[MarshalAs(UnmanagedType.LPStr)]
internal string context;
internal IntPtr next;
}
}

View File

@ -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 --
*
*/
using System;
namespace FreeSwitch.NET.Marshaling.Types
{
internal enum ChannelFlagMarshal
{
CF_SEND_AUDIO,
CF_RECV_AUDIO,
CF_ANSWERED,
CF_OUTBOUND,
CF_EARLY_MEDIA,
CF_ORIGINATOR,
CF_TRANSFER
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Types;
namespace FreeSwitch.NET.Marshaling.Types
{
[StructLayout(LayoutKind.Sequential)]
internal class ChannelMarshal
{
internal IntPtr name;
internal IntPtr dtmf_buffer;
internal IntPtr dtmf_mutex;
internal IntPtr flag_mutex;
internal IntPtr profile_mutex;
internal IntPtr session;
internal ChannelState state;
internal UInt32 flags;
internal IntPtr caller_profile;
internal IntPtr originator_caller_profile;
internal IntPtr originatee_caller_profile;
internal IntPtr caller_extension;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=120)]
internal byte[] state_handlers;
internal int state_handler_index;
internal IntPtr variables;
internal IntPtr times;
internal IntPtr private_info;
internal IntPtr hangup_cause;
internal int freq;
internal int bits;
internal int channels;
internal int ms;
internal int kbps;
}
}

View File

@ -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 --
*
*/
using System;
namespace FreeSwitch.NET.Marshaling.Types
{
internal enum ChannelStateMarshal
{
CS_NEW,
CS_INIT,
CS_RING,
CS_TRANSMIT,
CS_EXECUTE,
CS_LOOPBACK,
CS_HANGUP,
CS_DONE
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
namespace FreeSwitch.NET.Marshaling.Types
{
[StructLayout(LayoutKind.Sequential)]
internal class ChannelTimetableMarshal
{
internal Int64 created;
internal Int64 answered;
internal Int64 hungup;
}
}

View File

@ -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 --
*
*/
using System;
using FreeSwitch.NET.Types;
namespace FreeSwitch.NET.Marshaling.Types
{
internal class CodecImplementationMarshal
{
internal UInt32 samples_per_seconds;
internal int bits_per_second;
internal int microseconds_per_frame;
internal UInt32 samples_per_frame;
internal UInt32 bytes_per_frame;
internal UInt32 encoded_bytes_per_frame;
internal Byte number_of_channels;
internal int pref_frames_per_packet;
internal int max_frames_per_packet;
//internal CodecInitMarshal init;
//internal CodecEncodeMarshal encode;
//internal CodecDecode decode;
//internal CodecDestroy destroy;
internal IntPtr next;
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Types;
namespace FreeSwitch.NET.Marshaling.Types
{
[StructLayout(LayoutKind.Sequential)]
internal class CodecInterfaceMarshal
{
[MarshalAs(UnmanagedType.LPStr)]
internal string interface_name;
/*
internal CodecImplementation application_function;
[MarshalAs(UnmanagedType.LPStr)]
internal string long_desc;
[MarshalAs(UnmanagedType.LPStr)]
internal string short_desc;
[MarshalAs(UnmanagedType.LPStr)]
internal string syntax;
internal IntPtr next;
}
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;
};*/
}
}

View File

@ -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 --
*
*/
using System;
using System.Text;
namespace FreeSwitch.NET.Marshaling.Types
{
internal class CodecMarshal
{
internal IntPtr codec_interface;
internal IntPtr implementation;
//internal CodecSettingsMarshal codec_settings;
internal UInt32 flags;
//internal MemoryPoolMarshal memory_pool;
internal IntPtr private_info;
}
}

View File

@ -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 --
*
*/
using System;
namespace FreeSwitch.NET.Marshaling.Types
{
internal enum CodecTypesMarshal
{
SWITCH_CODEC_TYPE_AUDIO,
SWITCH_CODEC_TYPE_VIDEO,
SWITCH_CODEC_TYPE_T38,
SWITCH_CODEC_TYPE_APP
}
}

View File

@ -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 --
*
*/
using System;
using System.Text;
using System.Runtime.InteropServices;
namespace FreeSwitch.NET.Marshaling.Types
{
[StructLayout(LayoutKind.Sequential, Pack=1)]
internal class CoreSessionMarshal
{
internal UInt32 id;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=80)]
internal byte[] name;
internal int thread_running;
internal IntPtr pool;
internal IntPtr channel;
internal IntPtr thread;
internal IntPtr endpoint_interface;
internal IOEventHooksMarshal event_hooks;
internal IntPtr read_codec;
internal IntPtr write_codec;
internal IntPtr raw_write_buffer;
internal FrameMarshal raw_write_frame;
internal FrameMarshal enc_write_frame;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=2048)]
internal byte[] raw_write_buf;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=2048)]
internal byte[] enc_write_buf;
internal IntPtr raw_read_buffer;
internal FrameMarshal raw_read_frame;
internal FrameMarshal enc_read_frame;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=2048)]
internal byte[] raw_read_buf;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=2048)]
internal byte[] enc_read_buf;
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;
internal IntPtr private_info;
internal IntPtr event_queue;
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Types;
namespace FreeSwitch.NET.Marshaling.Types
{
[StructLayout(LayoutKind.Sequential)]
internal class EventMarshal
{
internal EventType event_id;
internal Priority priority;
internal IntPtr owner;
internal IntPtr subclass;
internal IntPtr headers;
internal IntPtr body;
internal IntPtr bind_user_data;
internal IntPtr event_user_data;
internal IntPtr next;
}
[StructLayout(LayoutKind.Sequential)]
internal class EventHeaderMarshal
{
internal string name;
internal string value;
internal IntPtr next;
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
namespace FreeSwitch.NET.Marshaling.Types
{
[StructLayout(LayoutKind.Sequential)]
internal class FileHandleMarshal
{
internal IntPtr file_interface;
internal UInt32 flags;
internal IntPtr fd;
internal uint samples;
internal UInt32 samplerate;
internal Byte channels;
internal uint format;
internal uint sections;
internal int seekable;
internal uint sample_count;
internal int speed;
internal IntPtr memory_pool;
internal IntPtr private_info;
internal Int64 pos;
internal IntPtr audio_buffer;
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Types;
namespace FreeSwitch.NET.Marshaling.Types
{
[StructLayout(LayoutKind.Sequential)]
internal class FrameMarshal
{
internal IntPtr codec;
internal IntPtr source;
internal IntPtr packet;
internal UInt32 packetlen;
internal IntPtr data;
internal UInt32 datalen;
internal UInt32 buflen;
internal UInt32 samples;
internal UInt32 rate;
internal byte payload;
internal UInt32 timestamp;
internal byte flags;
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
namespace FreeSwitch.NET.Marshaling.Types
{
[StructLayout(LayoutKind.Sequential)]
internal class IOEventHooksMarshal
{
internal IntPtr outgoing_channel;
internal IntPtr answer_channel;
internal IntPtr receive_message;
internal IntPtr receive_event;
internal IntPtr read_frame;
internal IntPtr write_frame;
internal IntPtr kill_channel;
internal IntPtr waitfor_read;
internal IntPtr waitfor_write;
internal IntPtr send_dtmf;
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Types;
namespace FreeSwitch.NET.Marshaling.Types
{
[StructLayout(LayoutKind.Sequential)]
internal class LoadableModuleInterfaceMarshal
{
internal IntPtr module_name;
internal IntPtr endpoint_interface;
internal IntPtr timer_interface;
internal IntPtr dialplan_interface;
internal IntPtr codec_interface;
internal IntPtr application_interface;
internal IntPtr api_interface;
internal IntPtr file_interface;
internal IntPtr speech_interface;
internal IntPtr directory_interface;
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Types;
namespace FreeSwitch.NET.Marshaling.Types
{
[StructLayout(LayoutKind.Sequential)]
public class LoadableModuleMarshal
{
public IntPtr filename;
public IntPtr module_interface;
public IntPtr lib;
public ModuleLoad module_load;
public ModuleReload module_reload;
public ModulePause module_pause;
public ModuleResume module_resume;
public ModuleStatus module_status;
public ModuleRuntime module_runtime;
public ModuleShutdown module_shutdown;
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Types;
namespace FreeSwitch.NET.Marshaling.Types
{
[StructLayout(LayoutKind.Sequential)]
internal class StreamHandleMarshal
{
internal IntPtr write_function;
internal IntPtr data;
internal IntPtr end;
internal int data_size;
internal int data_len;
internal IntPtr _event;
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Types;
namespace FreeSwitch.NET.Marshaling.Types
{
public delegate
Status DtmfCallbackFunctionMarshal(
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(CoreSessionMarshaler))]
CoreSession session,
string dtmf,
IntPtr buf,
uint buflen);
}

205
src/dotnet/dotnet/Module.cs Normal file
View File

@ -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;
using System.Collections;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
using FreeSwitch.NET;
using FreeSwitch.NET.Types;
using FreeSwitch.NET.Modules;
using FreeSwitch.NET.Marshaling.Types;
namespace FreeSwitch.NET
{
/// <summary>
/// Base class for all Freeswitch.NET modules
/// </summary>
/// <example>
/// public class Example : Module
/// {
/// public Example()
/// {
/// AddApiInterface(new ExampleApi());
/// AddApplicationInterface(new ExampleApplication());
///
/// Register();
/// }
/// }
/// </example>
public class Module
{
private LoadableModuleInterfaceMarshal module_interface = new LoadableModuleInterfaceMarshal();
private LoadableModuleMarshal module = new LoadableModuleMarshal();
private ArrayList applicationInterfaces = new ArrayList();
private ArrayList apiInterfaces = new ArrayList();
private ModuleLoad load;
private string name;
private string filename = Assembly.GetCallingAssembly().GetName().Name;
/// <summary>
/// Module constructor
/// </summary>
public Module()
{
Console.WriteLine("*** Creating new module object");
load = new ModuleLoad(Load);
}
/// <summary>
/// Implementation of ModuleLoad Delegate
/// </summary>
/// <param name="module"></param>
/// <param name="name"></param>
/// <returns></returns>
public Status Load(ref IntPtr module, string name)
{
/* Allocate some unmanaged mem for the ModuleInterface */
module = Marshal.AllocHGlobal(Marshal.SizeOf(module_interface));
/* Set the module_name field of the LoadableModuleInterface */
module_interface.module_name = Marshal.StringToHGlobalAnsi(filename);
/* Grab the first ApiInterface in our array and add a pointer to this in our ModuleInterface*/
Api apiIndex = (Api)apiInterfaces[0];
module_interface.api_interface = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(ApiInterfaceMarshal)));
Marshal.StructureToPtr(apiIndex.handle.Wrapper, module_interface.api_interface, true);
/* For each Application interface */
Application applicationIndex = (Application)applicationInterfaces[0];
module_interface.application_interface = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(ApplicationInterfaceMarshal)));
Marshal.StructureToPtr(applicationIndex.handle.Wrapper, module_interface.application_interface, true);
/* Finally, marshal the moduleinterface class and return */
Marshal.StructureToPtr(module_interface, module, true);
return Status.Success;
}
/// <summary>
/// AddApiInterface
/// </summary>
/// <param name="apiInterface"></param>
public void AddApiInterface(Api apiInterface)
{
/* Create a new ApiInterface type and allocate unmanaged mem */
ApiInterfaceMarshal apiInterfaceMarshal = new ApiInterfaceMarshal();
IntPtr apiInterfacePtr = Marshal.AllocHGlobal(Marshal.SizeOf(apiInterfaceMarshal));
/* Allocate umanaged mem to to interface fields so GC doesn't disturb them */
apiInterfaceMarshal.interface_name = Marshal.StringToHGlobalAnsi(apiInterface.Name);
apiInterfaceMarshal.desc = Marshal.StringToHGlobalAnsi(apiInterface.Description);
apiInterfaceMarshal.function = new ApiFunction(apiInterface.ApiFunction);
/* Set the handle of the managed object */
apiInterface.handle = new HandleRef(apiInterfaceMarshal, apiInterfacePtr);
Marshal.StructureToPtr(apiInterfaceMarshal, apiInterface.handle.Handle, true);
/* Check to see whether there is already an interface defined, if there is then
* we want to set the *next pointer of the last element before adding the new
* interface to the array
*/
if (apiInterfaces.Count > 0)
{
Api apiInterfaceElement = (Api)apiInterfaces[apiInterfaces.Count - 1];
ApiInterfaceMarshal apiInterfacePrev = (ApiInterfaceMarshal)apiInterfaceElement.handle.Wrapper;
apiInterfacePrev.next = apiInterface.handle.Handle;
}
/* Finally, add our new interface to the array */
apiInterfaces.Add(apiInterface);
}
/// <summary>
/// AddApplicationInterface
/// </summary>
/// <param name="applicationInterface"></param>
public void AddApplicationInterface(Application applicationInterface)
{
/* Create a new ApplicationInterface type and allocate unmanaged mem */
ApplicationInterfaceMarshal applicationInterfaceMarshal = new ApplicationInterfaceMarshal();
IntPtr applicationInterfacePtr = Marshal.AllocHGlobal(Marshal.SizeOf(applicationInterfaceMarshal));
/* Allocate umanaged mem to to interface fields so GC doesn't disturb them */
applicationInterfaceMarshal.interface_name = Marshal.StringToHGlobalAnsi(applicationInterface.Name);
applicationInterfaceMarshal.syntax = Marshal.StringToHGlobalAnsi(applicationInterface.Syntax);
applicationInterfaceMarshal.long_desc = Marshal.StringToHGlobalAnsi(applicationInterface.LongDescription);
applicationInterfaceMarshal.short_desc = Marshal.StringToHGlobalAnsi(applicationInterface.ShortDescription);
applicationInterfaceMarshal.application_function = new ApplicationFunction(applicationInterface.ApplicationFunction);
/* Set the handle of the managed object */
applicationInterface.handle = new HandleRef(applicationInterfaceMarshal, applicationInterfacePtr);
Marshal.StructureToPtr(applicationInterfaceMarshal, applicationInterface.handle.Handle, true);
/* Check to see whether there is already an interface defined, if there is then
* we want to set the *next pointer of the last element before adding the new
* interface to the array
*/
if (applicationInterfaces.Count > 0)
{
Application applicationInterfaceElement = (Application)applicationInterfaces[applicationInterfaces.Count - 1];
ApplicationInterfaceMarshal applicationInterfacePrev = (ApplicationInterfaceMarshal)applicationInterfaceElement.handle.Wrapper;
applicationInterfacePrev.next = applicationInterface.handle.Handle;
}
/* Finally, add our new interface to the array */
applicationInterfaces.Add(applicationInterface);
}
/// <summary>
/// Register
/// </summary>
public void Register()
{
module.module_load = new ModuleLoad(Load);
Switch.switch_loadable_module_build_dynamic(filename,
module.module_load,
module.module_runtime,
module.module_shutdown);
}
}
}

View File

@ -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 --
*
*/
using System;
using System.Collections;
using System.Text;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Types;
namespace FreeSwitch.NET.Modules
{
public class Api
{
private string name;
private string description;
private ApiFunction apiFunction;
public HandleRef handle;
public string Name
{
set { name = value; }
get { return name; }
}
public string Description
{
set { description = value; }
get { return description; }
}
public ApiFunction ApiFunction
{
set { apiFunction = value; }
get { return apiFunction; }
}
}
}

View File

@ -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 --
*
*/
using System;
using System.Collections;
using System.Text;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Marshaling;
using FreeSwitch.NET.Types;
using FreeSwitch.NET.Marshaling.Types;
namespace FreeSwitch.NET.Modules
{
public class Application
{
private string name;
private string longDescription;
private string shortDescription;
private string syntax;
private ApplicationFunction applicationFunction;
public HandleRef handle;
public string Name
{
set { name = value; }
get { return name; }
}
public string ShortDescription
{
set { shortDescription = value; }
get { return shortDescription; }
}
public string LongDescription
{
set { longDescription = value; }
get { return longDescription; }
}
public string Syntax
{
set { syntax = value; }
get { return syntax; }
}
public ApplicationFunction ApplicationFunction
{
set { applicationFunction = value; }
get { return applicationFunction; }
}
}
}

View File

@ -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.")]

View File

@ -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 --
*
*/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Types;
using FreeSwitch.NET.Marshaling;
using FreeSwitch.NET.Marshaling.Types;
namespace FreeSwitch.NET
{
public partial class Switch
{
/*
* TODO: Figure out how to stop mono from trying to free the returned string.
*/
[DllImport("freeswitch")]
//[return: MarshalAs(UnmanagedType.LPStr)]
public extern static
IntPtr switch_caller_get_field_by_name(
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CallerProfileMarshaler))]
CallerProfile caller_profile,
[MarshalAs(UnmanagedType.LPStr)]
string name);
/*
[DllImport("freeswitch")]
[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CallerProfileMarshaler))]
public extern static
CallerProfile switch_caller_profile_clone(
[MarshalAs
switch_core_session_t *session, switch_caller_profile_t *tocopy)
*/
[DllImport("freeswitch")]
[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CallerProfileMarshaler))]
public extern static
CallerProfile switch_caller_profile_new(
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(MemoryPoolMarshaler))]
MemoryPool pool,
[MarshalAs(UnmanagedType.LPStr)]
string username,
[MarshalAs(UnmanagedType.LPStr)]
string dialplan,
[MarshalAs(UnmanagedType.LPStr)]
string callerIdName,
[MarshalAs(UnmanagedType.LPStr)]
string callerIdNumber,
[MarshalAs(UnmanagedType.LPStr)]
string networkAddress,
[MarshalAs(UnmanagedType.LPStr)]
string ani,
[MarshalAs(UnmanagedType.LPStr)]
string ani2,
[MarshalAs(UnmanagedType.LPStr)]
string rdnis,
[MarshalAs(UnmanagedType.LPStr)]
string source,
[MarshalAs(UnmanagedType.LPStr)]
string context,
[MarshalAs(UnmanagedType.LPStr)]
string destinationNumber);
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Types;
using FreeSwitch.NET.Marshaling;
namespace FreeSwitch.NET
{
public partial class Switch
{
[DllImport("freeswitch")]
public extern static
ChannelState switch_channel_set_state(
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ChannelMarshaler))]
Channel channel,
ChannelState channelState);
[DllImport("freeswitch")]
public extern static
ChannelState switch_channel_get_state(
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ChannelMarshaler))]
Channel channel);
[DllImport("freeswitch")]
public extern static
Status switch_channel_answer(
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ChannelMarshaler))]
Channel channel);
[DllImport("freeswitch")]
public extern static
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);
[DllImport("freeswitch")]
[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CallerExtensionMarshaler))]
public extern static
CallerExtension switch_channel_get_caller_extension(
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ChannelMarshaler))]
Channel channel);
[DllImport("freeswitch")]
[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(CallerProfileMarshaler))]
public extern static
CallerProfile switch_channel_get_caller_profile(
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ChannelMarshaler))]
Channel channel);
[DllImport("freeswitch")]
[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CallerProfileMarshaler))]
public extern static
CallerProfile switch_channel_get_originator_caller_profile(
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ChannelMarshaler))]
Channel channel);
[DllImport("freeswitch")]
[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(CallerProfileMarshaler))]
public extern static
CallerProfile switch_channel_get_originatee_caller_profile(
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ChannelMarshaler))]
Channel channel);
[DllImport("freeswitch")]
public extern static
ChannelState switch_channel_hangup(
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ChannelMarshaler))]
Channel channel,
CallCause hangup_cause);
[DllImport("freeswitch")]
public extern static
uint switch_channel_ready(
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ChannelMarshaler))]
Channel channel);
}
}

View File

@ -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;
using System.Diagnostics;
using System.Text;
namespace FreeSwitch.NET
{
public partial class Switch
{
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Types;
using FreeSwitch.NET.Marshaling;
namespace FreeSwitch.NET
{
public partial class Switch
{
[DllImport("freeswitch")]
[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ChannelMarshaler))]
public extern static
Channel switch_core_session_get_channel(
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CoreSessionMarshaler))]
CoreSession session);
[DllImport("freeswitch")]
[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(MemoryPoolMarshaler))]
public extern static
MemoryPool switch_core_session_get_pool(
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CoreSessionMarshaler))]
CoreSession session);
[DllImport("freeswitch")]
public extern static
Status switch_core_session_outgoing_channel(
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CoreSessionMarshaler))]
CoreSession session,
[MarshalAs(UnmanagedType.LPStr)]
string endpointName,
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CallerProfileMarshaler))]
CallerProfile caller_profile,
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CoreSessionMarshaler))]
ref CoreSession new_session,
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(MemoryPoolMarshaler))]
MemoryPool pool);
}
}

82
src/dotnet/dotnet/Switch/Ivr.cs Executable file
View File

@ -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 --
*
*/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Types;
using FreeSwitch.NET.Marshaling;
using FreeSwitch.NET.Marshaling.Types;
namespace FreeSwitch.NET
{
public partial class Switch
{
[DllImport("freeswitch")]
extern public static
Status switch_ivr_play_file(
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(CoreSessionMarshaler))]
CoreSession session,
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(FileHandleMarshaler))]
FileHandle fh,
[MarshalAs(UnmanagedType.LPStr)]
string file,
[MarshalAs(UnmanagedType.LPStr)]
string timer_name,
InputCallbackFunction input_callback,
IntPtr buf,
uint buflen);
[DllImport("freeswitch")]
public extern static
Status switch_ivr_multi_threaded_bridge(
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CoreSessionMarshaler))]
CoreSession session,
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CoreSessionMarshaler))]
CoreSession peer_session,
uint timelimit,
IntPtr dtmf_callback,
IntPtr session_data,
IntPtr peer_session_data);
[DllImport("freeswitch")]
public extern static
Status switch_ivr_record_file(
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CoreSessionMarshaler))]
CoreSession session,
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(FileHandleMarshaler))]
FileHandle fh,
IntPtr file,
InputCallbackFunction input_callback,
IntPtr buf,
uint buflen);
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Types;
using FreeSwitch.NET.Marshaling.Types;
namespace FreeSwitch.NET
{
/*
* SWITCH_DECLARE(switch_status_t) switch_loadable_module_load_module(char *dir, char *fname)
* SWITCH_DECLARE(switch_status_t) switch_loadable_module_build_dynamic(char *filename,
* SWITCH_DECLARE(switch_status_t) switch_loadable_module_init()
* SWITCH_DECLARE(void) switch_loadable_module_shutdown(void)
* SWITCH_DECLARE(switch_endpoint_interface_t *) switch_loadable_module_get_endpoint_interface(char *name)
* SWITCH_DECLARE(switch_codec_interface_t *) switch_loadable_module_get_codec_interface(char *name)
* SWITCH_DECLARE(switch_dialplan_interface_t *) switch_loadable_module_get_dialplan_interface(char *name)
* SWITCH_DECLARE(switch_timer_interface_t *) switch_loadable_module_get_timer_interface(char *name)
* SWITCH_DECLARE(switch_application_interface_t *) switch_loadable_module_get_application_interface(char *name)
* SWITCH_DECLARE(switch_api_interface_t *) switch_loadable_module_get_api_interface(char *name)
* SWITCH_DECLARE(switch_file_interface_t *) switch_loadable_module_get_file_interface(char *name)
* SWITCH_DECLARE(switch_speech_interface_t *) switch_loadable_module_get_speech_interface(char *name)
* SWITCH_DECLARE(switch_directory_interface_t *) switch_loadable_module_get_directory_interface(char *name)
* SWITCH_DECLARE(int) switch_loadable_module_get_codecs(switch_memory_pool_t *pool, switch_codec_interface_t **array,
* SWITCH_DECLARE(int) switch_loadable_module_get_codecs_sorted(switch_codec_interface_t **array,
* SWITCH_DECLARE(switch_status_t) switch_api_execute(char *cmd, char *arg, char *retbuf, switch_size_t len)
*/
public partial class Switch
{
[DllImport("__Internal")]
public static extern
Status
switch_loadable_module_build_dynamic(
string filename,
[MarshalAs(UnmanagedType.FunctionPtr)]
ModuleLoad switch_module_load,
[MarshalAs(UnmanagedType.FunctionPtr)]
ModuleRuntime switch_module_runtime,
[MarshalAs(UnmanagedType.FunctionPtr)]
ModuleShutdown switch_module_shutdown);
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Types;
using FreeSwitch.NET.Marshaling.Types;
namespace FreeSwitch.NET
{
/*
* SWITCH_DECLARE(switch_status_t) switch_loadable_module_load_module(char *dir, char *fname)
* SWITCH_DECLARE(switch_status_t) switch_loadable_module_build_dynamic(char *filename,
* SWITCH_DECLARE(switch_status_t) switch_loadable_module_init()
* SWITCH_DECLARE(void) switch_loadable_module_shutdown(void)
* SWITCH_DECLARE(switch_endpoint_interface_t *) switch_loadable_module_get_endpoint_interface(char *name)
* SWITCH_DECLARE(switch_codec_interface_t *) switch_loadable_module_get_codec_interface(char *name)
* SWITCH_DECLARE(switch_dialplan_interface_t *) switch_loadable_module_get_dialplan_interface(char *name)
* SWITCH_DECLARE(switch_timer_interface_t *) switch_loadable_module_get_timer_interface(char *name)
* SWITCH_DECLARE(switch_application_interface_t *) switch_loadable_module_get_application_interface(char *name)
* SWITCH_DECLARE(switch_api_interface_t *) switch_loadable_module_get_api_interface(char *name)
* SWITCH_DECLARE(switch_file_interface_t *) switch_loadable_module_get_file_interface(char *name)
* SWITCH_DECLARE(switch_speech_interface_t *) switch_loadable_module_get_speech_interface(char *name)
* SWITCH_DECLARE(switch_directory_interface_t *) switch_loadable_module_get_directory_interface(char *name)
* SWITCH_DECLARE(int) switch_loadable_module_get_codecs(switch_memory_pool_t *pool, switch_codec_interface_t **array,
* SWITCH_DECLARE(int) switch_loadable_module_get_codecs_sorted(switch_codec_interface_t **array,
* SWITCH_DECLARE(switch_status_t) switch_api_execute(char *cmd, char *arg, char *retbuf, switch_size_t len)
*/
public partial class Switch
{
}
}

View File

@ -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 --
*
*/

View File

@ -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 --
*
*/
using System;
namespace FreeSwitch.NET.Types
{
}

View File

@ -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;
}
* */
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
namespace FreeSwitch.NET.Types
{
public class Buffer
{
internal HandleRef marshaledObject;
public string Data
{
get { throw new NotImplementedException(); }
}
public int Used
{
get { throw new NotImplementedException(); }
}
public int Length
{
get { throw new NotImplementedException(); }
}
}
}

View File

@ -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 --
*
*/
using System;
namespace FreeSwitch.NET.Types
{
public enum CallCause
{
Unallocated,
NoRouteTransitNet,
NoRouteDestination,
ChannelUnacceptable,
CallAwardedDelivered,
NormalClearing,
UserBusy,
NoUserResponse,
NoAnswer,
CallRejected,
NumberChanged,
DestinationOutOfOrder,
InvalidNumberFormat,
FacilityRejected,
ResponseToStatusEnquiry,
NormalUnspecified,
NormalCircuitCongestion,
NetworkOutOfOrder,
NormalTemporaryFailure,
SwitchCongestion,
AccessInfoDescarded,
RequestedChannelUnavailable,
PreEmpted,
FacilityNotSubscribed,
OutgoingCallBarred,
IncomingCallBarred,
BearerCapabilityNotAuth,
BearerCapabilityNotAvail,
BearerCapabilityNotImpl,
ChanNotImplemented,
FacilityNotImplemented,
InvalidCallReference,
IncompatibleDestination,
InvalidMsgUnspecified,
MandatoryIeMissing,
MessageTypeNonExistant,
WrongMessage,
IoNonExistant,
InvalidIeContents,
WrongCallState,
RecoveryOnTimeExpire,
MandatoryIeLengthError,
ProtocolError,
Internetworking
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Marshaling.Types;
namespace FreeSwitch.NET.Types
{
public class CallerExtension
{
internal HandleRef marshaledObject;
public string ExtensionName
{
get
{
CallerExtensionMarshal callerExtension = (CallerExtensionMarshal)marshaledObject.Wrapper;
return Marshal.PtrToStringAnsi(callerExtension.extension_name);
}
}
public string ExtensionNumber
{
get
{
CallerExtensionMarshal callerExtension = (CallerExtensionMarshal)marshaledObject.Wrapper;
return Marshal.PtrToStringAnsi(callerExtension.extension_number);
}
}
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Marshaling.Types;
namespace FreeSwitch.NET.Types
{
public class CallerProfile
{
internal HandleRef marshaledObject;
public static CallerProfile New(MemoryPool pool,
string username,
string dialplan,
string callerIdName,
string callerIdNumber,
string networkAddress,
string ani,
string ani2,
string rdnis,
string source,
string context,
string destinationNumber)
{
return Switch.switch_caller_profile_new(pool, username, dialplan, callerIdName, callerIdNumber, networkAddress, ani, ani2, rdnis, source, context, destinationNumber);
}
public string GetFieldByName(string field)
{
IntPtr ptr;
ptr = Switch.switch_caller_get_field_by_name(this, field);
if (ptr != IntPtr.Zero)
return Marshal.PtrToStringAnsi(ptr);
else
return "";
}
/*
* Properties
*/
public string Dialplan
{
get { return GetFieldByName("dialplan"); }
}
public string CallerIdName
{
get { return GetFieldByName("caller_id_name"); }
}
public string CallerIdNumber
{
get { return GetFieldByName("caller_id_number"); }
}
public string NetworkAddress
{
get { return GetFieldByName("network_addr"); }
}
public string Ani
{
get { return GetFieldByName("ani"); }
}
public string Ani2
{
get { return GetFieldByName("ani2"); }
}
public string Rdnis
{
get { return GetFieldByName("rdnis"); }
}
public string Source
{
get { return GetFieldByName("source"); }
}
public string Context
{
get { return GetFieldByName("context"); }
}
public string DestinationNumber
{
get { return GetFieldByName("destination_number"); }
}
public string ChannelName
{
get { return GetFieldByName("chan_name"); }
}
public string Uuid
{
get{ return GetFieldByName("uuid"); }
}
public string Username
{
get { return GetFieldByName("username"); }
}
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Marshaling.Types;
namespace FreeSwitch.NET.Types
{
/*
* 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;
*/
public class Channel
{
internal HandleRef marshaledObject;
public string Name
{
get
{
ChannelMarshal channel = (ChannelMarshal) marshaledObject.Wrapper;
return Marshal.PtrToStringAnsi(channel.name);
}
}
public Buffer DtmfBuffer
{
get
{
Console.WriteLine("Buffer");
return new Buffer();
//throw new NotImplementedException();
}
}
public ChannelState State
{
set
{
Switch.switch_channel_set_state(this, value);
}
get
{
return Switch.switch_channel_get_state(this);
}
}
public bool IsReady
{
get
{
uint isReady = Switch.switch_channel_ready(this);
if (isReady != 0)
return true;
else
return false;
}
}
public ChannelFlag Flags
{
get
{
Console.WriteLine("ChannelFlag");
return new ChannelFlag();
//throw new NotImplementedException();
}
}
public CallerProfile CallerProfile
{
get
{
return Switch.switch_channel_get_caller_profile(this);
}
}
public CallerProfile OriginatorCallerProfile
{
get
{
return Switch.switch_channel_get_originator_caller_profile(this);
}
}
public CallerProfile OriginateeCallerProfile
{
get
{
return Switch.switch_channel_get_originatee_caller_profile(this);
}
}
public CallerExtension CallerExtension
{
get
{
return Switch.switch_channel_get_caller_extension(this);
}
}
public ChannelTimetable Times
{
get
{
Console.WriteLine("Channel Timetable");
return new ChannelTimetable();
// throw new NotImplementedException();
}
}
public int Freq
{
get
{
ChannelMarshal channel = (ChannelMarshal) marshaledObject.Wrapper;
return channel.freq;
}
}
public int Bits
{
get
{
ChannelMarshal channel = (ChannelMarshal) marshaledObject.Wrapper;
return channel.bits;
}
}
public int Channels
{
get
{
ChannelMarshal channel = (ChannelMarshal) marshaledObject.Wrapper;
return channel.channels;
}
}
public int Ms
{
get
{
ChannelMarshal channel = (ChannelMarshal) marshaledObject.Wrapper;
return channel.ms;
}
}
public int Kbps
{
get {
ChannelMarshal channel = (ChannelMarshal) marshaledObject.Wrapper;
return channel.kbps;
}
}
public void PerformHangup()
{
Switch.switch_channel_perform_hangup(this, "file", "func", 100, CallCause.OutgoingCallBarred);
}
public Status Answer()
{
return Switch.switch_channel_answer(this);
}
}
}

View File

@ -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 --
*
*/
using System;
namespace FreeSwitch.NET.Types
{
public enum ChannelFlag
{
CF_SEND_AUDIO,
CF_RECV_AUDIO,
CF_ANSWERED,
CF_OUTBOUND,
CF_EARLY_MEDIA,
CF_ORIGINATOR,
CF_TRANSFER
}
}

View File

@ -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 --
*
*/
using System;
namespace FreeSwitch.NET.Types
{
public enum ChannelState
{
CS_NEW,
CS_INIT,
CS_RING,
CS_TRANSMIT,
CS_EXECUTE,
CS_LOOPBACK,
CS_HANGUP,
CS_DONE
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
namespace FreeSwitch.NET.Types
{
public class ChannelTimetable
{
internal HandleRef marshaledObject;
public Int64 Created
{
get { throw new NotImplementedException(); }
}
public Int64 Answered
{
get { throw new NotImplementedException(); }
}
public Int64 Hungup
{
get { throw new NotImplementedException(); }
}
}
}

View File

@ -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 --
*
*/
using System;
using System.Collections;
using System.Runtime.InteropServices;
using System.Text;
using FreeSwitch.NET.Marshaling.Types;
namespace FreeSwitch.NET.Types
{
/*
* 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;
*/
public class CoreSession
{
public HandleRef marshaledObject;
/*
* Properties
*/
public UInt32 Id
{
get
{
CoreSessionMarshal coreSessionMarshal = (CoreSessionMarshal)marshaledObject.Wrapper;
return coreSessionMarshal.id;
}
}
public string Name
{
get
{
CoreSessionMarshal coreSessionMarshal = (CoreSessionMarshal) marshaledObject.Wrapper;
return Encoding.ASCII.GetString(coreSessionMarshal.name);
}
}
public bool IsThreadRunning
{
get
{
CoreSessionMarshal coreSessionMarshal = (CoreSessionMarshal)marshaledObject.Wrapper;
if (coreSessionMarshal.thread_running <= 0)
return false;
else
return true;
}
}
public MemoryPool Pool
{
get
{
return Switch.switch_core_session_get_pool(this);
}
}
public Channel Channel
{
get
{
return Switch.switch_core_session_get_channel(this);
}
}
public string Uuid
{
get
{
CoreSessionMarshal coreSessionMarshal = (CoreSessionMarshal)marshaledObject.Wrapper;
return Encoding.ASCII.GetString(coreSessionMarshal.uuid_str);
}
}
public CoreSession OutgoingChannel(string endpointName, CallerProfile callerProfile)
{
CoreSession newSession = new CoreSession();
MemoryPool pool = new MemoryPool();
Status status = Switch.switch_core_session_outgoing_channel(this, endpointName, callerProfile, ref newSession, pool);
if (status != Status.Success)
throw new Exception("Unsuccessful");
return newSession;
}
public CoreSession()
{
//CoreSessionMarshal coreSessionMarshal = new CoreSessionMarshal();
//IntPtr coreSessionPtr = Marshal.AllocHGlobal(Marshal.SizeOf(coreSessionMarshal));
//marshaledObject = new HandleRef(coreSessionMarshal, coreSessionPtr);
}
public Status DtmfCallbackFunctionWrapper(CoreSession session, string dtmf, IntPtr buf, uint buflen)
{
return Status.Success;
}
}
}

View File

@ -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 --
*
*/
using System;
namespace FreeSwitch.NET.Types
{
public delegate Status DtmfCallbackFunction(CoreSession session, string dtmf);
}

120
src/dotnet/dotnet/Types/Event.cs Executable file
View File

@ -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 --
*
*/
using System;
using System.Collections;
using System.Text;
using System.Runtime.InteropServices;
namespace FreeSwitch.NET.Types
{
public enum Priority
{
SWITCH_PRIORITY_NORMAL,
SWITCH_PRIORITY_LOW,
SWITCH_PRIORITY_HIGH
}
public class Event
{
internal HandleRef marshaledObject;
public EventType EventId
{
get { throw new NotImplementedException(); }
}
public Priority Priority
{
get { throw new NotImplementedException(); }
}
public string Owner
{
get { throw new NotImplementedException(); }
}
public IntPtr Subclass
{
get { throw new NotImplementedException(); }
}
public ArrayList Headers
{
get { throw new NotImplementedException(); }
}
public string Body
{
get { throw new NotImplementedException(); }
}
public IntPtr BindUserData
{
get { throw new NotImplementedException(); }
}
public IntPtr EventUserData
{
get { throw new NotImplementedException(); }
}
}
[StructLayout(LayoutKind.Sequential)]
public class EventSubclass
{
private string owner;
private string name;
}
[StructLayout(LayoutKind.Sequential)]
public class EventHeader
{
public string Name;
public string Value;
}
public enum EventType
{
SWITCH_EVENT_CUSTOM,
SWITCH_EVENT_CHANNEL_STATE,
SWITCH_EVENT_CHANNEL_ANSWER,
SWITCH_EVENT_CHANNEL_HANGUP,
SWITCH_EVENT_API,
SWITCH_EVENT_LOG,
SWITCH_EVENT_INBOUND_CHAN,
SWITCH_EVENT_OUTBOUND_CHAN,
SWITCH_EVENT_STARTUP,
SWITCH_EVENT_SHUTDOWN,
SWITCH_EVENT_ALL
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Marshaling.Types;
namespace FreeSwitch.NET.Types
{
public class FileHandle
{
internal HandleRef marshaledObject;
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Marshaling;
namespace FreeSwitch.NET.Types
{
public delegate Status InputCallbackFunction(
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(StreamHandleMarshaler))]
CoreSession session,
[MarshalAs(UnmanagedType.LPStr)]
string input,
InputType inputType,
[MarshalAs(UnmanagedType.LPStr)]
string buffer,
int bufferLength);
}

View File

@ -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 --
*
*/
using System;
namespace FreeSwitch.NET.Types
{
public enum InputType
{
INPUT_TYPE_DTMF,
INPUT_TYPE_EVENT
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
namespace FreeSwitch.NET.Types
{
public class LoadableModule
{
internal IntPtr address;
private string name;
private Buffer dtmfBuffer;
internal IntPtr dtmf_mutex;
internal IntPtr session;
private ChannelState state;
private ChannelFlag flags;
private CallerProfile callerProfile;
private CallerProfile originatorCallerProfile;
private CallerProfile originateeCallerProfile;
private CallerExtension callerExtension;
internal byte[] state_handlers;
internal int state_handler_index;
internal IntPtr variables;
private ChannelTimetable times;
internal IntPtr privateInfo;
private int freq;
private int bits;
private int channels;
private int ms;
private int kbps;
public string Name
{
set { name = value; }
get { return name; }
}
public Buffer DtmfBuffer
{
set { dtmfBuffer = value; }
get { return dtmfBuffer; }
}
public ChannelState State
{
set { state = value; }
get { return state; }
}
public ChannelFlag Flags
{
set { flags = value; }
get { return flags; }
}
public CallerProfile CallerProfile
{
set { callerProfile = value; }
get { return callerProfile; }
}
public CallerProfile OriginatorCallerProfile
{
set { originatorCallerProfile = value; }
get { return originatorCallerProfile; }
}
public CallerProfile OriginateeCallerProfile
{
set { originateeCallerProfile = value; }
get { return originateeCallerProfile; }
}
public CallerExtension CallerExtension
{
set { callerExtension = value; }
get { return callerExtension; }
}
public ChannelTimetable Times
{
set { times = value; }
get { return times; }
}
public int Freq
{
set { freq = value; }
get { return freq; }
}
public int Bits
{
set { bits = value; }
get { return bits; }
}
public int Channels
{
set { channels = value; }
get { return channels; }
}
public int Ms
{
set { ms = value; }
get { return ms; }
}
public int Kbps
{
set { kbps = value; }
get { return kbps; }
}
}
}

View File

@ -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 --
*
*/
using System;
using System.Collections;
using System.Runtime.InteropServices;
using System.Text;
using FreeSwitch.NET.Marshaling;
namespace FreeSwitch.NET.Types
{
public delegate Status WriteFunction(
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(StreamHandleMarshaler))]
StreamHandle streamHandle,
[MarshalAs(UnmanagedType.LPStr)]
string fmt);
//public delegate void ModuleLoad();
public class LoadableModuleInterface
{
private string module_name;
//private EndpointInterface endpoint_interface;
//private TimerInterface timer_interface;
//private DialplanInterface dialplan_interface;
//private CodecInterface codec_interface;
//private ApplicationInterface application_interface;
//private ApiInterface api_interface;
//private FileInterface file_interface;
//private SpeechInterface speech_interface;
//private DirectoryInterface directory_interface;
}
}

View File

@ -0,0 +1,10 @@
using System;
using System.Runtime.InteropServices;
namespace FreeSwitch.NET.Types
{
public class MemoryPool
{
public HandleRef marshaledObject;
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Marshaling;
namespace FreeSwitch.NET.Types
{
public delegate Status ModuleReload();
public delegate bool ModulePause();
public delegate bool ModuleResume();
public delegate bool ModuleStatus();
public delegate Status ModuleRuntime();
public delegate bool ModuleShutdown();
public delegate Status ModuleLoad(ref IntPtr module, string name);
public delegate void
ApplicationFunction(
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(CoreSessionMarshaler))]
CoreSession session,
[MarshalAs(UnmanagedType.LPStr)]
string data);
public delegate Status
ApiFunction(
[MarshalAs(UnmanagedType.LPStr)]
string command,
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(StreamHandleMarshaler))]
StreamHandle streamHandle);
}

View File

@ -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;
public string InterfaceName
{
get { return interface_name; }
}
public ApplicationFunction ApplicationFunction
{
get { return application_function; }
}
public string LongDesc
{
get { return long_desc; }
}
public string ShortDesc
{
get { return short_desc; }
}
}*/
}

View File

@ -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 --
*
*/
using System;
namespace FreeSwitch.NET.Types
{
public enum Status
{
Success,
False,
Timeout,
Restart,
Terminate,
NotImplemented,
MemoryError,
NoOp,
Resample,
GeneralError,
InUse,
Break
}
}

View File

@ -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 --
*
*/
using System;
using System.Runtime.InteropServices;
using FreeSwitch.NET.Marshaling.Types;
namespace FreeSwitch.NET.Types
{
public class StreamHandle
{
internal HandleRef marshaledObject;
internal WriteFunction writeFunction;
public void Write(string data)
{
StreamHandleMarshal streamHandleMarshal = (StreamHandleMarshal)marshaledObject.Wrapper;
WriteFunction writeFunction = (WriteFunction)Marshal.GetDelegateForFunctionPointer(streamHandleMarshal.write_function, typeof(WriteFunction));
writeFunction(this, data);
}
}
}

View File

@ -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 --
*
*/
using System;
namespace FreeSwitch.NET.Types
{
public enum TextChannel
{
ChannelIdConsole,
ChannelIdConsoleClean,
ChannelIdEvent
}
}

Binary file not shown.