mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-07-21 19:45:34 +00:00
movin
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6328 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
edb7f5d615
commit
6684778bc6
@ -1,75 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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
|
|
||||||
{
|
|
||||||
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");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,148 +0,0 @@
|
|||||||
<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</RootNamespace>
|
|
||||||
<AssemblyName>FreeSwitch.NET</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>..\..\debug\</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
<NoWarn>0649,0169</NoWarn>
|
|
||||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>..\..\release\</OutputPath>
|
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
|
||||||
<NoWarn>0649,0169</NoWarn>
|
|
||||||
</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="Log.cs" />
|
|
||||||
<Compile Include="Ivr.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\CodecMarshaler.cs" />
|
|
||||||
<Compile Include="Marshaling\StateHandlerTableMarshaler.cs" />
|
|
||||||
<Compile Include="Marshaling\TimerMarshaler.cs" />
|
|
||||||
<Compile Include="Marshaling\SpeechHandleMarshaler.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\StateHandlerTableMarshal.cs" />
|
|
||||||
<Compile Include="Marshaling\Types\TimerMarshal.cs" />
|
|
||||||
<Compile Include="Marshaling\Types\SpeechHandleMarshal.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\Log.cs" />
|
|
||||||
<Compile Include="Switch\Event.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\Codec.cs" />
|
|
||||||
<Compile Include="Types\LogLevel.cs" />
|
|
||||||
<Compile Include="Types\StateHandlerTable.cs" />
|
|
||||||
<Compile Include="Types\Timer.cs" />
|
|
||||||
<Compile Include="Types\SpeechHandle.cs" />
|
|
||||||
<Compile Include="Types\EventCallback.cs" />
|
|
||||||
<Compile Include="Types\EventType.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>
|
|
@ -1,44 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Text;
|
|
||||||
using FreeSwitch.Types;
|
|
||||||
using FreeSwitch.Marshaling.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch
|
|
||||||
{
|
|
||||||
public class Ivr
|
|
||||||
{
|
|
||||||
public static Status MultiThreadedBridge(CoreSession session, CoreSession peerSession, InputCallbackFunction dtmfCallback)
|
|
||||||
{
|
|
||||||
return Switch.switch_ivr_multi_threaded_bridge(session, peerSession, dtmfCallback, IntPtr.Zero, IntPtr.Zero);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Status Originate(CoreSession session, CoreSession peerSession, CallCause callCause, string data, uint timelimit)
|
|
||||||
{
|
|
||||||
IntPtr callCausePtr = Marshal.AllocHGlobal(4);
|
|
||||||
IntPtr dataPtr = Marshal.StringToHGlobalAnsi(data);
|
|
||||||
|
|
||||||
Marshal.StructureToPtr(callCause, callCausePtr, true);
|
|
||||||
|
|
||||||
return Switch.switch_ivr_originate(session, ref peerSession, callCausePtr, dataPtr, timelimit, null, null, null, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Status RecordFile(CoreSession coreSession, FileHandle fileHandle, string file, DtmfCallbackFunction dtmfCallbackFunction)
|
|
||||||
{
|
|
||||||
Byte[] filename = Encoding.Default.GetBytes(file);
|
|
||||||
|
|
||||||
Console.WriteLine("File: {0}", file);
|
|
||||||
|
|
||||||
dtmfCallbackFunction(coreSession, "1");
|
|
||||||
dtmfCallbackFunction(coreSession, "2");
|
|
||||||
dtmfCallbackFunction(coreSession, "3");
|
|
||||||
|
|
||||||
Encoding ansiEncoding = Encoding.GetEncoding(1252);
|
|
||||||
//filename = Encoding.Convert(Encoding.Default, ansiEncoding, filename);
|
|
||||||
|
|
||||||
Console.WriteLine("Filename: {0}", file);
|
|
||||||
//Console.WriteLine("Status record: {0}", status.ToString());
|
|
||||||
return Status.Success;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Text;
|
|
||||||
using FreeSwitch.Types;
|
|
||||||
using FreeSwitch.Marshaling.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch
|
|
||||||
{
|
|
||||||
public class Log
|
|
||||||
{
|
|
||||||
public static void Printf(LogLevel level, string message)
|
|
||||||
{
|
|
||||||
Switch.switch_log_printf(null, "File", "Func.NET", 123, level, message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,97 +0,0 @@
|
|||||||
all: $(MODNAME).so
|
|
||||||
|
|
||||||
$(MODNAME).so:
|
|
||||||
/usr/local/freeswitch/bin/gmcs -debug -unsafe -t:library -keyfile:public.snk \
|
|
||||||
-out:FreeSwitch.NET.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/SpeechHandleMarshal.cs \
|
|
||||||
Marshaling/Types/StateHandlerTableMarshal.cs \
|
|
||||||
Marshaling/Types/StreamHandleMarshal.cs \
|
|
||||||
Marshaling/Types/TypesMarshal.cs \
|
|
||||||
Marshaling/Types/TimerMarshal.cs \
|
|
||||||
Marshaling/BufferMarshaler.cs \
|
|
||||||
Marshaling/CallerExtensionMarshaler.cs \
|
|
||||||
Marshaling/CallerProfileMarshaler.cs \
|
|
||||||
Marshaling/ChannelMarshaler.cs \
|
|
||||||
Marshaling/ChannelTimetableMarshaler.cs \
|
|
||||||
Marshaling/CodecMarshaler.cs \
|
|
||||||
Marshaling/CoreSessionMarshaler.cs \
|
|
||||||
Marshaling/EventMarshaler.cs \
|
|
||||||
Marshaling/FileHandleMarshaler.cs \
|
|
||||||
Marshaling/MemoryPoolMarshaler.cs \
|
|
||||||
Marshaling/SpeechHandleMarshaler.cs \
|
|
||||||
Marshaling/StateHandlerTableMarshaler.cs \
|
|
||||||
Marshaling/StreamHandleMarshaler.cs \
|
|
||||||
Marshaling/TimerMarshaler.cs \
|
|
||||||
Modules/Api.cs \
|
|
||||||
Modules/Application.cs \
|
|
||||||
Switch/CallerProfile.cs \
|
|
||||||
Switch/Channel.cs \
|
|
||||||
Switch/Console.cs \
|
|
||||||
Switch/CoreSession.cs \
|
|
||||||
Switch/Event.cs \
|
|
||||||
Switch/Ivr.cs \
|
|
||||||
Switch/LoadableModule.cs \
|
|
||||||
Switch/Log.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/Codec.cs \
|
|
||||||
Types/CoreSession.cs \
|
|
||||||
Types/DtmfCallbackFunction.cs \
|
|
||||||
Types/InputCallbackFunction.cs \
|
|
||||||
Types/InputType.cs \
|
|
||||||
Types/Event.cs \
|
|
||||||
Types/EventCallback.cs \
|
|
||||||
Types/EventType.cs \
|
|
||||||
Types/FileHandle.cs \
|
|
||||||
Types/LoadableModule.cs \
|
|
||||||
Types/LoadableModuleInterface.cs \
|
|
||||||
Types/LogLevel.cs \
|
|
||||||
Types/MemoryPool.cs \
|
|
||||||
Types/Module.cs \
|
|
||||||
Types/Status.cs \
|
|
||||||
Types/SpeechHandle.cs \
|
|
||||||
Types/StateHandlerTable.cs \
|
|
||||||
Types/StreamHandle.cs \
|
|
||||||
Types/TextChannel.cs \
|
|
||||||
Types/Timer.cs \
|
|
||||||
Common.cs \
|
|
||||||
Module.cs \
|
|
||||||
Ivr.cs \
|
|
||||||
Log.cs \
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -fr *.dll
|
|
||||||
|
|
||||||
install:
|
|
||||||
cp -f FreeSwitch.NET.dll /usr/local/freeswitch/lib/
|
|
@ -1,80 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Marshaling.Types;
|
|
||||||
using FreeSwitch.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.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.Types.Buffer buffer = (FreeSwitch.Types.Buffer)obj;
|
|
||||||
|
|
||||||
return buffer.marshaledObject.Handle;
|
|
||||||
}
|
|
||||||
|
|
||||||
public object MarshalNativeToManaged(IntPtr bufferPtr)
|
|
||||||
{
|
|
||||||
FreeSwitch.Types.Buffer buffer = new FreeSwitch.Types.Buffer();
|
|
||||||
BufferMarshal bufferMarshal = new BufferMarshal();
|
|
||||||
|
|
||||||
Marshal.PtrToStructure(bufferPtr, bufferMarshal);
|
|
||||||
|
|
||||||
buffer.marshaledObject = new HandleRef(bufferMarshal, bufferPtr);
|
|
||||||
|
|
||||||
return buffer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,80 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types;
|
|
||||||
using FreeSwitch.Marshaling.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,81 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types;
|
|
||||||
using FreeSwitch.Marshaling.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,80 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types;
|
|
||||||
using FreeSwitch.Marshaling.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,80 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types;
|
|
||||||
using FreeSwitch.Marshaling.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,82 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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>
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* CodecMarshaler.cs --
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Collections;
|
|
||||||
using FreeSwitch.Marshaling.Types;
|
|
||||||
using FreeSwitch.Types;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace FreeSwitch.Marshaling
|
|
||||||
{
|
|
||||||
class CodecMarshaler : ICustomMarshaler
|
|
||||||
{
|
|
||||||
private static CodecMarshaler Instance = new CodecMarshaler();
|
|
||||||
|
|
||||||
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)
|
|
||||||
{
|
|
||||||
Codec streamHandleObj = (Codec)obj;
|
|
||||||
|
|
||||||
return streamHandleObj.marshaledObject.Handle;
|
|
||||||
}
|
|
||||||
|
|
||||||
public object MarshalNativeToManaged(IntPtr codecPtr)
|
|
||||||
{
|
|
||||||
CodecMarshal codecMarshal = new CodecMarshal();
|
|
||||||
Codec codecObj = new Codec();
|
|
||||||
|
|
||||||
|
|
||||||
Marshal.PtrToStructure(codecPtr, codecMarshal);
|
|
||||||
|
|
||||||
codecObj.marshaledObject = new HandleRef(codecMarshal, codecPtr);
|
|
||||||
|
|
||||||
return codecObj;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,102 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types;
|
|
||||||
using FreeSwitch.Marshaling.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.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;
|
|
||||||
|
|
||||||
Console.WriteLine("CoreSession: Marshalling Managed to Native");
|
|
||||||
|
|
||||||
if (coreSession.marshaledObject.Handle != IntPtr.Zero)
|
|
||||||
{
|
|
||||||
|
|
||||||
Console.WriteLine("Returning: 0x{0:x}", coreSession.marshaledObject.Handle.ToInt32());
|
|
||||||
return coreSession.marshaledObject.Handle;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
CoreSessionMarshal coreSessionMarshal = new CoreSessionMarshal();
|
|
||||||
IntPtr coreSessionPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(CoreSessionMarshal)));
|
|
||||||
|
|
||||||
Marshal.StructureToPtr(coreSessionMarshal, coreSessionPtr, true);
|
|
||||||
|
|
||||||
coreSession.marshaledObject = new HandleRef(coreSessionMarshal, coreSessionPtr);
|
|
||||||
|
|
||||||
Console.WriteLine("CoreSession: NO OBJECT EXISTS OMG");
|
|
||||||
Console.WriteLine("Returning: 0x{0:x}", coreSession.marshaledObject.Handle.ToInt32());
|
|
||||||
return coreSession.marshaledObject.Handle;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public object MarshalNativeToManaged(IntPtr coreSessionPtr)
|
|
||||||
{
|
|
||||||
CoreSessionMarshal coreSessionMarshal = new CoreSessionMarshal();
|
|
||||||
CoreSession coreSession = new CoreSession();
|
|
||||||
|
|
||||||
Console.WriteLine("CoreSession: Marshalling Native to Managed");
|
|
||||||
|
|
||||||
Marshal.PtrToStructure(coreSessionPtr, coreSessionMarshal);
|
|
||||||
|
|
||||||
coreSession.marshaledObject = new HandleRef(coreSessionMarshal, coreSessionPtr);
|
|
||||||
|
|
||||||
return coreSession;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,81 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Marshaling.Types;
|
|
||||||
using FreeSwitch.Types;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace FreeSwitch.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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,78 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types;
|
|
||||||
using FreeSwitch.Marshaling.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,77 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types;
|
|
||||||
using FreeSwitch.Marshaling.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,81 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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>
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* SpeechHandleMarshaler.cs --
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Collections;
|
|
||||||
using FreeSwitch.Marshaling.Types;
|
|
||||||
using FreeSwitch.Types;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace FreeSwitch.Marshaling
|
|
||||||
{
|
|
||||||
class SpeechHandleMarshaler : ICustomMarshaler
|
|
||||||
{
|
|
||||||
private static SpeechHandleMarshaler Instance = new SpeechHandleMarshaler();
|
|
||||||
|
|
||||||
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)
|
|
||||||
{
|
|
||||||
SpeechHandle speechHandleObj = (SpeechHandle)obj;
|
|
||||||
|
|
||||||
return speechHandleObj.marshaledObject.Handle;
|
|
||||||
}
|
|
||||||
|
|
||||||
public object MarshalNativeToManaged(IntPtr speechHandlePtr)
|
|
||||||
{
|
|
||||||
SpeechHandleMarshal speechHandleMarshal = new SpeechHandleMarshal();
|
|
||||||
SpeechHandle speechHandleObj = new SpeechHandle();
|
|
||||||
|
|
||||||
Marshal.PtrToStructure(speechHandlePtr, speechHandleMarshal);
|
|
||||||
|
|
||||||
speechHandleObj.marshaledObject = new HandleRef(speechHandleMarshal, speechHandlePtr);
|
|
||||||
|
|
||||||
return speechHandleObj;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,81 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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>
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* StateHandlerTableMarshaler.cs --
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Collections;
|
|
||||||
using FreeSwitch.Marshaling.Types;
|
|
||||||
using FreeSwitch.Types;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace FreeSwitch.Marshaling
|
|
||||||
{
|
|
||||||
class StateHandlerTableMarshaler : ICustomMarshaler
|
|
||||||
{
|
|
||||||
private static StateHandlerTableMarshaler Instance = new StateHandlerTableMarshaler();
|
|
||||||
|
|
||||||
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)
|
|
||||||
{
|
|
||||||
StateHandlerTable stateHandlerTableObj = (StateHandlerTable)obj;
|
|
||||||
|
|
||||||
return stateHandlerTableObj.marshaledObject.Handle;
|
|
||||||
}
|
|
||||||
|
|
||||||
public object MarshalNativeToManaged(IntPtr stateHandlerTablePtr)
|
|
||||||
{
|
|
||||||
StateHandlerTableMarshal stateHandlerTableMarshal = new StateHandlerTableMarshal();
|
|
||||||
StateHandlerTable stateHandlerTableObj = new StateHandlerTable();
|
|
||||||
|
|
||||||
Marshal.PtrToStructure(stateHandlerTablePtr, stateHandlerTableMarshal);
|
|
||||||
|
|
||||||
stateHandlerTableObj.marshaledObject = new HandleRef(stateHandlerTableMarshal, stateHandlerTablePtr);
|
|
||||||
|
|
||||||
return stateHandlerTableObj;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,81 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Marshaling.Types;
|
|
||||||
using FreeSwitch.Types;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace FreeSwitch.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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,81 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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>
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* TimerMarshaler.cs --
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Collections;
|
|
||||||
using FreeSwitch.Marshaling.Types;
|
|
||||||
using FreeSwitch.Types;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace FreeSwitch.Marshaling
|
|
||||||
{
|
|
||||||
class TimerMarshaler : ICustomMarshaler
|
|
||||||
{
|
|
||||||
private static TimerMarshaler Instance = new TimerMarshaler();
|
|
||||||
|
|
||||||
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)
|
|
||||||
{
|
|
||||||
Timer timerObj = (Timer)obj;
|
|
||||||
|
|
||||||
return timerObj.marshaledObject.Handle;
|
|
||||||
}
|
|
||||||
|
|
||||||
public object MarshalNativeToManaged(IntPtr timerPtr)
|
|
||||||
{
|
|
||||||
TimerMarshal timerMarshal = new TimerMarshal();
|
|
||||||
Timer timerObj = new Timer();
|
|
||||||
|
|
||||||
Marshal.PtrToStructure(timerPtr, timerMarshal);
|
|
||||||
|
|
||||||
timerObj.marshaledObject = new HandleRef(timerMarshal, timerPtr);
|
|
||||||
|
|
||||||
return timerObj;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,49 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.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 syntax;
|
|
||||||
internal IntPtr next;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,52 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Marshaling.Types
|
|
||||||
{
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
|
||||||
internal class BufferMarshal
|
|
||||||
{
|
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
|
||||||
internal string data;
|
|
||||||
internal int used;
|
|
||||||
internal int datalen;
|
|
||||||
internal UInt32 id;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,68 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Marshaling.Types
|
|
||||||
{
|
|
||||||
internal enum ChannelFlagMarshal
|
|
||||||
{
|
|
||||||
CF_SEND_AUDIO,
|
|
||||||
CF_RECV_AUDIO,
|
|
||||||
CF_ANSWERED,
|
|
||||||
CF_OUTBOUND,
|
|
||||||
CF_EARLY_MEDIA,
|
|
||||||
CF_ORIGINATOR,
|
|
||||||
CF_TRANSFER
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,66 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,47 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Marshaling.Types
|
|
||||||
{
|
|
||||||
internal enum ChannelStateMarshal
|
|
||||||
{
|
|
||||||
CS_NEW,
|
|
||||||
CS_INIT,
|
|
||||||
CS_RING,
|
|
||||||
CS_TRANSMIT,
|
|
||||||
CS_EXECUTE,
|
|
||||||
CS_LOOPBACK,
|
|
||||||
CS_HANGUP,
|
|
||||||
CS_DONE
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,44 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Marshaling.Types
|
|
||||||
{
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
|
||||||
internal class ChannelTimetableMarshal
|
|
||||||
{
|
|
||||||
internal Int64 created;
|
|
||||||
internal Int64 answered;
|
|
||||||
internal Int64 hungup;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,54 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,63 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.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;
|
|
||||||
};*/
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Marshaling.Types
|
|
||||||
{
|
|
||||||
internal class CodecMarshal
|
|
||||||
{
|
|
||||||
internal IntPtr codec_interface;
|
|
||||||
internal IntPtr implementation;
|
|
||||||
internal IntPtr codec_settings;
|
|
||||||
internal UInt32 flags;
|
|
||||||
internal IntPtr memory_pool;
|
|
||||||
internal IntPtr private_info;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,43 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Marshaling.Types
|
|
||||||
{
|
|
||||||
internal enum CodecTypesMarshal
|
|
||||||
{
|
|
||||||
SWITCH_CODEC_TYPE_AUDIO,
|
|
||||||
SWITCH_CODEC_TYPE_VIDEO,
|
|
||||||
SWITCH_CODEC_TYPE_T38,
|
|
||||||
SWITCH_CODEC_TYPE_APP
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,80 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,59 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,57 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,54 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,51 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,52 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,54 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,53 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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>
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* SpeechHandleMarshal.cs --
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using FreeSwitch.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.Marshaling.Types
|
|
||||||
{
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
|
||||||
internal class SpeechHandleMarshal
|
|
||||||
{
|
|
||||||
internal IntPtr speech_interface;
|
|
||||||
internal UInt32 flags;
|
|
||||||
internal IntPtr name;
|
|
||||||
internal UInt32 rate;
|
|
||||||
internal UInt32 speed;
|
|
||||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst=80)]
|
|
||||||
internal byte[] voice;
|
|
||||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst=80)]
|
|
||||||
internal byte[] engine;
|
|
||||||
internal IntPtr memory_pool;
|
|
||||||
internal IntPtr private_info;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,49 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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>
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* StateHandlerTableMarshal.cs --
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using FreeSwitch.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.Marshaling.Types
|
|
||||||
{
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
|
||||||
internal class StateHandlerTableMarshal
|
|
||||||
{
|
|
||||||
internal IntPtr on_init;
|
|
||||||
internal IntPtr on_ring;
|
|
||||||
internal IntPtr on_execute;
|
|
||||||
internal IntPtr on_hangup;
|
|
||||||
internal IntPtr on_loopback;
|
|
||||||
internal IntPtr on_transmit;
|
|
||||||
internal IntPtr on_hold;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,50 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.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 int alloc_len;
|
|
||||||
internal int alloc_chunk;
|
|
||||||
internal IntPtr _event;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,49 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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>
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* TimerMarshal.cs --
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using FreeSwitch.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.Marshaling.Types
|
|
||||||
{
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
|
||||||
internal class TimerMarshal
|
|
||||||
{
|
|
||||||
int interval;
|
|
||||||
UInt32 flags;
|
|
||||||
uint samples;
|
|
||||||
uint samplecount;
|
|
||||||
IntPtr timer_interface;
|
|
||||||
IntPtr memory_pool;
|
|
||||||
IntPtr private_info;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,45 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.Marshaling.Types
|
|
||||||
{
|
|
||||||
public delegate
|
|
||||||
Status DtmfCallbackFunctionMarshal(
|
|
||||||
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(CoreSessionMarshaler))]
|
|
||||||
CoreSession session,
|
|
||||||
string dtmf,
|
|
||||||
IntPtr buf,
|
|
||||||
uint buflen);
|
|
||||||
}
|
|
@ -1,215 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types;
|
|
||||||
using FreeSwitch.Modules;
|
|
||||||
using FreeSwitch.Marshaling.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch
|
|
||||||
{
|
|
||||||
/// <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);
|
|
||||||
|
|
||||||
if (apiInterfaces.Count > 0)
|
|
||||||
{
|
|
||||||
/* 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);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (applicationInterfaces.Count > 0)
|
|
||||||
{
|
|
||||||
/* 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.syntax = Marshal.StringToHGlobalAnsi(apiInterface.Syntax);
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
public string Name
|
|
||||||
{
|
|
||||||
set { name = value; }
|
|
||||||
get { return name; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,72 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.Modules
|
|
||||||
{
|
|
||||||
public class Api
|
|
||||||
{
|
|
||||||
private string name;
|
|
||||||
private string description;
|
|
||||||
private string syntax;
|
|
||||||
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 string Syntax
|
|
||||||
{
|
|
||||||
set { syntax = value; }
|
|
||||||
get { return syntax; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public ApiFunction ApiFunction
|
|
||||||
{
|
|
||||||
set { apiFunction = value; }
|
|
||||||
get { return apiFunction; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,81 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Marshaling;
|
|
||||||
using FreeSwitch.Types;
|
|
||||||
using FreeSwitch.Marshaling.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.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; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
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.")]
|
|
@ -1,92 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types;
|
|
||||||
using FreeSwitch.Marshaling;
|
|
||||||
using FreeSwitch.Marshaling.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch
|
|
||||||
{
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,123 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types;
|
|
||||||
using FreeSwitch.Marshaling;
|
|
||||||
|
|
||||||
namespace FreeSwitch
|
|
||||||
{
|
|
||||||
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.LPStr)]
|
|
||||||
public extern static
|
|
||||||
string switch_channel_get_variable(
|
|
||||||
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ChannelMarshaler))]
|
|
||||||
Channel channel,
|
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
|
||||||
string varname);
|
|
||||||
|
|
||||||
[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);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,42 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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
|
|
||||||
{
|
|
||||||
public partial class Switch
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,70 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types;
|
|
||||||
using FreeSwitch.Marshaling;
|
|
||||||
|
|
||||||
namespace FreeSwitch
|
|
||||||
{
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,52 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types;
|
|
||||||
using FreeSwitch.Marshaling;
|
|
||||||
|
|
||||||
namespace FreeSwitch
|
|
||||||
{
|
|
||||||
public partial class Switch
|
|
||||||
{
|
|
||||||
[DllImport("freeswitch")]
|
|
||||||
public extern static
|
|
||||||
Status switch_event_bind(
|
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
|
||||||
string id,
|
|
||||||
EventType eventType,
|
|
||||||
string subClassName,
|
|
||||||
EventCallback callback,
|
|
||||||
IntPtr userData);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,202 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types;
|
|
||||||
using FreeSwitch.Marshaling;
|
|
||||||
using FreeSwitch.Marshaling.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch
|
|
||||||
{
|
|
||||||
public partial class Switch
|
|
||||||
{
|
|
||||||
[DllImport("freeswitch")]
|
|
||||||
public extern static
|
|
||||||
Status switch_ivr_sleep(
|
|
||||||
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CoreSessionMarshaler))]
|
|
||||||
CoreSession session,
|
|
||||||
UInt32 ms);
|
|
||||||
|
|
||||||
[DllImport("freeswitch")]
|
|
||||||
public extern static
|
|
||||||
Status switch_ivr_park(
|
|
||||||
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CoreSessionMarshaler))]
|
|
||||||
CoreSession session);
|
|
||||||
|
|
||||||
[DllImport("freeswitch")]
|
|
||||||
public extern static
|
|
||||||
Status switch_ivr_collect_digits_callback(
|
|
||||||
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CoreSessionMarshaler))]
|
|
||||||
CoreSession session,
|
|
||||||
InputCallbackFunction dtmfCallback,
|
|
||||||
IntPtr buf,
|
|
||||||
uint buflen);
|
|
||||||
|
|
||||||
[DllImport("freeswitch")]
|
|
||||||
public extern static
|
|
||||||
Status switch_ivr_collect_digits_count(
|
|
||||||
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CoreSessionMarshaler))]
|
|
||||||
CoreSession session,
|
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
|
||||||
string buffer,
|
|
||||||
uint buflen,
|
|
||||||
uint maxdigits,
|
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
|
||||||
string terminators,
|
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
|
||||||
string terminator,
|
|
||||||
uint timeout);
|
|
||||||
|
|
||||||
[DllImport("freeswitch")]
|
|
||||||
public extern static
|
|
||||||
Status switch_ivr_record_session(
|
|
||||||
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CoreSessionMarshaler))]
|
|
||||||
CoreSession session,
|
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
|
||||||
string file,
|
|
||||||
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(FileHandleMarshaler))]
|
|
||||||
FileHandle fh);
|
|
||||||
|
|
||||||
[DllImport("freeswitch")]
|
|
||||||
public extern static
|
|
||||||
Status switch_ivr_stop_record_session(
|
|
||||||
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CoreSessionMarshaler))]
|
|
||||||
CoreSession session,
|
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
|
||||||
string file);
|
|
||||||
|
|
||||||
[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_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);
|
|
||||||
|
|
||||||
[DllImport("freeswitch")]
|
|
||||||
public extern static
|
|
||||||
Status switch_ivr_speak_text_handle(
|
|
||||||
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CoreSessionMarshaler))]
|
|
||||||
CoreSession session,
|
|
||||||
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(SpeechHandleMarshaler))]
|
|
||||||
SpeechHandle sh,
|
|
||||||
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CodecMarshaler))]
|
|
||||||
Codec codec,
|
|
||||||
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(TimerMarshaler))]
|
|
||||||
Timer timer,
|
|
||||||
InputCallbackFunction dtmfCallback,
|
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
|
||||||
string text,
|
|
||||||
IntPtr buf,
|
|
||||||
uint buflen);
|
|
||||||
|
|
||||||
[DllImport("freeswitch")]
|
|
||||||
public extern static
|
|
||||||
Status switch_ivr_speak_text(
|
|
||||||
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CoreSessionMarshaler))]
|
|
||||||
CoreSession session,
|
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
|
||||||
string tts_name,
|
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
|
||||||
string voice_name,
|
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
|
||||||
string timer_name,
|
|
||||||
uint rate,
|
|
||||||
InputCallbackFunction dtmfCallback,
|
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
|
||||||
string text,
|
|
||||||
IntPtr buf,
|
|
||||||
uint buflen);
|
|
||||||
|
|
||||||
[DllImport("freeswitch")]
|
|
||||||
public extern static
|
|
||||||
Status switch_ivr_originate(
|
|
||||||
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CoreSessionMarshaler))]
|
|
||||||
CoreSession session,
|
|
||||||
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CoreSessionMarshaler))]
|
|
||||||
ref CoreSession bleg,
|
|
||||||
IntPtr cause,
|
|
||||||
IntPtr bridgeto,
|
|
||||||
UInt32 timelimit_sec,
|
|
||||||
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(StateHandlerTableMarshaler))]
|
|
||||||
StateHandlerTable table,
|
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
|
||||||
string cid_name_override,
|
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
|
||||||
string cid_num_override,
|
|
||||||
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CallerProfileMarshaler))]
|
|
||||||
CallerProfile caller_profile_override);
|
|
||||||
|
|
||||||
[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,
|
|
||||||
InputCallbackFunction dtmfCallback,
|
|
||||||
IntPtr session_data,
|
|
||||||
IntPtr peer_session_data);
|
|
||||||
|
|
||||||
[DllImport("freeswitch")]
|
|
||||||
public extern static
|
|
||||||
Status switch_ivr_session_transfer(
|
|
||||||
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CoreSessionMarshaler))]
|
|
||||||
CoreSession session,
|
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
|
||||||
string extension,
|
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
|
||||||
string dialplan,
|
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
|
||||||
string context);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,71 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types;
|
|
||||||
using FreeSwitch.Marshaling.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* 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);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,62 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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>
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Log.cs --
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using FreeSwitch.Types;
|
|
||||||
using FreeSwitch.Marshaling;
|
|
||||||
using FreeSwitch.Marshaling.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
src/switch_log.c:SWITCH_DECLARE(const char *) switch_log_level2str(switch_log_level_t level)
|
|
||||||
src/switch_log.c:SWITCH_DECLARE(switch_log_level_t) switch_log_str2level(const char *str)
|
|
||||||
src/switch_log.c:SWITCH_DECLARE(switch_status_t) switch_log_bind_logger(switch_log_function_t function, switch_log_level_t level)
|
|
||||||
src/switch_log.c:SWITCH_DECLARE(void) switch_log_printf(switch_text_channel_t channel, char *file, const char *func, int line, switch_log_level_t level, char *fmt, ...)
|
|
||||||
src/switch_log.c:SWITCH_DECLARE(switch_status_t) switch_log_init(switch_memory_pool_t *pool)
|
|
||||||
src/switch_log.c:SWITCH_DECLARE(switch_status_t) switch_log_shutdown(void)
|
|
||||||
*/
|
|
||||||
public partial class Switch
|
|
||||||
{
|
|
||||||
[DllImport("freeswitch")]
|
|
||||||
public extern static
|
|
||||||
void switch_log_printf(
|
|
||||||
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(ChannelMarshaler))]
|
|
||||||
Channel channel,
|
|
||||||
string file,
|
|
||||||
string func,
|
|
||||||
int line,
|
|
||||||
LogLevel level,
|
|
||||||
string format);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,61 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types;
|
|
||||||
using FreeSwitch.Marshaling.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* 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
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,31 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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 --
|
|
||||||
*
|
|
||||||
*/
|
|
@ -1,37 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
@ -1,50 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.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;
|
|
||||||
}
|
|
||||||
* */
|
|
||||||
}
|
|
@ -1,56 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.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(); }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,83 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.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
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,62 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Marshaling.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,139 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Marshaling.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.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"); }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,233 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Marshaling.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.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);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ChannelState Hangup(CallCause cause)
|
|
||||||
{
|
|
||||||
return Switch.switch_channel_perform_hangup(this, "file", "func", 666, cause);
|
|
||||||
}
|
|
||||||
|
|
||||||
public string GetVariable(string varname)
|
|
||||||
{
|
|
||||||
return Switch.switch_channel_get_variable(this, varname);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types
|
|
||||||
{
|
|
||||||
public enum ChannelFlag
|
|
||||||
{
|
|
||||||
CF_SEND_AUDIO,
|
|
||||||
CF_RECV_AUDIO,
|
|
||||||
CF_ANSWERED,
|
|
||||||
CF_OUTBOUND,
|
|
||||||
CF_EARLY_MEDIA,
|
|
||||||
CF_ORIGINATOR,
|
|
||||||
CF_TRANSFER
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,47 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types
|
|
||||||
{
|
|
||||||
public enum ChannelState
|
|
||||||
{
|
|
||||||
CS_NEW,
|
|
||||||
CS_INIT,
|
|
||||||
CS_RING,
|
|
||||||
CS_TRANSMIT,
|
|
||||||
CS_EXECUTE,
|
|
||||||
CS_LOOPBACK,
|
|
||||||
CS_HANGUP,
|
|
||||||
CS_DONE
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,56 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.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(); }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,44 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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>
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Codec.cs --
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using FreeSwitch.Marshaling;
|
|
||||||
using FreeSwitch.Marshaling.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.Types
|
|
||||||
{
|
|
||||||
public class Codec
|
|
||||||
{
|
|
||||||
internal HandleRef marshaledObject;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,175 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Marshaling.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,37 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types
|
|
||||||
{
|
|
||||||
public delegate Status DtmfCallbackFunction(CoreSession session, string dtmf);
|
|
||||||
}
|
|
@ -1,104 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,41 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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>
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* EventCallback.cs --
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using FreeSwitch.Marshaling;
|
|
||||||
|
|
||||||
namespace FreeSwitch.Types
|
|
||||||
{
|
|
||||||
public delegate void EventCallback(
|
|
||||||
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(EventMarshaler))]
|
|
||||||
Event _event);
|
|
||||||
}
|
|
@ -1,72 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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>
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* EventType.cs --
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Text;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace FreeSwitch.Types
|
|
||||||
{
|
|
||||||
public enum EventType
|
|
||||||
{
|
|
||||||
Custom,
|
|
||||||
Create,
|
|
||||||
Destroy,
|
|
||||||
State,
|
|
||||||
Answer,
|
|
||||||
Hangup,
|
|
||||||
Execute,
|
|
||||||
Bridge,
|
|
||||||
UnBridge,
|
|
||||||
Progress,
|
|
||||||
Outgoing,
|
|
||||||
Park,
|
|
||||||
UnPark,
|
|
||||||
Api,
|
|
||||||
Log,
|
|
||||||
InboundChan,
|
|
||||||
OutboundChan,
|
|
||||||
Startup,
|
|
||||||
Shutdown,
|
|
||||||
Publish,
|
|
||||||
UnPublish,
|
|
||||||
Talk,
|
|
||||||
NoTalk,
|
|
||||||
SessionCrash,
|
|
||||||
ModuleLoad,
|
|
||||||
Dtmf,
|
|
||||||
Message,
|
|
||||||
Codec,
|
|
||||||
BackgroundJob,
|
|
||||||
All
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,42 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Marshaling.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.Types
|
|
||||||
{
|
|
||||||
public class FileHandle
|
|
||||||
{
|
|
||||||
internal HandleRef marshaledObject;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,47 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Marshaling;
|
|
||||||
|
|
||||||
namespace FreeSwitch.Types
|
|
||||||
{
|
|
||||||
public delegate Status InputCallbackFunction(
|
|
||||||
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(CoreSessionMarshaler))]
|
|
||||||
CoreSession session,
|
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
|
||||||
string input,
|
|
||||||
InputType inputType,
|
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
|
||||||
string buffer,
|
|
||||||
int bufferLength);
|
|
||||||
}
|
|
@ -1,41 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types
|
|
||||||
{
|
|
||||||
public enum InputType
|
|
||||||
{
|
|
||||||
INPUT_TYPE_DTMF,
|
|
||||||
INPUT_TYPE_EVENT
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,146 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.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; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,57 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Marshaling;
|
|
||||||
|
|
||||||
namespace FreeSwitch.Types
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
//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;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,51 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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>
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* LogLevel.cs --
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Text;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace FreeSwitch.Types
|
|
||||||
{
|
|
||||||
public enum LogLevel
|
|
||||||
{
|
|
||||||
Console,
|
|
||||||
Debug,
|
|
||||||
Info,
|
|
||||||
Notice,
|
|
||||||
Warning,
|
|
||||||
Error,
|
|
||||||
Crit,
|
|
||||||
Alert,
|
|
||||||
Emerg
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace FreeSwitch.Types
|
|
||||||
{
|
|
||||||
public class MemoryPool
|
|
||||||
{
|
|
||||||
public HandleRef marshaledObject;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,61 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Marshaling;
|
|
||||||
|
|
||||||
namespace FreeSwitch.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 input,
|
|
||||||
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(CoreSessionMarshaler))]
|
|
||||||
CoreSession session,
|
|
||||||
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(StreamHandleMarshaler))]
|
|
||||||
StreamHandle streamHandle);
|
|
||||||
}
|
|
@ -1,69 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.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; }
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}
|
|
@ -1,66 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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>
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* SpeechHandle.cs --
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using FreeSwitch.Marshaling;
|
|
||||||
using FreeSwitch.Marshaling.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.Types
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
internal IntPtr speech_interface;
|
|
||||||
internal UInt32 flags;
|
|
||||||
internal IntPtr name;
|
|
||||||
internal UInt32 rate;
|
|
||||||
internal UInt32 speed;
|
|
||||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 80)]
|
|
||||||
internal byte[] voice;
|
|
||||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 80)]
|
|
||||||
internal byte[] engine;
|
|
||||||
internal IntPtr memory_pool;
|
|
||||||
internal IntPtr private_info;
|
|
||||||
*/
|
|
||||||
public class SpeechHandle
|
|
||||||
{
|
|
||||||
internal HandleRef marshaledObject;
|
|
||||||
|
|
||||||
public UInt32 flags
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
SpeechHandleMarshal speechHandleMarshal = (SpeechHandleMarshal)marshaledObject.Wrapper;
|
|
||||||
|
|
||||||
return speechHandleMarshal.flags;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,44 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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>
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* StateHandlerTable.cs --
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using FreeSwitch.Marshaling;
|
|
||||||
using FreeSwitch.Marshaling.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.Types
|
|
||||||
{
|
|
||||||
public class StateHandlerTable
|
|
||||||
{
|
|
||||||
internal HandleRef marshaledObject;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,51 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types
|
|
||||||
{
|
|
||||||
public enum Status
|
|
||||||
{
|
|
||||||
Success,
|
|
||||||
False,
|
|
||||||
Timeout,
|
|
||||||
Restart,
|
|
||||||
Terminate,
|
|
||||||
NotImplemented,
|
|
||||||
MemoryError,
|
|
||||||
NoOp,
|
|
||||||
Resample,
|
|
||||||
GeneralError,
|
|
||||||
InUse,
|
|
||||||
Break
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,57 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Marshaling;
|
|
||||||
using FreeSwitch.Marshaling.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.Types
|
|
||||||
{
|
|
||||||
public delegate Status StreamHandleWriteFunction(
|
|
||||||
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(StreamHandleMarshaler))]
|
|
||||||
StreamHandle streamHandle,
|
|
||||||
[MarshalAs(UnmanagedType.LPStr)]
|
|
||||||
string fmt);
|
|
||||||
|
|
||||||
public class StreamHandle
|
|
||||||
{
|
|
||||||
internal HandleRef marshaledObject;
|
|
||||||
|
|
||||||
public void Write(string data)
|
|
||||||
{
|
|
||||||
StreamHandleMarshal streamHandleMarshal = (StreamHandleMarshal)marshaledObject.Wrapper;
|
|
||||||
StreamHandleWriteFunction writeFunction = (StreamHandleWriteFunction)Marshal.GetDelegateForFunctionPointer(streamHandleMarshal.write_function, typeof(StreamHandleWriteFunction));
|
|
||||||
|
|
||||||
writeFunction(this, data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,42 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.Types
|
|
||||||
{
|
|
||||||
public enum TextChannel
|
|
||||||
{
|
|
||||||
ChannelIdConsole,
|
|
||||||
ChannelIdConsoleClean,
|
|
||||||
ChannelIdEvent
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,44 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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>
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* Timer.cs --
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using FreeSwitch.Marshaling;
|
|
||||||
using FreeSwitch.Marshaling.Types;
|
|
||||||
|
|
||||||
namespace FreeSwitch.Types
|
|
||||||
{
|
|
||||||
public class Timer
|
|
||||||
{
|
|
||||||
internal HandleRef marshaledObject;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user