--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<include>
+ <context name="default">
+
+ <extension name="demo">
+ <condition field="to" expression="^(.*)$">
+ <!-- <action application="lua" data="test.lua"/> -->
+
+ <action application="reply" data="Hello, you said: ${_body}"/>
+ </condition>
+ </extension>
+
+ </context>
+</include>
<X-PRE-PROCESS cmd="include" data="dialplan/*.xml"/>
</section>
+ <section name="chatplan" description="Regex/XML Chatplan">
+ <X-PRE-PROCESS cmd="include" data="chatplan/*.xml"/>
+ </section>
+
<!-- mod_dingaling is reliant on the vcard data in the "directory" section. -->
<!-- mod_sofia is reliant on the user data for authorization -->
<section name="directory" description="User Directory">
}
return hp->value;
-
- }
+ } else if (!strcmp(header_name, "_body")) {
+ return event->body;
+ }
return NULL;
}
int index = 0;
char *real_header_name = NULL;
+ if (!strcmp(header_name, "_body")) {
+ esl_event_set_body(event, data);
+ }
+
if ((index_ptr = strchr(header_name, '['))) {
index_ptr++;
index = atoi(index_ptr);
return ESL_FAIL;
}
+ESL_DECLARE(esl_status_t) esl_event_set_body(esl_event_t *event, const char *body)
+{
+ esl_safe_free(event->body);
+
+ if (body) {
+ event->body = DUP(body);
+ }
+
+ return ESL_SUCCESS;
+}
+
ESL_DECLARE(esl_status_t) esl_event_add_body(esl_event_t *event, const char *fmt, ...)
{
int ret = 0;
\note the body parameter can be shadowed by the esl_event_reserve_subclass_detailed function
*/
ESL_DECLARE(esl_status_t) esl_event_add_body(esl_event_t *event, const char *fmt, ...);
+ESL_DECLARE(esl_status_t) esl_event_set_body(esl_event_t *event, const char *body);
/*!
\brief Create a new event assuming it will not be custom event and therefore hiding the unused parameters
SWITCH_DECLARE(switch_status_t) switch_core_chat_send_args(const char *dest_proto, const char *proto, const char *from, const char *to,
const char *subject, const char *body, const char *type, const char *hint);
SWITCH_DECLARE(switch_status_t) switch_core_chat_send(const char *dest_proto, switch_event_t *message_event);
-
+SWITCH_DECLARE(switch_status_t) switch_core_chat_deliver(const char *dest_proto, switch_event_t **message_event);
SWITCH_DECLARE(switch_status_t) switch_ivr_preprocess_session(switch_core_session_t *session, const char *cmds);
SWITCH_DECLARE_CONSTRUCTOR Event(const char *type, const char *subclass_name = NULL);
SWITCH_DECLARE_CONSTRUCTOR Event(switch_event_t *wrap_me, int free_me = 0);
virtual SWITCH_DECLARE_CONSTRUCTOR ~ Event();
+ SWITCH_DECLARE(int) chat_execute(const char *app, const char *data = NULL);
+ SWITCH_DECLARE(int) chat_send(const char *dest_proto = NULL);
SWITCH_DECLARE(const char *) serialize(const char *format = NULL);
SWITCH_DECLARE(bool) setPriority(switch_priority_t priority = SWITCH_PRIORITY_NORMAL);
SWITCH_DECLARE(const char *) getHeader(const char *header_name);
};
typedef enum {
- EF_UNIQ_HEADERS = (1 << 0)
+ EF_UNIQ_HEADERS = (1 << 0),
+ EF_NO_CHAT_EXEC = (1 << 1)
} switch_event_flag_t;
#define switch_event_get_header_nil(e, h) switch_str_nil(switch_event_get_header(e,h))
+SWITCH_DECLARE(switch_status_t) switch_event_rename_header(switch_event_t *event, const char *header_name, const char *new_header_name);
+
/*!
\brief Retrieve the body value from an event
\param event the event to read the body from
*/
SWITCH_DECLARE(switch_status_t) switch_event_dup(switch_event_t **event, switch_event_t *todup);
SWITCH_DECLARE(void) switch_event_merge(switch_event_t *event, switch_event_t *tomerge);
+SWITCH_DECLARE(switch_status_t) switch_event_dup_reply(switch_event_t **event, switch_event_t *todup);
+
/*!
\brief Fire an event with full arguement list
\param file the calling file
*/
SWITCH_DECLARE(switch_status_t) switch_event_add_body(switch_event_t *event, const char *fmt, ...) PRINTF_FUNCTION(2, 3);
#endif
+
+SWITCH_DECLARE(switch_status_t) switch_event_set_body(switch_event_t *event, const char *body);
+
SWITCH_DECLARE(char *) switch_event_expand_headers(switch_event_t *event, const char *in);
SWITCH_DECLARE(switch_status_t) switch_event_create_pres_in_detailed(_In_z_ char *file, _In_z_ char *func, _In_ int line,
SWITCH_DECLARE(switch_status_t) switch_ivr_process_fh(switch_core_session_t *session, const char *cmd, switch_file_handle_t *fhp);
SWITCH_DECLARE(switch_status_t) switch_ivr_insert_file(switch_core_session_t *session, const char *file, const char *insert_file, switch_size_t sample_point);
+SWITCH_DECLARE(switch_status_t) switch_ivr_create_message_reply(switch_event_t **reply, switch_event_t *message, const char *new_proto);
+
/** @} */
SWITCH_END_EXTERN_C
struct switch_loadable_module_interface {
/*! the name of the module */
const char *module_name;
- /*! the table of endpoints the module has implmented */
+ /*! the table of endpoints the module has implemented */
switch_endpoint_interface_t *endpoint_interface;
- /*! the table of timers the module has implmented */
+ /*! the table of timers the module has implemented */
switch_timer_interface_t *timer_interface;
- /*! the table of dialplans the module has implmented */
+ /*! the table of dialplans the module has implemented */
switch_dialplan_interface_t *dialplan_interface;
- /*! the table of codecs the module has implmented */
+ /*! the table of codecs the module has implemented */
switch_codec_interface_t *codec_interface;
- /*! the table of applications the module has implmented */
+ /*! the table of applications the module has implemented */
switch_application_interface_t *application_interface;
- /*! the table of api functions the module has implmented */
+ /*! the table of chat applications the module has implemented */
+ switch_chat_application_interface_t *chat_application_interface;
+ /*! the table of api functions the module has implemented */
switch_api_interface_t *api_interface;
- /*! the table of file formats the module has implmented */
+ /*! the table of file formats the module has implemented */
switch_file_interface_t *file_interface;
- /*! the table of speech interfaces the module has implmented */
+ /*! the table of speech interfaces the module has implemented */
switch_speech_interface_t *speech_interface;
- /*! the table of directory interfaces the module has implmented */
+ /*! the table of directory interfaces the module has implemented */
switch_directory_interface_t *directory_interface;
- /*! the table of chat interfaces the module has implmented */
+ /*! the table of chat interfaces the module has implemented */
switch_chat_interface_t *chat_interface;
- /*! the table of say interfaces the module has implmented */
+ /*! the table of say interfaces the module has implemented */
switch_say_interface_t *say_interface;
- /*! the table of asr interfaces the module has implmented */
+ /*! the table of asr interfaces the module has implemented */
switch_asr_interface_t *asr_interface;
- /*! the table of management interfaces the module has implmented */
+ /*! the table of management interfaces the module has implemented */
switch_management_interface_t *management_interface;
- /*! the table of limit interfaces the module has implmented */
+ /*! the table of limit interfaces the module has implemented */
switch_limit_interface_t *limit_interface;
switch_thread_rwlock_t *rwlock;
int refs;
*/
SWITCH_DECLARE(switch_application_interface_t *) switch_loadable_module_get_application_interface(const char *name);
+/*!
+ \brief Retrieve the chat application interface by it's registered name
+ \param name the name of the chat application
+ \return the desired chat application interface
+ */
+SWITCH_DECLARE(switch_chat_application_interface_t *) switch_loadable_module_get_chat_application_interface(const char *name);
+
+SWITCH_DECLARE(switch_status_t) switch_core_execute_chat_app(switch_event_t *message, const char *app, const char *data);
+
/*!
\brief Retrieve the API interface by it's registered name
\param name the name of the API
break; \
}
+#define SWITCH_ADD_CHAT_APP(app_int, int_name, short_descript, long_descript, funcptr, syntax_string, app_flags) \
+ for (;;) { \
+ app_int = (switch_chat_application_interface_t *)switch_loadable_module_create_interface(*module_interface, SWITCH_CHAT_APPLICATION_INTERFACE); \
+ app_int->interface_name = int_name; \
+ app_int->chat_application_function = funcptr; \
+ app_int->short_desc = short_descript; \
+ app_int->long_desc = long_descript; \
+ app_int->syntax = syntax_string; \
+ app_int->flags = app_flags; \
+ break; \
+ }
+
#define SWITCH_ADD_DIALPLAN(dp_int, int_name, funcptr) \
for (;;) { \
dp_int = (switch_dialplan_interface_t *)switch_loadable_module_create_interface(*module_interface, SWITCH_DIALPLAN_INTERFACE); \
struct switch_application_interface *next;
};
+/*! \brief A module interface to implement a chat application */
+struct switch_chat_application_interface {
+ /*! the name of the interface */
+ const char *interface_name;
+ /*! function the application implements */
+ switch_chat_application_function_t chat_application_function;
+ /*! the long winded description of the application */
+ const char *long_desc;
+ /*! the short and sweet description of the application */
+ const char *short_desc;
+ /*! an example of the application syntax */
+ const char *syntax;
+ /*! flags to control behaviour */
+ uint32_t flags;
+ switch_thread_rwlock_t *rwlock;
+ int refs;
+ switch_mutex_t *reflock;
+ switch_loadable_module_interface_t *parent;
+ struct switch_chat_application_interface *next;
+};
+
/*! \brief A module interface to implement an api function */
struct switch_api_interface {
/*! the name of the interface */
int *ovector, const char *var, switch_cap_callback_t callback, void *user_data);
SWITCH_DECLARE_NONSTD(void) switch_regex_set_var_callback(const char *var, const char *val, void *user_data);
+SWITCH_DECLARE_NONSTD(void) switch_regex_set_event_header_callback(const char *var, const char *val, void *user_data);
#define switch_regex_safe_free(re) if (re) {\
switch_regex_free(re);\
SWITCH_SAY_INTERFACE,
SWITCH_ASR_INTERFACE,
SWITCH_MANAGEMENT_INTERFACE,
- SWITCH_LIMIT_INTERFACE
+ SWITCH_LIMIT_INTERFACE,
+ SWITCH_CHAT_APPLICATION_INTERFACE
} switch_module_interface_name_t;
typedef enum {
SWITCH_XML_SECTION_DIRECTORY = (1 << 1),
SWITCH_XML_SECTION_DIALPLAN = (1 << 2),
SWITCH_XML_SECTION_PHRASES = (1 << 3),
+ SWITCH_XML_SECTION_CHATPLAN = (1 << 4),
/* Nothing after this line */
SWITCH_XML_SECTION_MAX = (1 << 4)
} switch_application_flag_enum_t;
typedef uint32_t switch_application_flag_t;
+typedef enum {
+ SCAF_NONE = 0
+} switch_chat_application_flag_enum_t;
+typedef uint32_t switch_chat_application_flag_t;
+
+
/*!
\enum switch_signal_t
\brief Signals to send to channels
typedef struct switch_dialplan_interface switch_dialplan_interface_t;
typedef struct switch_codec_interface switch_codec_interface_t;
typedef struct switch_application_interface switch_application_interface_t;
+typedef struct switch_chat_application_interface switch_chat_application_interface_t;
typedef struct switch_api_interface switch_api_interface_t;
typedef struct switch_file_interface switch_file_interface_t;
typedef struct switch_speech_interface switch_speech_interface_t;
typedef switch_status_t (*switch_core_codec_destroy_func_t) (switch_codec_t *);
-
+typedef switch_status_t (*switch_chat_application_function_t) (switch_event_t *, const char *);
+#define SWITCH_STANDARD_CHAT_APP(name) static switch_status_t name (switch_event_t *message, const char *data)
typedef void (*switch_application_function_t) (switch_core_session_t *, const char *);
#define SWITCH_STANDARD_APP(name) static void name (switch_core_session_t *session, const char *data)
--- /dev/null
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+ ProjectType="Visual C++"\r
+ Version="9.00"\r
+ Name="mod_sms"\r
+ ProjectGUID="{11C9BC3D-45E9-46E3-BE84-B8CEE4685E39}"\r
+ RootNamespace="mod_sms"\r
+ Keyword="Win32Proj"\r
+ TargetFrameworkVersion="131072"\r
+ >\r
+ <Platforms>\r
+ <Platform\r
+ Name="Win32"\r
+ />\r
+ <Platform\r
+ Name="x64"\r
+ />\r
+ </Platforms>\r
+ <ToolFiles>\r
+ </ToolFiles>\r
+ <Configurations>\r
+ <Configuration\r
+ Name="Debug|Win32"\r
+ ConfigurationType="2"\r
+ InheritedPropertySheets="..\..\..\..\w32\module_debug.vsprops"\r
+ CharacterSet="2"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ UsePrecompiledHeader="0"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ RandomizedBaseAddress="1"\r
+ DataExecutionPrevention="0"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Debug|x64"\r
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
+ ConfigurationType="2"\r
+ InheritedPropertySheets="..\..\..\..\w32\module_debug.vsprops"\r
+ CharacterSet="2"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ TargetEnvironment="3"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ UsePrecompiledHeader="0"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ OutputFile="$(SolutionDir)$(PlatformName)\$(ConfigurationName)/mod/$(ProjectName).dll"\r
+ RandomizedBaseAddress="1"\r
+ DataExecutionPrevention="0"\r
+ TargetMachine="17"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Release|Win32"\r
+ ConfigurationType="2"\r
+ InheritedPropertySheets="..\..\..\..\w32\module_release.vsprops"\r
+ CharacterSet="2"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ UsePrecompiledHeader="0"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ RandomizedBaseAddress="1"\r
+ DataExecutionPrevention="0"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ <Configuration\r
+ Name="Release|x64"\r
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"\r
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"\r
+ ConfigurationType="2"\r
+ InheritedPropertySheets="..\..\..\..\w32\module_release.vsprops"\r
+ CharacterSet="2"\r
+ >\r
+ <Tool\r
+ Name="VCPreBuildEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCCustomBuildTool"\r
+ />\r
+ <Tool\r
+ Name="VCXMLDataGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCWebServiceProxyGeneratorTool"\r
+ />\r
+ <Tool\r
+ Name="VCMIDLTool"\r
+ TargetEnvironment="3"\r
+ />\r
+ <Tool\r
+ Name="VCCLCompilerTool"\r
+ UsePrecompiledHeader="0"\r
+ />\r
+ <Tool\r
+ Name="VCManagedResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCResourceCompilerTool"\r
+ />\r
+ <Tool\r
+ Name="VCPreLinkEventTool"\r
+ />\r
+ <Tool\r
+ Name="VCLinkerTool"\r
+ OutputFile="$(SolutionDir)$(PlatformName)\$(ConfigurationName)/mod/$(ProjectName).dll"\r
+ RandomizedBaseAddress="1"\r
+ DataExecutionPrevention="0"\r
+ TargetMachine="17"\r
+ />\r
+ <Tool\r
+ Name="VCALinkTool"\r
+ />\r
+ <Tool\r
+ Name="VCManifestTool"\r
+ />\r
+ <Tool\r
+ Name="VCXDCMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCBscMakeTool"\r
+ />\r
+ <Tool\r
+ Name="VCFxCopTool"\r
+ />\r
+ <Tool\r
+ Name="VCAppVerifierTool"\r
+ />\r
+ <Tool\r
+ Name="VCPostBuildEventTool"\r
+ />\r
+ </Configuration>\r
+ </Configurations>\r
+ <References>\r
+ </References>\r
+ <Files>\r
+ <File\r
+ RelativePath=".\mod_sms.c"\r
+ >\r
+ </File>\r
+ </Files>\r
+ <Globals>\r
+ </Globals>\r
+</VisualStudioProject>\r
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+ <ItemGroup Label="ProjectConfigurations">\r
+ <ProjectConfiguration Include="Debug|Win32">\r
+ <Configuration>Debug</Configuration>\r
+ <Platform>Win32</Platform>\r
+ </ProjectConfiguration>\r
+ <ProjectConfiguration Include="Debug|x64">\r
+ <Configuration>Debug</Configuration>\r
+ <Platform>x64</Platform>\r
+ </ProjectConfiguration>\r
+ <ProjectConfiguration Include="Release|Win32">\r
+ <Configuration>Release</Configuration>\r
+ <Platform>Win32</Platform>\r
+ </ProjectConfiguration>\r
+ <ProjectConfiguration Include="Release|x64">\r
+ <Configuration>Release</Configuration>\r
+ <Platform>x64</Platform>\r
+ </ProjectConfiguration>\r
+ </ItemGroup>\r
+ <PropertyGroup Label="Globals">\r
+ <ProjectName>mod_sms</ProjectName>\r
+ <ProjectGuid>{11C9BC3D-45E9-46E3-BE84-B8CEE4685E39}</ProjectGuid>\r
+ <RootNamespace>mod_sms</RootNamespace>\r
+ <Keyword>Win32Proj</Keyword>\r
+ </PropertyGroup>\r
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+ <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+ <CharacterSet>MultiByte</CharacterSet>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+ <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+ <CharacterSet>MultiByte</CharacterSet>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
+ <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+ <CharacterSet>MultiByte</CharacterSet>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
+ <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+ <CharacterSet>MultiByte</CharacterSet>\r
+ </PropertyGroup>\r
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+ <ImportGroup Label="ExtensionSettings">\r
+ </ImportGroup>\r
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+ <Import Project="..\..\..\..\w32\module_release.props" />\r
+ </ImportGroup>\r
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+ <Import Project="..\..\..\..\w32\module_debug.props" />\r
+ </ImportGroup>\r
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+ <Import Project="..\..\..\..\w32\module_release.props" />\r
+ </ImportGroup>\r
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+ <Import Project="..\..\..\..\w32\module_debug.props" />\r
+ </ImportGroup>\r
+ <PropertyGroup Label="UserMacros" />\r
+ <PropertyGroup>\r
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>\r
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+ </PropertyGroup>\r
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+ <ClCompile>\r
+ <PrecompiledHeader>\r
+ </PrecompiledHeader>\r
+ </ClCompile>\r
+ <Link>\r
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
+ <DataExecutionPrevention>\r
+ </DataExecutionPrevention>\r
+ </Link>\r
+ </ItemDefinitionGroup>\r
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+ <Midl>\r
+ <TargetEnvironment>X64</TargetEnvironment>\r
+ </Midl>\r
+ <ClCompile>\r
+ <PrecompiledHeader>\r
+ </PrecompiledHeader>\r
+ </ClCompile>\r
+ <Link>\r
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
+ <DataExecutionPrevention>\r
+ </DataExecutionPrevention>\r
+ <TargetMachine>MachineX64</TargetMachine>\r
+ </Link>\r
+ </ItemDefinitionGroup>\r
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+ <ClCompile>\r
+ <PrecompiledHeader>\r
+ </PrecompiledHeader>\r
+ </ClCompile>\r
+ <Link>\r
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
+ <DataExecutionPrevention>\r
+ </DataExecutionPrevention>\r
+ </Link>\r
+ </ItemDefinitionGroup>\r
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+ <Midl>\r
+ <TargetEnvironment>X64</TargetEnvironment>\r
+ </Midl>\r
+ <ClCompile>\r
+ <PrecompiledHeader>\r
+ </PrecompiledHeader>\r
+ </ClCompile>\r
+ <Link>\r
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>\r
+ <DataExecutionPrevention>\r
+ </DataExecutionPrevention>\r
+ <TargetMachine>MachineX64</TargetMachine>\r
+ </Link>\r
+ </ItemDefinitionGroup>\r
+ <ItemGroup>\r
+ <ClCompile Include="mod_sms.c" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <ProjectReference Include="..\..\..\..\w32\Library\FreeSwitchCore.2010.vcxproj">\r
+ <Project>{202d7a4e-760d-4d0e-afa1-d7459ced30ff}</Project>\r
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
+ </ProjectReference>\r
+ </ItemGroup>\r
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+ <ImportGroup Label="ExtensionTargets">\r
+ </ImportGroup>\r
+</Project>\r
--- /dev/null
+/*
+ * FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
+ * Copyright (C) 2005-2011, Anthony Minessale II <anthm@freeswitch.org>
+ *
+ * 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
+ * Anthony Minessale II <anthm@freeswitch.org>
+ * Portions created by the Initial Developer are Copyright (C)
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Anthony Minessale II <anthm@freeswitch.org>
+ *
+ * mod_sms.c -- Abstract SMS
+ *
+ */
+#include <switch.h>
+#define SMS_CHAT_PROTO "GLOBAL_SMS"
+#define MY_EVENT_SEND_MESSAGE "SMS::SEND_MESSAGE"
+
+/* Prototypes */
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_sms_shutdown);
+SWITCH_MODULE_RUNTIME_FUNCTION(mod_sms_runtime);
+SWITCH_MODULE_LOAD_FUNCTION(mod_sms_load);
+SWITCH_MODULE_DEFINITION(mod_sms, mod_sms_load, mod_sms_shutdown, NULL);
+
+
+static void event_handler(switch_event_t *event)
+{
+ const char *dest_proto = switch_event_get_header(event, "dest_proto");
+ switch_core_chat_send(dest_proto, event);
+}
+
+typedef enum {
+ BREAK_ON_TRUE,
+ BREAK_ON_FALSE,
+ BREAK_ALWAYS,
+ BREAK_NEVER
+} break_t;
+
+
+
+static int parse_exten(switch_event_t *event, switch_xml_t xexten, switch_event_t **extension)
+{
+ switch_xml_t xcond, xaction, xexpression;
+ char *exten_name = (char *) switch_xml_attr(xexten, "name");
+ int proceed = 0;
+ char *expression_expanded = NULL, *field_expanded = NULL;
+ switch_regex_t *re = NULL;
+ const char *to = switch_event_get_header(event, "to");
+
+ if (!to) {
+ to = "nobody";
+ }
+
+ if (!exten_name) {
+ exten_name = "_anon_";
+ }
+
+ for (xcond = switch_xml_child(xexten, "condition"); xcond; xcond = xcond->next) {
+ char *field = NULL;
+ char *do_break_a = NULL;
+ char *expression = NULL;
+ const char *field_data = NULL;
+ int ovector[30];
+ switch_bool_t anti_action = SWITCH_TRUE;
+ break_t do_break_i = BREAK_ON_FALSE;
+
+ int time_match = switch_xml_std_datetime_check(xcond);
+
+ switch_safe_free(field_expanded);
+ switch_safe_free(expression_expanded);
+
+ if (switch_xml_child(xcond, "condition")) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Nested conditions are not allowed!\n");
+ proceed = 1;
+ goto done;
+ }
+
+ field = (char *) switch_xml_attr(xcond, "field");
+
+ if ((xexpression = switch_xml_child(xcond, "expression"))) {
+ expression = switch_str_nil(xexpression->txt);
+ } else {
+ expression = (char *) switch_xml_attr_soft(xcond, "expression");
+ }
+
+ if ((expression_expanded = switch_event_expand_headers(event, expression)) == expression) {
+ expression_expanded = NULL;
+ } else {
+ expression = expression_expanded;
+ }
+
+ if ((do_break_a = (char *) switch_xml_attr(xcond, "break"))) {
+ if (!strcasecmp(do_break_a, "on-true")) {
+ do_break_i = BREAK_ON_TRUE;
+ } else if (!strcasecmp(do_break_a, "on-false")) {
+ do_break_i = BREAK_ON_FALSE;
+ } else if (!strcasecmp(do_break_a, "always")) {
+ do_break_i = BREAK_ALWAYS;
+ } else if (!strcasecmp(do_break_a, "never")) {
+ do_break_i = BREAK_NEVER;
+ } else {
+ do_break_a = NULL;
+ }
+ }
+
+ if (time_match == 1) {
+ switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG,
+ "Chatplan: %s Date/Time Match (PASS) [%s] break=%s\n",
+ to, exten_name, do_break_a ? do_break_a : "on-false");
+ anti_action = SWITCH_FALSE;
+ } else if (time_match == 0) {
+ switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG,
+ "Chatplan: %s Date/Time Match (FAIL) [%s] break=%s\n",
+ to, exten_name, do_break_a ? do_break_a : "on-false");
+ }
+
+ if (field) {
+ if (strchr(field, '$')) {
+ if ((field_expanded = switch_event_expand_headers(event, field)) == field) {
+ field_expanded = NULL;
+ field_data = field;
+ } else {
+ field_data = field_expanded;
+ }
+ } else {
+ field_data = switch_event_get_header(event, field);
+ }
+ if (!field_data) {
+ field_data = "";
+ }
+
+ if ((proceed = switch_regex_perform(field_data, expression, &re, ovector, sizeof(ovector) / sizeof(ovector[0])))) {
+ switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG,
+ "Chatplan: %s Regex (PASS) [%s] %s(%s) =~ /%s/ break=%s\n",
+ to, exten_name, field, field_data, expression, do_break_a ? do_break_a : "on-false");
+ anti_action = SWITCH_FALSE;
+ } else {
+ switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG,
+ "Chatplan: %s Regex (FAIL) [%s] %s(%s) =~ /%s/ break=%s\n",
+ to, exten_name, field, field_data, expression, do_break_a ? do_break_a : "on-false");
+ }
+ } else if (time_match == -1) {
+ switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG,
+ "Chatplan: %s Absolute Condition [%s]\n", to, exten_name);
+ anti_action = SWITCH_FALSE;
+ }
+
+ if (anti_action) {
+ for (xaction = switch_xml_child(xcond, "anti-action"); xaction; xaction = xaction->next) {
+ const char *application = switch_xml_attr_soft(xaction, "application");
+ const char *loop = switch_xml_attr(xaction, "loop");
+ const char *data;
+ const char *inline_ = switch_xml_attr_soft(xaction, "inline");
+ int xinline = switch_true(inline_);
+ int loop_count = 1;
+
+ if (!zstr(xaction->txt)) {
+ data = xaction->txt;
+ } else {
+ data = (char *) switch_xml_attr_soft(xaction, "data");
+ }
+
+ if (!*extension) {
+ if ((switch_event_create(extension, SWITCH_EVENT_CLONE)) != SWITCH_STATUS_SUCCESS) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n");
+ abort();
+ }
+ }
+
+ if (loop) {
+ loop_count = atoi(loop);
+ }
+
+ for (;loop_count > 0; loop_count--) {
+ switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG,
+ "Chatplan: %s ANTI-Action %s(%s) %s\n", to, application, data, xinline ? "INLINE" : "");
+
+ if (xinline) {
+ switch_core_execute_chat_app(event, application, data);
+ } else {
+ switch_event_add_header_string(*extension, SWITCH_STACK_BOTTOM, application, data);
+ }
+ }
+ proceed = 1;
+ }
+ } else {
+ if (field && strchr(expression, '(')) {
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "DP_MATCH", NULL);
+ switch_capture_regex(re, proceed, field_data, ovector, "DP_MATCH", switch_regex_set_event_header_callback, event);
+ }
+
+ for (xaction = switch_xml_child(xcond, "action"); xaction; xaction = xaction->next) {
+ char *application = (char *) switch_xml_attr_soft(xaction, "application");
+ const char *loop = switch_xml_attr(xaction, "loop");
+ char *data = NULL;
+ char *substituted = NULL;
+ uint32_t len = 0;
+ char *app_data = NULL;
+ const char *inline_ = switch_xml_attr_soft(xaction, "inline");
+ int xinline = switch_true(inline_);
+ int loop_count = 1;
+
+ if (!zstr(xaction->txt)) {
+ data = xaction->txt;
+ } else {
+ data = (char *) switch_xml_attr_soft(xaction, "data");
+ }
+
+ if (field && strchr(expression, '(')) {
+ len = (uint32_t) (strlen(data) + strlen(field_data) + 10) * proceed;
+ if (!(substituted = malloc(len))) {
+ abort();
+ }
+ memset(substituted, 0, len);
+ switch_perform_substitution(re, proceed, data, field_data, substituted, len, ovector);
+ app_data = substituted;
+ } else {
+ app_data = data;
+ }
+
+ if (!*extension) {
+ if ((switch_event_create(extension, SWITCH_EVENT_CLONE)) != SWITCH_STATUS_SUCCESS) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n");
+ abort();
+ }
+ }
+
+ if (loop) {
+ loop_count = atoi(loop);
+ }
+ for (;loop_count > 0; loop_count--) {
+ switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG,
+ "Chatplan: %s Action %s(%s) %s\n", to, application, app_data, xinline ? "INLINE" : "");
+
+ if (xinline) {
+ switch_core_execute_chat_app(event, application, app_data);
+ } else {
+ switch_event_add_header_string(*extension, SWITCH_STACK_BOTTOM, application, data);
+ }
+ }
+ switch_safe_free(substituted);
+ }
+ }
+ switch_regex_safe_free(re);
+
+ if (((anti_action == SWITCH_FALSE && do_break_i == BREAK_ON_TRUE) ||
+ (anti_action == SWITCH_TRUE && do_break_i == BREAK_ON_FALSE)) || do_break_i == BREAK_ALWAYS) {
+ break;
+ }
+ }
+
+ done:
+ switch_regex_safe_free(re);
+ switch_safe_free(field_expanded);
+ switch_safe_free(expression_expanded);
+ return proceed;
+}
+
+
+static switch_event_t *chatplan_hunt(switch_event_t *event)
+{
+ switch_event_t *extension = NULL;
+ switch_xml_t alt_root = NULL, cfg, xml = NULL, xcontext, xexten = NULL;
+ const char *alt_path;
+ const char *context;
+ const char *from;
+ const char *to;
+
+ if (!(context = switch_event_get_header(event, "context"))) {
+ context = "default";
+ }
+
+ if (!(from = switch_event_get_header(event, "from_user"))) {
+ from = switch_event_get_header(event, "from");
+ }
+
+ if (!(to = switch_event_get_header(event, "to_user"))) {
+ to = switch_event_get_header(event, "to");
+ }
+
+ alt_path = switch_event_get_header(event, "alt_path");
+
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Processing text message %s->%s in context %s\n", from, to, context);
+
+ /* get our handle to the "chatplan" section of the config */
+
+ if (!zstr(alt_path)) {
+ switch_xml_t conf = NULL, tag = NULL;
+ if (!(alt_root = switch_xml_parse_file_simple(alt_path))) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Open of [%s] failed\n", alt_path);
+ goto done;
+ }
+
+ if ((conf = switch_xml_find_child(alt_root, "section", "name", "chatplan")) && (tag = switch_xml_find_child(conf, "chatplan", NULL, NULL))) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Getting chatplan from alternate path: %s\n", alt_path);
+ xml = alt_root;
+ cfg = tag;
+ } else {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Open of chatplan failed\n");
+ goto done;
+ }
+ } else {
+ if (switch_xml_locate("chatplan", NULL, NULL, NULL, &xml, &cfg, event, SWITCH_FALSE) != SWITCH_STATUS_SUCCESS) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Open of chatplan failed\n");
+ goto done;
+ }
+ }
+
+ /* get a handle to the context tag */
+ if (!(xcontext = switch_xml_find_child(cfg, "context", "name", context))) {
+ if (!(xcontext = switch_xml_find_child(cfg, "context", "name", "global"))) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Context %s not found\n", context);
+ goto done;
+ }
+ }
+
+ xexten = switch_xml_child(xcontext, "extension");
+
+ while (xexten) {
+ int proceed = 0;
+ const char *cont = switch_xml_attr(xexten, "continue");
+ const char *exten_name = switch_xml_attr(xexten, "name");
+
+ if (!exten_name) {
+ exten_name = "UNKNOWN";
+ }
+
+ switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG,
+ "Chatplan: %s parsing [%s->%s] continue=%s\n",
+ to, context, exten_name, cont ? cont : "false");
+
+ proceed = parse_exten(event, xexten, &extension);
+
+ if (proceed && !switch_true(cont)) {
+ break;
+ }
+
+ xexten = xexten->next;
+ }
+
+ switch_xml_free(xml);
+ xml = NULL;
+
+ done:
+ switch_xml_free(xml);
+ return extension;
+}
+
+
+static switch_status_t chat_send(switch_event_t *message_event)
+ {
+ switch_status_t status = SWITCH_STATUS_SUCCESS;
+ switch_event_t *exten;
+
+ if ((exten = chatplan_hunt(message_event))) {
+ switch_event_header_t *hp;
+
+ for (hp = exten->headers; hp; hp = hp->next) {
+ status = switch_core_execute_chat_app(message_event, hp->name, hp->value);
+ if (!SWITCH_READ_ACCEPTABLE(status)) {
+ break;
+ }
+ }
+
+ switch_event_destroy(&exten);
+ }
+
+
+ status = SWITCH_STATUS_BREAK;
+
+
+ return status;
+
+}
+
+SWITCH_STANDARD_CHAT_APP(stop_function)
+{
+ switch_set_flag(message, EF_NO_CHAT_EXEC);
+ return SWITCH_STATUS_FALSE;
+}
+
+SWITCH_STANDARD_CHAT_APP(send_function)
+{
+ const char *dest_proto = data;
+
+ if (zstr(dest_proto)) {
+ dest_proto = switch_event_get_header(message, "dest_proto");
+ }
+
+ switch_core_chat_send(dest_proto, message);
+
+ return SWITCH_STATUS_SUCCESS;
+}
+
+SWITCH_STANDARD_CHAT_APP(set_function)
+{
+ char *var, *val;
+
+ if (data) {
+ var = strdup(data);
+ if ((val = strchr(var, '='))) {
+ *val++ = '\0';
+ }
+
+ if (zstr(val)) {
+ switch_event_del_header(message, var);
+ } else {
+ switch_event_add_header_string(message, SWITCH_STACK_BOTTOM, var, val);
+ }
+ }
+
+ return SWITCH_STATUS_SUCCESS;
+}
+
+SWITCH_STANDARD_CHAT_APP(fire_function)
+{
+ switch_event_t *fireme;
+
+ switch_event_dup(&fireme, message);
+ switch_event_fire(&fireme);
+
+ return SWITCH_STATUS_SUCCESS;
+}
+
+SWITCH_STANDARD_CHAT_APP(reply_function)
+{
+ switch_event_t *reply;
+ const char *proto = switch_event_get_header(message, "proto");
+
+ if (proto) {
+ switch_ivr_create_message_reply(&reply, message, SMS_CHAT_PROTO);
+
+ if (!zstr(data)) {
+ switch_event_add_body(reply, data);
+ }
+
+ switch_core_chat_deliver(proto, &reply);
+
+ return SWITCH_STATUS_SUCCESS;
+ }
+
+ return SWITCH_STATUS_SUCCESS;
+}
+
+/* Macro expands to: switch_status_t mod_sms_load(switch_loadable_module_interface_t **module_interface, switch_memory_pool_t *pool) */
+SWITCH_MODULE_LOAD_FUNCTION(mod_sms_load)
+{
+ switch_chat_interface_t *chat_interface;
+ switch_chat_application_interface_t *chat_app_interface;
+
+
+ if (switch_event_bind(modname, SWITCH_EVENT_CUSTOM, MY_EVENT_SEND_MESSAGE, event_handler, NULL) != SWITCH_STATUS_SUCCESS) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't bind!\n");
+ return SWITCH_STATUS_GENERR;
+ }
+
+ /* connect my internal structure to the blank pointer passed to me */
+ *module_interface = switch_loadable_module_create_module_interface(pool, modname);
+
+ SWITCH_ADD_CHAT(chat_interface, SMS_CHAT_PROTO, chat_send);
+
+ SWITCH_ADD_CHAT_APP(chat_app_interface, "reply", "reply to a message", "reply to a message", reply_function, "", SCAF_NONE);
+ SWITCH_ADD_CHAT_APP(chat_app_interface, "stop", "stop execution", "stop execution", stop_function, "", SCAF_NONE);
+ SWITCH_ADD_CHAT_APP(chat_app_interface, "set", "set a variable", "set a variable", set_function, "", SCAF_NONE);
+ SWITCH_ADD_CHAT_APP(chat_app_interface, "send", "send the message as-is", "send the message as-is", send_function, "", SCAF_NONE);
+ SWITCH_ADD_CHAT_APP(chat_app_interface, "fire", "fire the message", "fire the message", fire_function, "", SCAF_NONE);
+
+ /* indicate that the module should continue to be loaded */
+ return SWITCH_STATUS_SUCCESS;
+}
+
+/*
+ Called when the system shuts down
+ Macro expands to: switch_status_t mod_sms_shutdown() */
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_sms_shutdown)
+{
+ switch_event_unbind_callback(event_handler);
+
+ return SWITCH_STATUS_SUCCESS;
+}
+
+
+
+
+/* For Emacs:
+ * Local Variables:
+ * mode:c
+ * indent-tabs-mode:t
+ * tab-width:4
+ * c-basic-offset:4
+ * End:
+ * For VIM:
+ * vim:set softtabstop=4 shiftwidth=4 tabstop=4
+ */
}
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to", to);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "subject", subject);
- switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "normal");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "text/plain");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "hint", hint);
if (msg) {
//const char *subject;
const char *body;
const char *type;
- const char *hint;
+ const char *from_full;
+ char header[256] = "";
+ char *route_uri = NULL;
+ const char *network_ip = NULL, *network_port = NULL;
proto = switch_event_get_header(message_event, "proto");
from = switch_event_get_header(message_event, "from");
//subject = switch_event_get_header(message_event, "subject");
body = switch_event_get_body(message_event);
type = switch_event_get_header(message_event, "type");
- hint = switch_event_get_header(message_event, "hint");
-
+ from_full = switch_event_get_header(message_event, "from_full");
+
+ network_ip = switch_event_get_header(message_event, "to_sip_ip");
+ network_port = switch_event_get_header(message_event, "to_sip_port");
if (!to) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missing To: header.\n");
user = prof;
prof = NULL;
}
+
+ if (!prof) {
+ prof = switch_event_get_header(message_event, "sip_profile");
+ }
if (!strncasecmp(user, "sip:", 4)) {
to_uri = user;
} else {
host++;
}
- if (!prof)
+ if (!prof) {
prof = host;
+ }
}
if (!prof || !(profile = sofia_glue_find_profile(prof))) {
}
}
+
if (to_uri) {
switch_console_push_match(&list, to_uri);
} else if (!(list = sofia_reg_find_reg_url_multi(profile, user, host))) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't find registered user %s@%s\n", user, host);
- goto end;
+ sofia_profile_t *test;
+
+ if ((test = sofia_glue_find_profile(host))) {
+ sofia_glue_release_profile(test);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Not sending to local box for %s@%s\n", user, host);
+ /* our box let's not send it */
+ } else {
+ char *tmp;
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Can't find registered user %s@%s\n", user, host);
+ tmp = switch_mprintf("sip:%s@%s", user, host);
+ switch_console_push_match(&list, tmp);
+ free(tmp);
+ }
+
}
if (!strcasecmp(proto, SOFIA_CHAT_PROTO)) {
- from = hint;
+ from = from_full;
} else {
char *fp, *p = NULL;
fp = strdup(from);
+ switch_assert(fp);
- if (!fp) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Error!\n");
- goto end;
- }
if ((p = strchr(fp, '@'))) {
*p++ = '\0';
}
}
- ffrom = switch_mprintf("\"%s\" <sip:%s+%s@%s>", fp, proto, fp, p);
+ if (switch_stristr("global", proto)) {
+ ffrom = switch_mprintf("\"%s\" <sip:%s@%s>", fp, fp, p);
+ } else {
+ ffrom = switch_mprintf("\"%s\" <sip:%s+%s@%s>", fp, proto, fp, p);
+ }
from = ffrom;
switch_safe_free(fp);
}
+ if (!list) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
+ "Chat proto [%s]\nfrom [%s]\nto [%s]\n%s\nNobody to send to: Profile %s\n", proto, from, to,
+ body ? body : "[no body]", prof ? prof : "NULL");
+ goto end;
+ }
+
for (m = list->head; m; m = m->next) {
if (!(dst = sofia_glue_get_destination(m->val))) {
/* if this cries, add contact here too, change the 1 to 0 and omit the safe_free */
+ //printf("DEBUG To: [%s] From: [%s] Contact: [%s] RURI [%s] ip [%s] port [%s]\n", to, from, contact, dst->route_uri, network_ip, network_port);
+
+ //DUMP_EVENT(message_event);
+
+ if (zstr(dst->route_uri) && !zstr(user) && !zstr(network_ip) && (zstr(host) || strcmp(network_ip, host))) {
+ route_uri = switch_mprintf("sip:%s@%s:%s", user, network_ip, network_port);
+ }
+
msg_nh = nua_handle(profile->nua, NULL,
- TAG_IF(dst->route_uri, NUTAG_PROXY(dst->route_uri)),
- TAG_IF(dst->route, SIPTAG_ROUTE_STR(dst->route)),
- SIPTAG_FROM_STR(from),
- TAG_IF(contact, NUTAG_URL(contact)),
- SIPTAG_TO_STR(dup_dest),
- SIPTAG_CONTACT_STR(contact_str),
TAG_END());
nua_handle_bind(msg_nh, &mod_sofia_globals.destroy_private);
+ switch_snprintf(header, sizeof(header), "X-FS-Sending-Message: %s", switch_core_get_uuid());
+
nua_message(msg_nh,
+ TAG_IF(dst->route_uri, NUTAG_PROXY(dst->route_uri)),
+ TAG_IF(route_uri, NUTAG_PROXY(route_uri)),
+ TAG_IF(dst->route, SIPTAG_ROUTE_STR(dst->route)),
+ SIPTAG_FROM_STR(from),
+ TAG_IF(contact, NUTAG_URL(contact)),
+ SIPTAG_TO_STR(dup_dest),
+ SIPTAG_CONTACT_STR(contact_str),
+
TAG_IF(user_via, SIPTAG_VIA_STR(user_via)),
SIPTAG_CONTENT_TYPE_STR(ct),
SIPTAG_PAYLOAD_STR(body),
+ SIPTAG_HEADER_STR(header),
TAG_END());
sofia_glue_free_destination(dst);
end:
switch_safe_free(contact);
+ switch_safe_free(route_uri);
switch_safe_free(ffrom);
switch_safe_free(dup);
const char *to_host = NULL;
sip_payload_t *payload = sip->sip_payload;
char *msg = NULL;
+ const char *us;
+ char network_ip[80];
+ int network_port = 0;
+
+ if ((us = sofia_glue_get_unknown_header(sip, "X-FS-Sending-Message")) && !strcmp(us, switch_core_get_uuid())) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Not sending message to ourselves!\n");
+ goto end;
+ }
if (sip->sip_content_type && sip->sip_content_type->c_subtype) {
if (strstr(sip->sip_content_type->c_subtype, "composing")) {
- return;
+ goto end;
}
}
+
+ sofia_glue_get_addr(de->data->e_msg, network_ip, sizeof(network_ip), &network_port);
+
+
if (from) {
from_user = from->a_url->url_user;
from_host = from->a_url->url_host;
}
if (!to_user) {
- return;
+ goto end;
}
if (payload) {
to_addr = switch_mprintf("%s@%s", to_user, to_host);
}
- from_addr = switch_mprintf("%s/%s@%s", profile->name, from_user, from_host);
+ from_addr = switch_mprintf("%s@%s", from_user, from_host);
if (sofia_test_pflag(profile, PFLAG_IN_DIALOG_CHAT)) {
sofia_presence_set_hash_key(hash_key, sizeof(hash_key), sip);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from", from_addr);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from_user", from_user);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from_host", from_host);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to_user", to_user);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to_host", to_host);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from_sip_ip", network_ip);
+ switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from_sip_port", "%d", network_port);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "to", to_addr);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "subject", "SIMPLE MESSAGE");
- switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "normal");
- switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "hint", full_from);
+
+
+ if (sip->sip_content_type && sip->sip_content_type->c_subtype) {
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", sip->sip_content_type->c_type);
+ } else {
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "text/plain");
+ }
+
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "from_full", full_from);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "sip_profile", profile->name);
if (msg) {
switch_event_add_body(event, "%s", msg);
switch_core_session_queue_event(tech_pvt->session, &event);
} else {
switch_core_chat_send(proto, event);
- switch_core_chat_send("GLOBAL", event);
switch_event_destroy(&event);
}
}
}
}
+
+ end:
+
+ nua_respond(nh, SIP_200_OK, NUTAG_WITH_THIS_MSG(de->data->e_msg), TAG_END());
+
}
void sofia_presence_set_chat_hash(private_object_t *tech_pvt, sip_t const *sip)
}
/* Log line added to support Fail2Ban */
if (sofia_test_pflag(profile, PFLAG_LOG_AUTH_FAIL)) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "SIP auth challenge (%s) on sofia profile '%s' "
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10, "SIP auth challenge (%s) on sofia profile '%s' "
"for [%s@%s] from ip %s\n", (regtype == REG_INVITE) ? "INVITE" : "REGISTER",
profile->name, to_user, to_host, network_ip);
}
this(freeswitchJNI.new_Event__SWIG_1(SWIGTYPE_p_switch_event_t.getCPtr(wrap_me), free_me), true);
}
+ public int chat_execute(String app, String data) {
+ return freeswitchJNI.Event_chat_execute(swigCPtr, this, app, data);
+ }
+
+ public int chat_send(String dest_proto) {
+ return freeswitchJNI.Event_chat_send(swigCPtr, this, dest_proto);
+ }
+
public String serialize(String format) {
return freeswitchJNI.Event_serialize(swigCPtr, this, format);
}
public final static native long new_Event__SWIG_0(String jarg1, String jarg2);
public final static native long new_Event__SWIG_1(long jarg1, int jarg2);
public final static native void delete_Event(long jarg1);
+ public final static native int Event_chat_execute(long jarg1, Event jarg1_, String jarg2, String jarg3);
+ public final static native int Event_chat_send(long jarg1, Event jarg1_, String jarg2);
public final static native String Event_serialize(long jarg1, Event jarg1_, String jarg2);
public final static native boolean Event_setPriority(long jarg1, Event jarg1_, long jarg2);
public final static native String Event_getHeader(long jarg1, Event jarg1_, String jarg2);
}
+SWIGEXPORT jint JNICALL Java_org_freeswitch_swig_freeswitchJNI_Event_1chat_1execute(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2, jstring jarg3) {
+ jint jresult = 0 ;
+ Event *arg1 = (Event *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) NULL ;
+ int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(Event **)&jarg1;
+ arg2 = 0;
+ if (jarg2) {
+ arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
+ if (!arg2) return 0;
+ }
+ arg3 = 0;
+ if (jarg3) {
+ arg3 = (char *)jenv->GetStringUTFChars(jarg3, 0);
+ if (!arg3) return 0;
+ }
+ result = (int)(arg1)->chat_execute((char const *)arg2,(char const *)arg3);
+ jresult = (jint)result;
+ if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2);
+ if (arg3) jenv->ReleaseStringUTFChars(jarg3, (const char *)arg3);
+ return jresult;
+}
+
+
+SWIGEXPORT jint JNICALL Java_org_freeswitch_swig_freeswitchJNI_Event_1chat_1send(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) {
+ jint jresult = 0 ;
+ Event *arg1 = (Event *) 0 ;
+ char *arg2 = (char *) NULL ;
+ int result;
+
+ (void)jenv;
+ (void)jcls;
+ (void)jarg1_;
+ arg1 = *(Event **)&jarg1;
+ arg2 = 0;
+ if (jarg2) {
+ arg2 = (char *)jenv->GetStringUTFChars(jarg2, 0);
+ if (!arg2) return 0;
+ }
+ result = (int)(arg1)->chat_send((char const *)arg2);
+ jresult = (jint)result;
+ if (arg2) jenv->ReleaseStringUTFChars(jarg2, (const char *)arg2);
+ return jresult;
+}
+
+
SWIGEXPORT jstring JNICALL Java_org_freeswitch_swig_freeswitchJNI_Event_1serialize(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jstring jarg2) {
jstring jresult = 0 ;
Event *arg1 = (Event *) 0 ;
return SWITCH_STATUS_SUCCESS;
}
+SWITCH_STANDARD_CHAT_APP(lua_chat_function)
+{
+ lua_State *L = lua_init();
+ char *dup = NULL;
+
+ if (data) {
+ dup = strdup(data);
+ }
+
+ mod_lua_conjure_event(L, message, "message", 1);
+ lua_parse_and_execute(L, (char *)dup);
+ lua_uninit(L);
+
+ switch_safe_free(dup);
+
+ return SWITCH_STATUS_SUCCESS;
+
+}
SWITCH_STANDARD_API(lua_api_function)
{
switch_api_interface_t *api_interface;
switch_application_interface_t *app_interface;
switch_dialplan_interface_t *dp_interface;
+ switch_chat_application_interface_t *chat_app_interface;
/* connect my internal structure to the blank pointer passed to me */
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
SWITCH_ADD_APP(app_interface, "lua", "Launch LUA ivr", "Run a lua ivr on a channel", lua_function, "<script>", SAF_SUPPORT_NOMEDIA | SAF_ROUTING_EXEC);
SWITCH_ADD_DIALPLAN(dp_interface, "LUA", lua_dialplan_hunt);
+ SWITCH_ADD_CHAT_APP(chat_app_interface, "lua", "execute a lua script", "execute a lua script", lua_chat_function, "<script>", SCAF_NONE);
globals.pool = pool;
}
+static int _wrap_Event_chat_execute(lua_State* L) {
+ int SWIG_arg = -1;
+ Event *arg1 = (Event *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) NULL ;
+ int result;
+
+ SWIG_check_num_args("chat_execute",2,3)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("chat_execute",1,"Event *");
+ if(!lua_isstring(L,2)) SWIG_fail_arg("chat_execute",2,"char const *");
+ if(lua_gettop(L)>=3 && !lua_isstring(L,3)) SWIG_fail_arg("chat_execute",3,"char const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
+ SWIG_fail_ptr("Event_chat_execute",1,SWIGTYPE_p_Event);
+ }
+
+ arg2 = (char *)lua_tostring(L, 2);
+ if(lua_gettop(L)>=3){
+ arg3 = (char *)lua_tostring(L, 3);
+ }
+ result = (int)(arg1)->chat_execute((char const *)arg2,(char const *)arg3);
+ SWIG_arg=0;
+ lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
+static int _wrap_Event_chat_send(lua_State* L) {
+ int SWIG_arg = -1;
+ Event *arg1 = (Event *) 0 ;
+ char *arg2 = (char *) NULL ;
+ int result;
+
+ SWIG_check_num_args("chat_send",1,2)
+ if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("chat_send",1,"Event *");
+ if(lua_gettop(L)>=2 && !lua_isstring(L,2)) SWIG_fail_arg("chat_send",2,"char const *");
+
+ if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Event,0))){
+ SWIG_fail_ptr("Event_chat_send",1,SWIGTYPE_p_Event);
+ }
+
+ if(lua_gettop(L)>=2){
+ arg2 = (char *)lua_tostring(L, 2);
+ }
+ result = (int)(arg1)->chat_send((char const *)arg2);
+ SWIG_arg=0;
+ lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
+ return SWIG_arg;
+
+ if(0) SWIG_fail;
+
+fail:
+ lua_error(L);
+ return SWIG_arg;
+}
+
+
static int _wrap_Event_serialize(lua_State* L) {
int SWIG_arg = -1;
Event *arg1 = (Event *) 0 ;
delete arg1;
}
static swig_lua_method swig_Event_methods[] = {
+ {"chat_execute", _wrap_Event_chat_execute},
+ {"chat_send", _wrap_Event_chat_send},
{"serialize", _wrap_Event_serialize},
{"setPriority", _wrap_Event_setPriority},
{"getHeader", _wrap_Event_getHeader},
}
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_regex_set_event_header_callback(char * jarg1, char * jarg2, void * jarg3) {
+ char *arg1 = (char *) 0 ;
+ char *arg2 = (char *) 0 ;
+ void *arg3 = (void *) 0 ;
+
+ arg1 = (char *)jarg1;
+ arg2 = (char *)jarg2;
+ arg3 = (void *)jarg3;
+ switch_regex_set_event_header_callback((char const *)arg1,(char const *)arg2,arg3);
+}
+
+
SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_MAX_CORE_THREAD_SESSION_OBJS_get() {
int jresult ;
int result;
}
+SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_chat_deliver(char * jarg1, void * jarg2) {
+ int jresult ;
+ char *arg1 = (char *) 0 ;
+ switch_event_t **arg2 = (switch_event_t **) 0 ;
+ switch_status_t result;
+
+ arg1 = (char *)jarg1;
+ arg2 = (switch_event_t **)jarg2;
+ result = (switch_status_t)switch_core_chat_deliver((char const *)arg1,arg2);
+ jresult = result;
+ return jresult;
+}
+
+
SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_preprocess_session(void * jarg1, char * jarg2) {
int jresult ;
switch_core_session_t *arg1 = (switch_core_session_t *) 0 ;
}
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_chat_application_interface_set(void * jarg1, void * jarg2) {
+ switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
+ switch_chat_application_interface_t *arg2 = (switch_chat_application_interface_t *) 0 ;
+
+ arg1 = (switch_loadable_module_interface *)jarg1;
+ arg2 = (switch_chat_application_interface_t *)jarg2;
+ if (arg1) (arg1)->chat_application_interface = arg2;
+
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_interface_chat_application_interface_get(void * jarg1) {
+ void * jresult ;
+ switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
+ switch_chat_application_interface_t *result = 0 ;
+
+ arg1 = (switch_loadable_module_interface *)jarg1;
+ result = (switch_chat_application_interface_t *) ((arg1)->chat_application_interface);
+ jresult = (void *)result;
+ return jresult;
+}
+
+
SWIGEXPORT void SWIGSTDCALL CSharp_switch_loadable_module_interface_api_interface_set(void * jarg1, void * jarg2) {
switch_loadable_module_interface *arg1 = (switch_loadable_module_interface *) 0 ;
switch_api_interface_t *arg2 = (switch_api_interface_t *) 0 ;
}
+SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_chat_application_interface(char * jarg1) {
+ void * jresult ;
+ char *arg1 = (char *) 0 ;
+ switch_chat_application_interface_t *result = 0 ;
+
+ arg1 = (char *)jarg1;
+ result = (switch_chat_application_interface_t *)switch_loadable_module_get_chat_application_interface((char const *)arg1);
+ jresult = (void *)result;
+ return jresult;
+}
+
+
+SWIGEXPORT int SWIGSTDCALL CSharp_switch_core_execute_chat_app(void * jarg1, char * jarg2, char * jarg3) {
+ int jresult ;
+ switch_event_t *arg1 = (switch_event_t *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ switch_status_t result;
+
+ arg1 = (switch_event_t *)jarg1;
+ arg2 = (char *)jarg2;
+ arg3 = (char *)jarg3;
+ result = (switch_status_t)switch_core_execute_chat_app(arg1,(char const *)arg2,(char const *)arg3);
+ jresult = result;
+ return jresult;
+}
+
+
SWIGEXPORT void * SWIGSTDCALL CSharp_switch_loadable_module_get_api_interface(char * jarg1) {
void * jresult ;
char *arg1 = (char *) 0 ;
}
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_chat_application_interface_interface_name_set(void * jarg1, char * jarg2) {
+ switch_chat_application_interface *arg1 = (switch_chat_application_interface *) 0 ;
+ char *arg2 = (char *) 0 ;
+
+ arg1 = (switch_chat_application_interface *)jarg1;
+ arg2 = (char *)jarg2;
+ {
+ if (arg2) {
+ arg1->interface_name = (char const *) (new char[strlen((const char *)arg2)+1]);
+ strcpy((char *)arg1->interface_name, (const char *)arg2);
+ } else {
+ arg1->interface_name = 0;
+ }
+ }
+}
+
+
+SWIGEXPORT char * SWIGSTDCALL CSharp_switch_chat_application_interface_interface_name_get(void * jarg1) {
+ char * jresult ;
+ switch_chat_application_interface *arg1 = (switch_chat_application_interface *) 0 ;
+ char *result = 0 ;
+
+ arg1 = (switch_chat_application_interface *)jarg1;
+ result = (char *) ((arg1)->interface_name);
+ jresult = SWIG_csharp_string_callback((const char *)result);
+ return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_chat_application_interface_chat_application_function_set(void * jarg1, void * jarg2) {
+ switch_chat_application_interface *arg1 = (switch_chat_application_interface *) 0 ;
+ switch_chat_application_function_t arg2 = (switch_chat_application_function_t) 0 ;
+
+ arg1 = (switch_chat_application_interface *)jarg1;
+ arg2 = (switch_chat_application_function_t)jarg2;
+ if (arg1) (arg1)->chat_application_function = arg2;
+
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_switch_chat_application_interface_chat_application_function_get(void * jarg1) {
+ void * jresult ;
+ switch_chat_application_interface *arg1 = (switch_chat_application_interface *) 0 ;
+ switch_chat_application_function_t result;
+
+ arg1 = (switch_chat_application_interface *)jarg1;
+ result = (switch_chat_application_function_t) ((arg1)->chat_application_function);
+ jresult = (void *)result;
+ return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_chat_application_interface_long_desc_set(void * jarg1, char * jarg2) {
+ switch_chat_application_interface *arg1 = (switch_chat_application_interface *) 0 ;
+ char *arg2 = (char *) 0 ;
+
+ arg1 = (switch_chat_application_interface *)jarg1;
+ arg2 = (char *)jarg2;
+ {
+ if (arg2) {
+ arg1->long_desc = (char const *) (new char[strlen((const char *)arg2)+1]);
+ strcpy((char *)arg1->long_desc, (const char *)arg2);
+ } else {
+ arg1->long_desc = 0;
+ }
+ }
+}
+
+
+SWIGEXPORT char * SWIGSTDCALL CSharp_switch_chat_application_interface_long_desc_get(void * jarg1) {
+ char * jresult ;
+ switch_chat_application_interface *arg1 = (switch_chat_application_interface *) 0 ;
+ char *result = 0 ;
+
+ arg1 = (switch_chat_application_interface *)jarg1;
+ result = (char *) ((arg1)->long_desc);
+ jresult = SWIG_csharp_string_callback((const char *)result);
+ return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_chat_application_interface_short_desc_set(void * jarg1, char * jarg2) {
+ switch_chat_application_interface *arg1 = (switch_chat_application_interface *) 0 ;
+ char *arg2 = (char *) 0 ;
+
+ arg1 = (switch_chat_application_interface *)jarg1;
+ arg2 = (char *)jarg2;
+ {
+ if (arg2) {
+ arg1->short_desc = (char const *) (new char[strlen((const char *)arg2)+1]);
+ strcpy((char *)arg1->short_desc, (const char *)arg2);
+ } else {
+ arg1->short_desc = 0;
+ }
+ }
+}
+
+
+SWIGEXPORT char * SWIGSTDCALL CSharp_switch_chat_application_interface_short_desc_get(void * jarg1) {
+ char * jresult ;
+ switch_chat_application_interface *arg1 = (switch_chat_application_interface *) 0 ;
+ char *result = 0 ;
+
+ arg1 = (switch_chat_application_interface *)jarg1;
+ result = (char *) ((arg1)->short_desc);
+ jresult = SWIG_csharp_string_callback((const char *)result);
+ return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_chat_application_interface_syntax_set(void * jarg1, char * jarg2) {
+ switch_chat_application_interface *arg1 = (switch_chat_application_interface *) 0 ;
+ char *arg2 = (char *) 0 ;
+
+ arg1 = (switch_chat_application_interface *)jarg1;
+ arg2 = (char *)jarg2;
+ {
+ if (arg2) {
+ arg1->syntax = (char const *) (new char[strlen((const char *)arg2)+1]);
+ strcpy((char *)arg1->syntax, (const char *)arg2);
+ } else {
+ arg1->syntax = 0;
+ }
+ }
+}
+
+
+SWIGEXPORT char * SWIGSTDCALL CSharp_switch_chat_application_interface_syntax_get(void * jarg1) {
+ char * jresult ;
+ switch_chat_application_interface *arg1 = (switch_chat_application_interface *) 0 ;
+ char *result = 0 ;
+
+ arg1 = (switch_chat_application_interface *)jarg1;
+ result = (char *) ((arg1)->syntax);
+ jresult = SWIG_csharp_string_callback((const char *)result);
+ return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_chat_application_interface_flags_set(void * jarg1, unsigned long jarg2) {
+ switch_chat_application_interface *arg1 = (switch_chat_application_interface *) 0 ;
+ uint32_t arg2 ;
+
+ arg1 = (switch_chat_application_interface *)jarg1;
+ arg2 = (uint32_t)jarg2;
+ if (arg1) (arg1)->flags = arg2;
+
+}
+
+
+SWIGEXPORT unsigned long SWIGSTDCALL CSharp_switch_chat_application_interface_flags_get(void * jarg1) {
+ unsigned long jresult ;
+ switch_chat_application_interface *arg1 = (switch_chat_application_interface *) 0 ;
+ uint32_t result;
+
+ arg1 = (switch_chat_application_interface *)jarg1;
+ result = (uint32_t) ((arg1)->flags);
+ jresult = (unsigned long)result;
+ return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_chat_application_interface_rwlock_set(void * jarg1, void * jarg2) {
+ switch_chat_application_interface *arg1 = (switch_chat_application_interface *) 0 ;
+ switch_thread_rwlock_t *arg2 = (switch_thread_rwlock_t *) 0 ;
+
+ arg1 = (switch_chat_application_interface *)jarg1;
+ arg2 = (switch_thread_rwlock_t *)jarg2;
+ if (arg1) (arg1)->rwlock = arg2;
+
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_switch_chat_application_interface_rwlock_get(void * jarg1) {
+ void * jresult ;
+ switch_chat_application_interface *arg1 = (switch_chat_application_interface *) 0 ;
+ switch_thread_rwlock_t *result = 0 ;
+
+ arg1 = (switch_chat_application_interface *)jarg1;
+ result = (switch_thread_rwlock_t *) ((arg1)->rwlock);
+ jresult = (void *)result;
+ return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_chat_application_interface_refs_set(void * jarg1, int jarg2) {
+ switch_chat_application_interface *arg1 = (switch_chat_application_interface *) 0 ;
+ int arg2 ;
+
+ arg1 = (switch_chat_application_interface *)jarg1;
+ arg2 = (int)jarg2;
+ if (arg1) (arg1)->refs = arg2;
+
+}
+
+
+SWIGEXPORT int SWIGSTDCALL CSharp_switch_chat_application_interface_refs_get(void * jarg1) {
+ int jresult ;
+ switch_chat_application_interface *arg1 = (switch_chat_application_interface *) 0 ;
+ int result;
+
+ arg1 = (switch_chat_application_interface *)jarg1;
+ result = (int) ((arg1)->refs);
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_chat_application_interface_reflock_set(void * jarg1, void * jarg2) {
+ switch_chat_application_interface *arg1 = (switch_chat_application_interface *) 0 ;
+ switch_mutex_t *arg2 = (switch_mutex_t *) 0 ;
+
+ arg1 = (switch_chat_application_interface *)jarg1;
+ arg2 = (switch_mutex_t *)jarg2;
+ if (arg1) (arg1)->reflock = arg2;
+
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_switch_chat_application_interface_reflock_get(void * jarg1) {
+ void * jresult ;
+ switch_chat_application_interface *arg1 = (switch_chat_application_interface *) 0 ;
+ switch_mutex_t *result = 0 ;
+
+ arg1 = (switch_chat_application_interface *)jarg1;
+ result = (switch_mutex_t *) ((arg1)->reflock);
+ jresult = (void *)result;
+ return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_chat_application_interface_parent_set(void * jarg1, void * jarg2) {
+ switch_chat_application_interface *arg1 = (switch_chat_application_interface *) 0 ;
+ switch_loadable_module_interface_t *arg2 = (switch_loadable_module_interface_t *) 0 ;
+
+ arg1 = (switch_chat_application_interface *)jarg1;
+ arg2 = (switch_loadable_module_interface_t *)jarg2;
+ if (arg1) (arg1)->parent = arg2;
+
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_switch_chat_application_interface_parent_get(void * jarg1) {
+ void * jresult ;
+ switch_chat_application_interface *arg1 = (switch_chat_application_interface *) 0 ;
+ switch_loadable_module_interface_t *result = 0 ;
+
+ arg1 = (switch_chat_application_interface *)jarg1;
+ result = (switch_loadable_module_interface_t *) ((arg1)->parent);
+ jresult = (void *)result;
+ return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_switch_chat_application_interface_next_set(void * jarg1, void * jarg2) {
+ switch_chat_application_interface *arg1 = (switch_chat_application_interface *) 0 ;
+ switch_chat_application_interface *arg2 = (switch_chat_application_interface *) 0 ;
+
+ arg1 = (switch_chat_application_interface *)jarg1;
+ arg2 = (switch_chat_application_interface *)jarg2;
+ if (arg1) (arg1)->next = arg2;
+
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_switch_chat_application_interface_next_get(void * jarg1) {
+ void * jresult ;
+ switch_chat_application_interface *arg1 = (switch_chat_application_interface *) 0 ;
+ switch_chat_application_interface *result = 0 ;
+
+ arg1 = (switch_chat_application_interface *)jarg1;
+ result = (switch_chat_application_interface *) ((arg1)->next);
+ jresult = (void *)result;
+ return jresult;
+}
+
+
+SWIGEXPORT void * SWIGSTDCALL CSharp_new_switch_chat_application_interface() {
+ void * jresult ;
+ switch_chat_application_interface *result = 0 ;
+
+ result = (switch_chat_application_interface *)new switch_chat_application_interface();
+ jresult = (void *)result;
+ return jresult;
+}
+
+
+SWIGEXPORT void SWIGSTDCALL CSharp_delete_switch_chat_application_interface(void * jarg1) {
+ switch_chat_application_interface *arg1 = (switch_chat_application_interface *) 0 ;
+
+ arg1 = (switch_chat_application_interface *)jarg1;
+ delete arg1;
+
+}
+
+
SWIGEXPORT void SWIGSTDCALL CSharp_switch_api_interface_interface_name_set(void * jarg1, char * jarg2) {
switch_api_interface *arg1 = (switch_api_interface *) 0 ;
char *arg2 = (char *) 0 ;
}
+SWIGEXPORT int SWIGSTDCALL CSharp_switch_event_rename_header(void * jarg1, char * jarg2, char * jarg3) {
+ int jresult ;
+ switch_event_t *arg1 = (switch_event_t *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) 0 ;
+ switch_status_t result;
+
+ arg1 = (switch_event_t *)jarg1;
+ arg2 = (char *)jarg2;
+ arg3 = (char *)jarg3;
+ result = (switch_status_t)switch_event_rename_header(arg1,(char const *)arg2,(char const *)arg3);
+ jresult = result;
+ return jresult;
+}
+
+
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_event_get_body(void * jarg1) {
char * jresult ;
switch_event_t *arg1 = (switch_event_t *) 0 ;
}
+SWIGEXPORT int SWIGSTDCALL CSharp_switch_event_dup_reply(void * jarg1, void * jarg2) {
+ int jresult ;
+ switch_event_t **arg1 = (switch_event_t **) 0 ;
+ switch_event_t *arg2 = (switch_event_t *) 0 ;
+ switch_status_t result;
+
+ arg1 = (switch_event_t **)jarg1;
+ arg2 = (switch_event_t *)jarg2;
+ result = (switch_status_t)switch_event_dup_reply(arg1,arg2);
+ jresult = result;
+ return jresult;
+}
+
+
SWIGEXPORT int SWIGSTDCALL CSharp_switch_event_fire_detailed(char * jarg1, char * jarg2, int jarg3, void * jarg4, void * jarg5) {
int jresult ;
char *arg1 = (char *) 0 ;
}
+SWIGEXPORT int SWIGSTDCALL CSharp_switch_event_set_body(void * jarg1, char * jarg2) {
+ int jresult ;
+ switch_event_t *arg1 = (switch_event_t *) 0 ;
+ char *arg2 = (char *) 0 ;
+ switch_status_t result;
+
+ arg1 = (switch_event_t *)jarg1;
+ arg2 = (char *)jarg2;
+ result = (switch_status_t)switch_event_set_body(arg1,(char const *)arg2);
+ jresult = result;
+ return jresult;
+}
+
+
SWIGEXPORT char * SWIGSTDCALL CSharp_switch_event_expand_headers(void * jarg1, char * jarg2) {
char * jresult ;
switch_event_t *arg1 = (switch_event_t *) 0 ;
}
+SWIGEXPORT int SWIGSTDCALL CSharp_switch_ivr_create_message_reply(void * jarg1, void * jarg2, char * jarg3) {
+ int jresult ;
+ switch_event_t **arg1 = (switch_event_t **) 0 ;
+ switch_event_t *arg2 = (switch_event_t *) 0 ;
+ char *arg3 = (char *) 0 ;
+ switch_status_t result;
+
+ arg1 = (switch_event_t **)jarg1;
+ arg2 = (switch_event_t *)jarg2;
+ arg3 = (char *)jarg3;
+ result = (switch_status_t)switch_ivr_create_message_reply(arg1,arg2,(char const *)arg3);
+ jresult = result;
+ return jresult;
+}
+
+
SWIGEXPORT int SWIGSTDCALL CSharp_SWITCH_RTP_MAX_BUF_LEN_get() {
int jresult ;
int result;
}
+SWIGEXPORT int SWIGSTDCALL CSharp_Event_chat_execute(void * jarg1, char * jarg2, char * jarg3) {
+ int jresult ;
+ Event *arg1 = (Event *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) NULL ;
+ int result;
+
+ arg1 = (Event *)jarg1;
+ arg2 = (char *)jarg2;
+ arg3 = (char *)jarg3;
+ result = (int)(arg1)->chat_execute((char const *)arg2,(char const *)arg3);
+ jresult = result;
+ return jresult;
+}
+
+
+SWIGEXPORT int SWIGSTDCALL CSharp_Event_chat_send(void * jarg1, char * jarg2) {
+ int jresult ;
+ Event *arg1 = (Event *) 0 ;
+ char *arg2 = (char *) NULL ;
+ int result;
+
+ arg1 = (Event *)jarg1;
+ arg2 = (char *)jarg2;
+ result = (int)(arg1)->chat_send((char const *)arg2);
+ jresult = result;
+ return jresult;
+}
+
+
SWIGEXPORT char * SWIGSTDCALL CSharp_Event_Serialize(void * jarg1, char * jarg2) {
char * jresult ;
Event *arg1 = (Event *) 0 ;
using System;
using System.Runtime.InteropServices;
-public partial class Event : IDisposable {
+public class EventConsumer : IDisposable {
private HandleRef swigCPtr;
protected bool swigCMemOwn;
- internal Event(IntPtr cPtr, bool cMemoryOwn) {
+ internal EventConsumer(IntPtr cPtr, bool cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = new HandleRef(this, cPtr);
}
- internal static HandleRef getCPtr(Event obj) {
+ internal static HandleRef getCPtr(EventConsumer obj) {
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
}
- ~Event() {
+ ~EventConsumer() {
Dispose();
}
lock(this) {
if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) {
swigCMemOwn = false;
- freeswitchPINVOKE.delete_Event(swigCPtr);
+ freeswitchPINVOKE.delete_EventConsumer(swigCPtr);
}
swigCPtr = new HandleRef(null, IntPtr.Zero);
GC.SuppressFinalize(this);
}
}
- public switch_event InternalEvent {
+ public SWIGTYPE_p_switch_queue_t events {
set {
- freeswitchPINVOKE.Event_InternalEvent_set(swigCPtr, switch_event.getCPtr(value));
+ freeswitchPINVOKE.EventConsumer_events_set(swigCPtr, SWIGTYPE_p_switch_queue_t.getCPtr(value));
}
get {
- IntPtr cPtr = freeswitchPINVOKE.Event_InternalEvent_get(swigCPtr);
- switch_event ret = (cPtr == IntPtr.Zero) ? null : new switch_event(cPtr, false);
+ IntPtr cPtr = freeswitchPINVOKE.EventConsumer_events_get(swigCPtr);
+ SWIGTYPE_p_switch_queue_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_queue_t(cPtr, false);
return ret;
}
}
- public string serialized_string {
+ public switch_event_types_t e_event_id {
set {
- freeswitchPINVOKE.Event_serialized_string_set(swigCPtr, value);
+ freeswitchPINVOKE.EventConsumer_e_event_id_set(swigCPtr, (int)value);
}
get {
- string ret = freeswitchPINVOKE.Event_serialized_string_get(swigCPtr);
+ switch_event_types_t ret = (switch_event_types_t)freeswitchPINVOKE.EventConsumer_e_event_id_get(swigCPtr);
return ret;
}
}
- public int mine {
+ public string e_callback {
set {
- freeswitchPINVOKE.Event_mine_set(swigCPtr, value);
+ freeswitchPINVOKE.EventConsumer_e_callback_set(swigCPtr, value);
}
get {
- int ret = freeswitchPINVOKE.Event_mine_get(swigCPtr);
+ string ret = freeswitchPINVOKE.EventConsumer_e_callback_get(swigCPtr);
return ret;
}
}
- public Event(string type, string subclass_name) : this(freeswitchPINVOKE.new_Event__SWIG_0(type, subclass_name), true) {
- }
-
- public Event(switch_event wrap_me, int free_me) : this(freeswitchPINVOKE.new_Event__SWIG_1(switch_event.getCPtr(wrap_me), free_me), true) {
- }
-
- public string Serialize(string format) {
- string ret = freeswitchPINVOKE.Event_Serialize(swigCPtr, format);
- return ret;
- }
-
- public bool SetPriority(switch_priority_t priority) {
- bool ret = freeswitchPINVOKE.Event_SetPriority(swigCPtr, (int)priority);
- return ret;
- }
-
- public string GetHeader(string header_name) {
- string ret = freeswitchPINVOKE.Event_GetHeader(swigCPtr, header_name);
- return ret;
+ public string e_subclass_name {
+ set {
+ freeswitchPINVOKE.EventConsumer_e_subclass_name_set(swigCPtr, value);
+ }
+ get {
+ string ret = freeswitchPINVOKE.EventConsumer_e_subclass_name_get(swigCPtr);
+ return ret;
+ }
}
- public string GetBody() {
- string ret = freeswitchPINVOKE.Event_GetBody(swigCPtr);
- return ret;
+ public string e_cb_arg {
+ set {
+ freeswitchPINVOKE.EventConsumer_e_cb_arg_set(swigCPtr, value);
+ }
+ get {
+ string ret = freeswitchPINVOKE.EventConsumer_e_cb_arg_get(swigCPtr);
+ return ret;
+ }
}
- public string GetEventType() {
- string ret = freeswitchPINVOKE.Event_GetEventType(swigCPtr);
- return ret;
+ public SWIGTYPE_p_p_switch_event_node enodes {
+ set {
+ freeswitchPINVOKE.EventConsumer_enodes_set(swigCPtr, SWIGTYPE_p_p_switch_event_node.getCPtr(value));
+ }
+ get {
+ IntPtr cPtr = freeswitchPINVOKE.EventConsumer_enodes_get(swigCPtr);
+ SWIGTYPE_p_p_switch_event_node ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_p_switch_event_node(cPtr, false);
+ return ret;
+ }
}
- public bool AddBody(string value) {
- bool ret = freeswitchPINVOKE.Event_AddBody(swigCPtr, value);
- return ret;
+ public uint node_index {
+ set {
+ freeswitchPINVOKE.EventConsumer_node_index_set(swigCPtr, value);
+ }
+ get {
+ uint ret = freeswitchPINVOKE.EventConsumer_node_index_get(swigCPtr);
+ return ret;
+ }
}
- public bool AddHeader(string header_name, string value) {
- bool ret = freeswitchPINVOKE.Event_AddHeader(swigCPtr, header_name, value);
- return ret;
+ public EventConsumer(string event_name, string subclass_name) : this(freeswitchPINVOKE.new_EventConsumer(event_name, subclass_name), true) {
}
- public bool DeleteHeader(string header_name) {
- bool ret = freeswitchPINVOKE.Event_DeleteHeader(swigCPtr, header_name);
+ public int bind(string event_name, string subclass_name) {
+ int ret = freeswitchPINVOKE.EventConsumer_bind(swigCPtr, event_name, subclass_name);
return ret;
}
- public bool Fire() {
- bool ret = freeswitchPINVOKE.Event_Fire(swigCPtr);
+ public Event pop(int block) {
+ IntPtr cPtr = freeswitchPINVOKE.EventConsumer_pop(swigCPtr, block);
+ Event ret = (cPtr == IntPtr.Zero) ? null : new Event(cPtr, true);
return ret;
}
using System;
using System.Runtime.InteropServices;
-public class EventConsumer : IDisposable {
+public partial class Event : IDisposable {
private HandleRef swigCPtr;
protected bool swigCMemOwn;
- internal EventConsumer(IntPtr cPtr, bool cMemoryOwn) {
+ internal Event(IntPtr cPtr, bool cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = new HandleRef(this, cPtr);
}
- internal static HandleRef getCPtr(EventConsumer obj) {
+ internal static HandleRef getCPtr(Event obj) {
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
}
- ~EventConsumer() {
+ ~Event() {
Dispose();
}
lock(this) {
if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) {
swigCMemOwn = false;
- freeswitchPINVOKE.delete_EventConsumer(swigCPtr);
+ freeswitchPINVOKE.delete_Event(swigCPtr);
}
swigCPtr = new HandleRef(null, IntPtr.Zero);
GC.SuppressFinalize(this);
}
}
- public SWIGTYPE_p_switch_queue_t events {
+ public switch_event InternalEvent {
set {
- freeswitchPINVOKE.EventConsumer_events_set(swigCPtr, SWIGTYPE_p_switch_queue_t.getCPtr(value));
+ freeswitchPINVOKE.Event_InternalEvent_set(swigCPtr, switch_event.getCPtr(value));
}
get {
- IntPtr cPtr = freeswitchPINVOKE.EventConsumer_events_get(swigCPtr);
- SWIGTYPE_p_switch_queue_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_queue_t(cPtr, false);
+ IntPtr cPtr = freeswitchPINVOKE.Event_InternalEvent_get(swigCPtr);
+ switch_event ret = (cPtr == IntPtr.Zero) ? null : new switch_event(cPtr, false);
return ret;
}
}
- public switch_event_types_t e_event_id {
+ public string serialized_string {
set {
- freeswitchPINVOKE.EventConsumer_e_event_id_set(swigCPtr, (int)value);
+ freeswitchPINVOKE.Event_serialized_string_set(swigCPtr, value);
}
get {
- switch_event_types_t ret = (switch_event_types_t)freeswitchPINVOKE.EventConsumer_e_event_id_get(swigCPtr);
+ string ret = freeswitchPINVOKE.Event_serialized_string_get(swigCPtr);
return ret;
}
}
- public string e_callback {
+ public int mine {
set {
- freeswitchPINVOKE.EventConsumer_e_callback_set(swigCPtr, value);
+ freeswitchPINVOKE.Event_mine_set(swigCPtr, value);
}
get {
- string ret = freeswitchPINVOKE.EventConsumer_e_callback_get(swigCPtr);
+ int ret = freeswitchPINVOKE.Event_mine_get(swigCPtr);
return ret;
}
}
- public string e_subclass_name {
- set {
- freeswitchPINVOKE.EventConsumer_e_subclass_name_set(swigCPtr, value);
- }
- get {
- string ret = freeswitchPINVOKE.EventConsumer_e_subclass_name_get(swigCPtr);
- return ret;
- }
+ public Event(string type, string subclass_name) : this(freeswitchPINVOKE.new_Event__SWIG_0(type, subclass_name), true) {
}
- public string e_cb_arg {
- set {
- freeswitchPINVOKE.EventConsumer_e_cb_arg_set(swigCPtr, value);
- }
- get {
- string ret = freeswitchPINVOKE.EventConsumer_e_cb_arg_get(swigCPtr);
- return ret;
- }
+ public Event(switch_event wrap_me, int free_me) : this(freeswitchPINVOKE.new_Event__SWIG_1(switch_event.getCPtr(wrap_me), free_me), true) {
}
- public SWIGTYPE_p_p_switch_event_node enodes {
- set {
- freeswitchPINVOKE.EventConsumer_enodes_set(swigCPtr, SWIGTYPE_p_p_switch_event_node.getCPtr(value));
- }
- get {
- IntPtr cPtr = freeswitchPINVOKE.EventConsumer_enodes_get(swigCPtr);
- SWIGTYPE_p_p_switch_event_node ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_p_switch_event_node(cPtr, false);
- return ret;
- }
+ public int chat_execute(string app, string data) {
+ int ret = freeswitchPINVOKE.Event_chat_execute(swigCPtr, app, data);
+ return ret;
}
- public uint node_index {
- set {
- freeswitchPINVOKE.EventConsumer_node_index_set(swigCPtr, value);
- }
- get {
- uint ret = freeswitchPINVOKE.EventConsumer_node_index_get(swigCPtr);
- return ret;
- }
+ public int chat_send(string dest_proto) {
+ int ret = freeswitchPINVOKE.Event_chat_send(swigCPtr, dest_proto);
+ return ret;
}
- public EventConsumer(string event_name, string subclass_name) : this(freeswitchPINVOKE.new_EventConsumer(event_name, subclass_name), true) {
+ public string Serialize(string format) {
+ string ret = freeswitchPINVOKE.Event_Serialize(swigCPtr, format);
+ return ret;
}
- public int bind(string event_name, string subclass_name) {
- int ret = freeswitchPINVOKE.EventConsumer_bind(swigCPtr, event_name, subclass_name);
+ public bool SetPriority(switch_priority_t priority) {
+ bool ret = freeswitchPINVOKE.Event_SetPriority(swigCPtr, (int)priority);
return ret;
}
- public Event pop(int block) {
- IntPtr cPtr = freeswitchPINVOKE.EventConsumer_pop(swigCPtr, block);
- Event ret = (cPtr == IntPtr.Zero) ? null : new Event(cPtr, true);
+ public string GetHeader(string header_name) {
+ string ret = freeswitchPINVOKE.Event_GetHeader(swigCPtr, header_name);
+ return ret;
+ }
+
+ public string GetBody() {
+ string ret = freeswitchPINVOKE.Event_GetBody(swigCPtr);
+ return ret;
+ }
+
+ public string GetEventType() {
+ string ret = freeswitchPINVOKE.Event_GetEventType(swigCPtr);
+ return ret;
+ }
+
+ public bool AddBody(string value) {
+ bool ret = freeswitchPINVOKE.Event_AddBody(swigCPtr, value);
+ return ret;
+ }
+
+ public bool AddHeader(string header_name, string value) {
+ bool ret = freeswitchPINVOKE.Event_AddHeader(swigCPtr, header_name, value);
+ return ret;
+ }
+
+ public bool DeleteHeader(string header_name) {
+ bool ret = freeswitchPINVOKE.Event_DeleteHeader(swigCPtr, header_name);
+ return ret;
+ }
+
+ public bool Fire() {
+ bool ret = freeswitchPINVOKE.Event_Fire(swigCPtr);
return ret;
}
freeswitchPINVOKE.switch_regex_set_var_callback(var, val, SWIGTYPE_p_void.getCPtr(user_data));
}
+ public static void switch_regex_set_event_header_callback(string var, string val, SWIGTYPE_p_void user_data) {
+ freeswitchPINVOKE.switch_regex_set_event_header_callback(var, val, SWIGTYPE_p_void.getCPtr(user_data));
+ }
+
public static void switch_core_session_sched_heartbeat(SWIGTYPE_p_switch_core_session session, uint seconds) {
freeswitchPINVOKE.switch_core_session_sched_heartbeat(SWIGTYPE_p_switch_core_session.getCPtr(session), seconds);
}
return ret;
}
+ public static switch_status_t switch_core_chat_deliver(string dest_proto, SWIGTYPE_p_p_switch_event message_event) {
+ switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_chat_deliver(dest_proto, SWIGTYPE_p_p_switch_event.getCPtr(message_event));
+ return ret;
+ }
+
public static switch_status_t switch_ivr_preprocess_session(SWIGTYPE_p_switch_core_session session, string cmds) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_preprocess_session(SWIGTYPE_p_switch_core_session.getCPtr(session), cmds);
return ret;
return ret;
}
+ public static switch_chat_application_interface switch_loadable_module_get_chat_application_interface(string name) {
+ IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_chat_application_interface(name);
+ switch_chat_application_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_chat_application_interface(cPtr, false);
+ return ret;
+ }
+
+ public static switch_status_t switch_core_execute_chat_app(switch_event message, string app, string data) {
+ switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_core_execute_chat_app(switch_event.getCPtr(message), app, data);
+ return ret;
+ }
+
public static switch_api_interface switch_loadable_module_get_api_interface(string name) {
IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_get_api_interface(name);
switch_api_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_api_interface(cPtr, false);
return ret;
}
+ public static switch_status_t switch_event_rename_header(switch_event arg0, string header_name, string new_header_name) {
+ switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_event_rename_header(switch_event.getCPtr(arg0), header_name, new_header_name);
+ return ret;
+ }
+
public static string switch_event_get_body(switch_event arg0) {
string ret = freeswitchPINVOKE.switch_event_get_body(switch_event.getCPtr(arg0));
return ret;
freeswitchPINVOKE.switch_event_merge(switch_event.getCPtr(arg0), switch_event.getCPtr(tomerge));
}
+ public static switch_status_t switch_event_dup_reply(SWIGTYPE_p_p_switch_event arg0, switch_event todup) {
+ switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_event_dup_reply(SWIGTYPE_p_p_switch_event.getCPtr(arg0), switch_event.getCPtr(todup));
+ return ret;
+ }
+
public static switch_status_t switch_event_fire_detailed(string file, string func, int line, SWIGTYPE_p_p_switch_event arg3, SWIGTYPE_p_void user_data) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_event_fire_detailed(file, func, line, SWIGTYPE_p_p_switch_event.getCPtr(arg3), SWIGTYPE_p_void.getCPtr(user_data));
return ret;
return ret;
}
+ public static switch_status_t switch_event_set_body(switch_event arg0, string body) {
+ switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_event_set_body(switch_event.getCPtr(arg0), body);
+ return ret;
+ }
+
public static string switch_event_expand_headers(switch_event arg0, string arg1) {
string ret = freeswitchPINVOKE.switch_event_expand_headers(switch_event.getCPtr(arg0), arg1);
return ret;
return ret;
}
+ public static switch_status_t switch_ivr_create_message_reply(SWIGTYPE_p_p_switch_event reply, switch_event message, string new_proto) {
+ switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_ivr_create_message_reply(SWIGTYPE_p_p_switch_event.getCPtr(reply), switch_event.getCPtr(message), new_proto);
+ return ret;
+ }
+
public static switch_status_t switch_rtp_add_crypto_key(SWIGTYPE_p_switch_rtp rtp_session, switch_rtp_crypto_direction_t direction, uint index, switch_rtp_crypto_key_type_t type, SWIGTYPE_p_unsigned_char key, SWIGTYPE_p_switch_size_t keylen) {
switch_status_t ret = (switch_status_t)freeswitchPINVOKE.switch_rtp_add_crypto_key(SWIGTYPE_p_switch_rtp.getCPtr(rtp_session), (int)direction, index, (int)type, SWIGTYPE_p_unsigned_char.getCPtr(key), SWIGTYPE_p_switch_size_t.getCPtr(keylen));
if (freeswitchPINVOKE.SWIGPendingException.Pending) throw freeswitchPINVOKE.SWIGPendingException.Retrieve();
[DllImport("mod_managed", EntryPoint="CSharp_switch_regex_set_var_callback")]
public static extern void switch_regex_set_var_callback(string jarg1, string jarg2, HandleRef jarg3);
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_regex_set_event_header_callback")]
+ public static extern void switch_regex_set_event_header_callback(string jarg1, string jarg2, HandleRef jarg3);
+
[DllImport("mod_managed", EntryPoint="CSharp_SWITCH_MAX_CORE_THREAD_SESSION_OBJS_get")]
public static extern int SWITCH_MAX_CORE_THREAD_SESSION_OBJS_get();
[DllImport("mod_managed", EntryPoint="CSharp_switch_core_chat_send")]
public static extern int switch_core_chat_send(string jarg1, HandleRef jarg2);
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_core_chat_deliver")]
+ public static extern int switch_core_chat_deliver(string jarg1, HandleRef jarg2);
+
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_preprocess_session")]
public static extern int switch_ivr_preprocess_session(HandleRef jarg1, string jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_application_interface_get")]
public static extern IntPtr switch_loadable_module_interface_application_interface_get(HandleRef jarg1);
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_chat_application_interface_set")]
+ public static extern void switch_loadable_module_interface_chat_application_interface_set(HandleRef jarg1, HandleRef jarg2);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_chat_application_interface_get")]
+ public static extern IntPtr switch_loadable_module_interface_chat_application_interface_get(HandleRef jarg1);
+
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_interface_api_interface_set")]
public static extern void switch_loadable_module_interface_api_interface_set(HandleRef jarg1, HandleRef jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_application_interface")]
public static extern IntPtr switch_loadable_module_get_application_interface(string jarg1);
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_chat_application_interface")]
+ public static extern IntPtr switch_loadable_module_get_chat_application_interface(string jarg1);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_core_execute_chat_app")]
+ public static extern int switch_core_execute_chat_app(HandleRef jarg1, string jarg2, string jarg3);
+
[DllImport("mod_managed", EntryPoint="CSharp_switch_loadable_module_get_api_interface")]
public static extern IntPtr switch_loadable_module_get_api_interface(string jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_delete_switch_application_interface")]
public static extern void delete_switch_application_interface(HandleRef jarg1);
- [DllImport("mod_managed", EntryPoint="CSharp_switch_api_interface_interface_name_set")]
- public static extern void switch_api_interface_interface_name_set(HandleRef jarg1, string jarg2);
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_chat_application_interface_interface_name_set")]
+ public static extern void switch_chat_application_interface_interface_name_set(HandleRef jarg1, string jarg2);
- [DllImport("mod_managed", EntryPoint="CSharp_switch_api_interface_interface_name_get")]
- public static extern string switch_api_interface_interface_name_get(HandleRef jarg1);
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_chat_application_interface_interface_name_get")]
+ public static extern string switch_chat_application_interface_interface_name_get(HandleRef jarg1);
- [DllImport("mod_managed", EntryPoint="CSharp_switch_api_interface_desc_set")]
- public static extern void switch_api_interface_desc_set(HandleRef jarg1, string jarg2);
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_chat_application_interface_chat_application_function_set")]
+ public static extern void switch_chat_application_interface_chat_application_function_set(HandleRef jarg1, HandleRef jarg2);
- [DllImport("mod_managed", EntryPoint="CSharp_switch_api_interface_desc_get")]
- public static extern string switch_api_interface_desc_get(HandleRef jarg1);
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_chat_application_interface_chat_application_function_get")]
+ public static extern IntPtr switch_chat_application_interface_chat_application_function_get(HandleRef jarg1);
- [DllImport("mod_managed", EntryPoint="CSharp_switch_api_interface_function_set")]
- public static extern void switch_api_interface_function_set(HandleRef jarg1, HandleRef jarg2);
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_chat_application_interface_long_desc_set")]
+ public static extern void switch_chat_application_interface_long_desc_set(HandleRef jarg1, string jarg2);
- [DllImport("mod_managed", EntryPoint="CSharp_switch_api_interface_function_get")]
- public static extern IntPtr switch_api_interface_function_get(HandleRef jarg1);
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_chat_application_interface_long_desc_get")]
+ public static extern string switch_chat_application_interface_long_desc_get(HandleRef jarg1);
- [DllImport("mod_managed", EntryPoint="CSharp_switch_api_interface_syntax_set")]
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_chat_application_interface_short_desc_set")]
+ public static extern void switch_chat_application_interface_short_desc_set(HandleRef jarg1, string jarg2);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_chat_application_interface_short_desc_get")]
+ public static extern string switch_chat_application_interface_short_desc_get(HandleRef jarg1);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_chat_application_interface_syntax_set")]
+ public static extern void switch_chat_application_interface_syntax_set(HandleRef jarg1, string jarg2);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_chat_application_interface_syntax_get")]
+ public static extern string switch_chat_application_interface_syntax_get(HandleRef jarg1);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_chat_application_interface_flags_set")]
+ public static extern void switch_chat_application_interface_flags_set(HandleRef jarg1, uint jarg2);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_chat_application_interface_flags_get")]
+ public static extern uint switch_chat_application_interface_flags_get(HandleRef jarg1);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_chat_application_interface_rwlock_set")]
+ public static extern void switch_chat_application_interface_rwlock_set(HandleRef jarg1, HandleRef jarg2);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_chat_application_interface_rwlock_get")]
+ public static extern IntPtr switch_chat_application_interface_rwlock_get(HandleRef jarg1);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_chat_application_interface_refs_set")]
+ public static extern void switch_chat_application_interface_refs_set(HandleRef jarg1, int jarg2);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_chat_application_interface_refs_get")]
+ public static extern int switch_chat_application_interface_refs_get(HandleRef jarg1);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_chat_application_interface_reflock_set")]
+ public static extern void switch_chat_application_interface_reflock_set(HandleRef jarg1, HandleRef jarg2);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_chat_application_interface_reflock_get")]
+ public static extern IntPtr switch_chat_application_interface_reflock_get(HandleRef jarg1);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_chat_application_interface_parent_set")]
+ public static extern void switch_chat_application_interface_parent_set(HandleRef jarg1, HandleRef jarg2);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_chat_application_interface_parent_get")]
+ public static extern IntPtr switch_chat_application_interface_parent_get(HandleRef jarg1);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_chat_application_interface_next_set")]
+ public static extern void switch_chat_application_interface_next_set(HandleRef jarg1, HandleRef jarg2);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_chat_application_interface_next_get")]
+ public static extern IntPtr switch_chat_application_interface_next_get(HandleRef jarg1);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_new_switch_chat_application_interface")]
+ public static extern IntPtr new_switch_chat_application_interface();
+
+ [DllImport("mod_managed", EntryPoint="CSharp_delete_switch_chat_application_interface")]
+ public static extern void delete_switch_chat_application_interface(HandleRef jarg1);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_api_interface_interface_name_set")]
+ public static extern void switch_api_interface_interface_name_set(HandleRef jarg1, string jarg2);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_api_interface_interface_name_get")]
+ public static extern string switch_api_interface_interface_name_get(HandleRef jarg1);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_api_interface_desc_set")]
+ public static extern void switch_api_interface_desc_set(HandleRef jarg1, string jarg2);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_api_interface_desc_get")]
+ public static extern string switch_api_interface_desc_get(HandleRef jarg1);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_api_interface_function_set")]
+ public static extern void switch_api_interface_function_set(HandleRef jarg1, HandleRef jarg2);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_api_interface_function_get")]
+ public static extern IntPtr switch_api_interface_function_get(HandleRef jarg1);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_api_interface_syntax_set")]
public static extern void switch_api_interface_syntax_set(HandleRef jarg1, string jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_api_interface_syntax_get")]
[DllImport("mod_managed", EntryPoint="CSharp_switch_event_get_header_idx")]
public static extern string switch_event_get_header_idx(HandleRef jarg1, string jarg2, int jarg3);
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_event_rename_header")]
+ public static extern int switch_event_rename_header(HandleRef jarg1, string jarg2, string jarg3);
+
[DllImport("mod_managed", EntryPoint="CSharp_switch_event_get_body")]
public static extern string switch_event_get_body(HandleRef jarg1);
[DllImport("mod_managed", EntryPoint="CSharp_switch_event_merge")]
public static extern void switch_event_merge(HandleRef jarg1, HandleRef jarg2);
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_event_dup_reply")]
+ public static extern int switch_event_dup_reply(HandleRef jarg1, HandleRef jarg2);
+
[DllImport("mod_managed", EntryPoint="CSharp_switch_event_fire_detailed")]
public static extern int switch_event_fire_detailed(string jarg1, string jarg2, int jarg3, HandleRef jarg4, HandleRef jarg5);
[DllImport("mod_managed", EntryPoint="CSharp_switch_event_running")]
public static extern int switch_event_running();
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_event_set_body")]
+ public static extern int switch_event_set_body(HandleRef jarg1, string jarg2);
+
[DllImport("mod_managed", EntryPoint="CSharp_switch_event_expand_headers")]
public static extern string switch_event_expand_headers(HandleRef jarg1, string jarg2);
[DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_insert_file")]
public static extern int switch_ivr_insert_file(HandleRef jarg1, string jarg2, string jarg3, HandleRef jarg4);
+ [DllImport("mod_managed", EntryPoint="CSharp_switch_ivr_create_message_reply")]
+ public static extern int switch_ivr_create_message_reply(HandleRef jarg1, HandleRef jarg2, string jarg3);
+
[DllImport("mod_managed", EntryPoint="CSharp_SWITCH_RTP_MAX_BUF_LEN_get")]
public static extern int SWITCH_RTP_MAX_BUF_LEN_get();
[DllImport("mod_managed", EntryPoint="CSharp_delete_Event")]
public static extern void delete_Event(HandleRef jarg1);
+ [DllImport("mod_managed", EntryPoint="CSharp_Event_chat_execute")]
+ public static extern int Event_chat_execute(HandleRef jarg1, string jarg2, string jarg3);
+
+ [DllImport("mod_managed", EntryPoint="CSharp_Event_chat_send")]
+ public static extern int Event_chat_send(HandleRef jarg1, string jarg2);
+
[DllImport("mod_managed", EntryPoint="CSharp_Event_Serialize")]
public static extern string Event_Serialize(HandleRef jarg1, string jarg2);
using System;
using System.Runtime.InteropServices;
-public class SWIGTYPE_p_f_p_switch_codec_unsigned_long_p_q_const__switch_codec_settings__switch_status_t {
+public class SWIGTYPE_p_f_p_switch_codec__switch_status_t {
private HandleRef swigCPtr;
- internal SWIGTYPE_p_f_p_switch_codec_unsigned_long_p_q_const__switch_codec_settings__switch_status_t(IntPtr cPtr, bool futureUse) {
+ internal SWIGTYPE_p_f_p_switch_codec__switch_status_t(IntPtr cPtr, bool futureUse) {
swigCPtr = new HandleRef(this, cPtr);
}
- protected SWIGTYPE_p_f_p_switch_codec_unsigned_long_p_q_const__switch_codec_settings__switch_status_t() {
+ protected SWIGTYPE_p_f_p_switch_codec__switch_status_t() {
swigCPtr = new HandleRef(null, IntPtr.Zero);
}
- internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_codec_unsigned_long_p_q_const__switch_codec_settings__switch_status_t obj) {
+ internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_codec__switch_status_t obj) {
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
}
}
using System;
using System.Runtime.InteropServices;
-public class SWIGTYPE_p_f_p_switch_codec__switch_status_t {
+public class SWIGTYPE_p_f_p_switch_codec_unsigned_long_p_q_const__switch_codec_settings__switch_status_t {
private HandleRef swigCPtr;
- internal SWIGTYPE_p_f_p_switch_codec__switch_status_t(IntPtr cPtr, bool futureUse) {
+ internal SWIGTYPE_p_f_p_switch_codec_unsigned_long_p_q_const__switch_codec_settings__switch_status_t(IntPtr cPtr, bool futureUse) {
swigCPtr = new HandleRef(this, cPtr);
}
- protected SWIGTYPE_p_f_p_switch_codec__switch_status_t() {
+ protected SWIGTYPE_p_f_p_switch_codec_unsigned_long_p_q_const__switch_codec_settings__switch_status_t() {
swigCPtr = new HandleRef(null, IntPtr.Zero);
}
- internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_codec__switch_status_t obj) {
+ internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_codec_unsigned_long_p_q_const__switch_codec_settings__switch_status_t obj) {
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
}
}
using System;
using System.Runtime.InteropServices;
-public class SWIGTYPE_p_f_p_switch_core_session_t_p_void_p_switch_caller_profile_t__p_switch_caller_extension {
+public class SWIGTYPE_p_f_p_switch_core_session__switch_status_t {
private HandleRef swigCPtr;
- internal SWIGTYPE_p_f_p_switch_core_session_t_p_void_p_switch_caller_profile_t__p_switch_caller_extension(IntPtr cPtr, bool futureUse) {
+ internal SWIGTYPE_p_f_p_switch_core_session__switch_status_t(IntPtr cPtr, bool futureUse) {
swigCPtr = new HandleRef(this, cPtr);
}
- protected SWIGTYPE_p_f_p_switch_core_session_t_p_void_p_switch_caller_profile_t__p_switch_caller_extension() {
+ protected SWIGTYPE_p_f_p_switch_core_session__switch_status_t() {
swigCPtr = new HandleRef(null, IntPtr.Zero);
}
- internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_t_p_void_p_switch_caller_profile_t__p_switch_caller_extension obj) {
+ internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session__switch_status_t obj) {
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
}
}
using System;
using System.Runtime.InteropServices;
-public class SWIGTYPE_p_f_p_switch_core_session__switch_status_t {
+public class SWIGTYPE_p_f_p_switch_core_session_t_p_void_p_switch_caller_profile_t__p_switch_caller_extension {
private HandleRef swigCPtr;
- internal SWIGTYPE_p_f_p_switch_core_session__switch_status_t(IntPtr cPtr, bool futureUse) {
+ internal SWIGTYPE_p_f_p_switch_core_session_t_p_void_p_switch_caller_profile_t__p_switch_caller_extension(IntPtr cPtr, bool futureUse) {
swigCPtr = new HandleRef(this, cPtr);
}
- protected SWIGTYPE_p_f_p_switch_core_session__switch_status_t() {
+ protected SWIGTYPE_p_f_p_switch_core_session_t_p_void_p_switch_caller_profile_t__p_switch_caller_extension() {
swigCPtr = new HandleRef(null, IntPtr.Zero);
}
- internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session__switch_status_t obj) {
+ internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_core_session_t_p_void_p_switch_caller_profile_t__p_switch_caller_extension obj) {
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
}
}
using System;
using System.Runtime.InteropServices;
+public class SWIGTYPE_p_f_p_switch_event_p_q_const__char__switch_status_t {
+ private HandleRef swigCPtr;
+
+ internal SWIGTYPE_p_f_p_switch_event_p_q_const__char__switch_status_t(IntPtr cPtr, bool futureUse) {
+ swigCPtr = new HandleRef(this, cPtr);
+ }
+
+ protected SWIGTYPE_p_f_p_switch_event_p_q_const__char__switch_status_t() {
+ swigCPtr = new HandleRef(null, IntPtr.Zero);
+ }
+
+ internal static HandleRef getCPtr(SWIGTYPE_p_f_p_switch_event_p_q_const__char__switch_status_t obj) {
+ return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+ }
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 1.3.35
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
public class SWIGTYPE_p_f_p_switch_event__switch_status_t {
private HandleRef swigCPtr;
using System;
using System.Runtime.InteropServices;
-public class SWIGTYPE_p_p_switch_xml {
+public class SWIGTYPE_p_p_switch_xml_binding {
private HandleRef swigCPtr;
- internal SWIGTYPE_p_p_switch_xml(IntPtr cPtr, bool futureUse) {
+ internal SWIGTYPE_p_p_switch_xml_binding(IntPtr cPtr, bool futureUse) {
swigCPtr = new HandleRef(this, cPtr);
}
- protected SWIGTYPE_p_p_switch_xml() {
+ protected SWIGTYPE_p_p_switch_xml_binding() {
swigCPtr = new HandleRef(null, IntPtr.Zero);
}
- internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_xml obj) {
+ internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_xml_binding obj) {
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
}
}
using System;
using System.Runtime.InteropServices;
-public class SWIGTYPE_p_p_switch_xml_binding {
+public class SWIGTYPE_p_p_switch_xml {
private HandleRef swigCPtr;
- internal SWIGTYPE_p_p_switch_xml_binding(IntPtr cPtr, bool futureUse) {
+ internal SWIGTYPE_p_p_switch_xml(IntPtr cPtr, bool futureUse) {
swigCPtr = new HandleRef(this, cPtr);
}
- protected SWIGTYPE_p_p_switch_xml_binding() {
+ protected SWIGTYPE_p_p_switch_xml() {
swigCPtr = new HandleRef(null, IntPtr.Zero);
}
- internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_xml_binding obj) {
+ internal static HandleRef getCPtr(SWIGTYPE_p_p_switch_xml obj) {
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
}
}
using System;
using System.Runtime.InteropServices;
-public class SWIGTYPE_p_switch_ivr_menu {
+public class SWIGTYPE_p_switch_ivr_menu_action_function_t {
private HandleRef swigCPtr;
- internal SWIGTYPE_p_switch_ivr_menu(IntPtr cPtr, bool futureUse) {
+ internal SWIGTYPE_p_switch_ivr_menu_action_function_t(IntPtr cPtr, bool futureUse) {
swigCPtr = new HandleRef(this, cPtr);
}
- protected SWIGTYPE_p_switch_ivr_menu() {
+ protected SWIGTYPE_p_switch_ivr_menu_action_function_t() {
swigCPtr = new HandleRef(null, IntPtr.Zero);
}
- internal static HandleRef getCPtr(SWIGTYPE_p_switch_ivr_menu obj) {
+ internal static HandleRef getCPtr(SWIGTYPE_p_switch_ivr_menu_action_function_t obj) {
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
}
}
using System;
using System.Runtime.InteropServices;
-public class SWIGTYPE_p_switch_ivr_menu_action_function_t {
+public class SWIGTYPE_p_switch_ivr_menu {
private HandleRef swigCPtr;
- internal SWIGTYPE_p_switch_ivr_menu_action_function_t(IntPtr cPtr, bool futureUse) {
+ internal SWIGTYPE_p_switch_ivr_menu(IntPtr cPtr, bool futureUse) {
swigCPtr = new HandleRef(this, cPtr);
}
- protected SWIGTYPE_p_switch_ivr_menu_action_function_t() {
+ protected SWIGTYPE_p_switch_ivr_menu() {
swigCPtr = new HandleRef(null, IntPtr.Zero);
}
- internal static HandleRef getCPtr(SWIGTYPE_p_switch_ivr_menu_action_function_t obj) {
+ internal static HandleRef getCPtr(SWIGTYPE_p_switch_ivr_menu obj) {
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
}
}
namespace FreeSWITCH.Native {
+public enum switch_call_cause_t {
+ SWITCH_CAUSE_NONE = 0,
+ SWITCH_CAUSE_UNALLOCATED_NUMBER = 1,
+ SWITCH_CAUSE_NO_ROUTE_TRANSIT_NET = 2,
+ SWITCH_CAUSE_NO_ROUTE_DESTINATION = 3,
+ SWITCH_CAUSE_CHANNEL_UNACCEPTABLE = 6,
+ SWITCH_CAUSE_CALL_AWARDED_DELIVERED = 7,
+ SWITCH_CAUSE_NORMAL_CLEARING = 16,
+ SWITCH_CAUSE_USER_BUSY = 17,
+ SWITCH_CAUSE_NO_USER_RESPONSE = 18,
+ SWITCH_CAUSE_NO_ANSWER = 19,
+ SWITCH_CAUSE_SUBSCRIBER_ABSENT = 20,
+ SWITCH_CAUSE_CALL_REJECTED = 21,
+ SWITCH_CAUSE_NUMBER_CHANGED = 22,
+ SWITCH_CAUSE_REDIRECTION_TO_NEW_DESTINATION = 23,
+ SWITCH_CAUSE_EXCHANGE_ROUTING_ERROR = 25,
+ SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER = 27,
+ SWITCH_CAUSE_INVALID_NUMBER_FORMAT = 28,
+ SWITCH_CAUSE_FACILITY_REJECTED = 29,
+ SWITCH_CAUSE_RESPONSE_TO_STATUS_ENQUIRY = 30,
+ SWITCH_CAUSE_NORMAL_UNSPECIFIED = 31,
+ SWITCH_CAUSE_NORMAL_CIRCUIT_CONGESTION = 34,
+ SWITCH_CAUSE_NETWORK_OUT_OF_ORDER = 38,
+ SWITCH_CAUSE_NORMAL_TEMPORARY_FAILURE = 41,
+ SWITCH_CAUSE_SWITCH_CONGESTION = 42,
+ SWITCH_CAUSE_ACCESS_INFO_DISCARDED = 43,
+ SWITCH_CAUSE_REQUESTED_CHAN_UNAVAIL = 44,
+ SWITCH_CAUSE_PRE_EMPTED = 45,
+ SWITCH_CAUSE_FACILITY_NOT_SUBSCRIBED = 50,
+ SWITCH_CAUSE_OUTGOING_CALL_BARRED = 52,
+ SWITCH_CAUSE_INCOMING_CALL_BARRED = 54,
+ SWITCH_CAUSE_BEARERCAPABILITY_NOTAUTH = 57,
+ SWITCH_CAUSE_BEARERCAPABILITY_NOTAVAIL = 58,
+ SWITCH_CAUSE_SERVICE_UNAVAILABLE = 63,
+ SWITCH_CAUSE_BEARERCAPABILITY_NOTIMPL = 65,
+ SWITCH_CAUSE_CHAN_NOT_IMPLEMENTED = 66,
+ SWITCH_CAUSE_FACILITY_NOT_IMPLEMENTED = 69,
+ SWITCH_CAUSE_SERVICE_NOT_IMPLEMENTED = 79,
+ SWITCH_CAUSE_INVALID_CALL_REFERENCE = 81,
+ SWITCH_CAUSE_INCOMPATIBLE_DESTINATION = 88,
+ SWITCH_CAUSE_INVALID_MSG_UNSPECIFIED = 95,
+ SWITCH_CAUSE_MANDATORY_IE_MISSING = 96,
+ SWITCH_CAUSE_MESSAGE_TYPE_NONEXIST = 97,
+ SWITCH_CAUSE_WRONG_MESSAGE = 98,
+ SWITCH_CAUSE_IE_NONEXIST = 99,
+ SWITCH_CAUSE_INVALID_IE_CONTENTS = 100,
+ SWITCH_CAUSE_WRONG_CALL_STATE = 101,
+ SWITCH_CAUSE_RECOVERY_ON_TIMER_EXPIRE = 102,
+ SWITCH_CAUSE_MANDATORY_IE_LENGTH_ERROR = 103,
+ SWITCH_CAUSE_PROTOCOL_ERROR = 111,
+ SWITCH_CAUSE_INTERWORKING = 127,
+ SWITCH_CAUSE_SUCCESS = 142,
+ SWITCH_CAUSE_ORIGINATOR_CANCEL = 487,
+ SWITCH_CAUSE_CRASH = 500,
+ SWITCH_CAUSE_SYSTEM_SHUTDOWN = 501,
+ SWITCH_CAUSE_LOSE_RACE = 502,
+ SWITCH_CAUSE_MANAGER_REQUEST = 503,
+ SWITCH_CAUSE_BLIND_TRANSFER = 600,
+ SWITCH_CAUSE_ATTENDED_TRANSFER = 601,
+ SWITCH_CAUSE_ALLOTTED_TIMEOUT = 602,
+ SWITCH_CAUSE_USER_CHALLENGE = 603,
+ SWITCH_CAUSE_MEDIA_TIMEOUT = 604,
+ SWITCH_CAUSE_PICKED_OFF = 605,
+ SWITCH_CAUSE_USER_NOT_REGISTERED = 606,
+ SWITCH_CAUSE_PROGRESS_TIMEOUT = 607
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 1.3.35
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+public enum switch_call_direction_t {
+ SWITCH_CALL_DIRECTION_INBOUND,
+ SWITCH_CALL_DIRECTION_OUTBOUND
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 1.3.35
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
using System;
using System.Runtime.InteropServices;
namespace FreeSWITCH.Native {
-public enum switch_call_cause_t {
- SWITCH_CAUSE_NONE = 0,
- SWITCH_CAUSE_UNALLOCATED_NUMBER = 1,
- SWITCH_CAUSE_NO_ROUTE_TRANSIT_NET = 2,
- SWITCH_CAUSE_NO_ROUTE_DESTINATION = 3,
- SWITCH_CAUSE_CHANNEL_UNACCEPTABLE = 6,
- SWITCH_CAUSE_CALL_AWARDED_DELIVERED = 7,
- SWITCH_CAUSE_NORMAL_CLEARING = 16,
- SWITCH_CAUSE_USER_BUSY = 17,
- SWITCH_CAUSE_NO_USER_RESPONSE = 18,
- SWITCH_CAUSE_NO_ANSWER = 19,
- SWITCH_CAUSE_SUBSCRIBER_ABSENT = 20,
- SWITCH_CAUSE_CALL_REJECTED = 21,
- SWITCH_CAUSE_NUMBER_CHANGED = 22,
- SWITCH_CAUSE_REDIRECTION_TO_NEW_DESTINATION = 23,
- SWITCH_CAUSE_EXCHANGE_ROUTING_ERROR = 25,
- SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER = 27,
- SWITCH_CAUSE_INVALID_NUMBER_FORMAT = 28,
- SWITCH_CAUSE_FACILITY_REJECTED = 29,
- SWITCH_CAUSE_RESPONSE_TO_STATUS_ENQUIRY = 30,
- SWITCH_CAUSE_NORMAL_UNSPECIFIED = 31,
- SWITCH_CAUSE_NORMAL_CIRCUIT_CONGESTION = 34,
- SWITCH_CAUSE_NETWORK_OUT_OF_ORDER = 38,
- SWITCH_CAUSE_NORMAL_TEMPORARY_FAILURE = 41,
- SWITCH_CAUSE_SWITCH_CONGESTION = 42,
- SWITCH_CAUSE_ACCESS_INFO_DISCARDED = 43,
- SWITCH_CAUSE_REQUESTED_CHAN_UNAVAIL = 44,
- SWITCH_CAUSE_PRE_EMPTED = 45,
- SWITCH_CAUSE_FACILITY_NOT_SUBSCRIBED = 50,
- SWITCH_CAUSE_OUTGOING_CALL_BARRED = 52,
- SWITCH_CAUSE_INCOMING_CALL_BARRED = 54,
- SWITCH_CAUSE_BEARERCAPABILITY_NOTAUTH = 57,
- SWITCH_CAUSE_BEARERCAPABILITY_NOTAVAIL = 58,
- SWITCH_CAUSE_SERVICE_UNAVAILABLE = 63,
- SWITCH_CAUSE_BEARERCAPABILITY_NOTIMPL = 65,
- SWITCH_CAUSE_CHAN_NOT_IMPLEMENTED = 66,
- SWITCH_CAUSE_FACILITY_NOT_IMPLEMENTED = 69,
- SWITCH_CAUSE_SERVICE_NOT_IMPLEMENTED = 79,
- SWITCH_CAUSE_INVALID_CALL_REFERENCE = 81,
- SWITCH_CAUSE_INCOMPATIBLE_DESTINATION = 88,
- SWITCH_CAUSE_INVALID_MSG_UNSPECIFIED = 95,
- SWITCH_CAUSE_MANDATORY_IE_MISSING = 96,
- SWITCH_CAUSE_MESSAGE_TYPE_NONEXIST = 97,
- SWITCH_CAUSE_WRONG_MESSAGE = 98,
- SWITCH_CAUSE_IE_NONEXIST = 99,
- SWITCH_CAUSE_INVALID_IE_CONTENTS = 100,
- SWITCH_CAUSE_WRONG_CALL_STATE = 101,
- SWITCH_CAUSE_RECOVERY_ON_TIMER_EXPIRE = 102,
- SWITCH_CAUSE_MANDATORY_IE_LENGTH_ERROR = 103,
- SWITCH_CAUSE_PROTOCOL_ERROR = 111,
- SWITCH_CAUSE_INTERWORKING = 127,
- SWITCH_CAUSE_SUCCESS = 142,
- SWITCH_CAUSE_ORIGINATOR_CANCEL = 487,
- SWITCH_CAUSE_CRASH = 500,
- SWITCH_CAUSE_SYSTEM_SHUTDOWN = 501,
- SWITCH_CAUSE_LOSE_RACE = 502,
- SWITCH_CAUSE_MANAGER_REQUEST = 503,
- SWITCH_CAUSE_BLIND_TRANSFER = 600,
- SWITCH_CAUSE_ATTENDED_TRANSFER = 601,
- SWITCH_CAUSE_ALLOTTED_TIMEOUT = 602,
- SWITCH_CAUSE_USER_CHALLENGE = 603,
- SWITCH_CAUSE_MEDIA_TIMEOUT = 604,
- SWITCH_CAUSE_PICKED_OFF = 605,
- SWITCH_CAUSE_USER_NOT_REGISTERED = 606,
- SWITCH_CAUSE_PROGRESS_TIMEOUT = 607
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-public enum switch_call_direction_t {
- SWITCH_CALL_DIRECTION_INBOUND,
- SWITCH_CALL_DIRECTION_OUTBOUND
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
public enum switch_channel_app_flag_t {
CF_APP_TAGGED = (1 << 0),
CF_APP_T38 = (1 << 1),
namespace FreeSWITCH.Native {
+public enum switch_chat_application_flag_enum_t {
+ SCAF_NONE = 0
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 1.3.35
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
+public class switch_chat_application_interface : IDisposable {
+ private HandleRef swigCPtr;
+ protected bool swigCMemOwn;
+
+ internal switch_chat_application_interface(IntPtr cPtr, bool cMemoryOwn) {
+ swigCMemOwn = cMemoryOwn;
+ swigCPtr = new HandleRef(this, cPtr);
+ }
+
+ internal static HandleRef getCPtr(switch_chat_application_interface obj) {
+ return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+ }
+
+ ~switch_chat_application_interface() {
+ Dispose();
+ }
+
+ public virtual void Dispose() {
+ lock(this) {
+ if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) {
+ swigCMemOwn = false;
+ freeswitchPINVOKE.delete_switch_chat_application_interface(swigCPtr);
+ }
+ swigCPtr = new HandleRef(null, IntPtr.Zero);
+ GC.SuppressFinalize(this);
+ }
+ }
+
+ public string interface_name {
+ set {
+ freeswitchPINVOKE.switch_chat_application_interface_interface_name_set(swigCPtr, value);
+ }
+ get {
+ string ret = freeswitchPINVOKE.switch_chat_application_interface_interface_name_get(swigCPtr);
+ return ret;
+ }
+ }
+
+ public SWIGTYPE_p_f_p_switch_event_p_q_const__char__switch_status_t chat_application_function {
+ set {
+ freeswitchPINVOKE.switch_chat_application_interface_chat_application_function_set(swigCPtr, SWIGTYPE_p_f_p_switch_event_p_q_const__char__switch_status_t.getCPtr(value));
+ }
+ get {
+ IntPtr cPtr = freeswitchPINVOKE.switch_chat_application_interface_chat_application_function_get(swigCPtr);
+ SWIGTYPE_p_f_p_switch_event_p_q_const__char__switch_status_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_f_p_switch_event_p_q_const__char__switch_status_t(cPtr, false);
+ return ret;
+ }
+ }
+
+ public string long_desc {
+ set {
+ freeswitchPINVOKE.switch_chat_application_interface_long_desc_set(swigCPtr, value);
+ }
+ get {
+ string ret = freeswitchPINVOKE.switch_chat_application_interface_long_desc_get(swigCPtr);
+ return ret;
+ }
+ }
+
+ public string short_desc {
+ set {
+ freeswitchPINVOKE.switch_chat_application_interface_short_desc_set(swigCPtr, value);
+ }
+ get {
+ string ret = freeswitchPINVOKE.switch_chat_application_interface_short_desc_get(swigCPtr);
+ return ret;
+ }
+ }
+
+ public string syntax {
+ set {
+ freeswitchPINVOKE.switch_chat_application_interface_syntax_set(swigCPtr, value);
+ }
+ get {
+ string ret = freeswitchPINVOKE.switch_chat_application_interface_syntax_get(swigCPtr);
+ return ret;
+ }
+ }
+
+ public uint flags {
+ set {
+ freeswitchPINVOKE.switch_chat_application_interface_flags_set(swigCPtr, value);
+ }
+ get {
+ uint ret = freeswitchPINVOKE.switch_chat_application_interface_flags_get(swigCPtr);
+ return ret;
+ }
+ }
+
+ public SWIGTYPE_p_switch_thread_rwlock_t rwlock {
+ set {
+ freeswitchPINVOKE.switch_chat_application_interface_rwlock_set(swigCPtr, SWIGTYPE_p_switch_thread_rwlock_t.getCPtr(value));
+ }
+ get {
+ IntPtr cPtr = freeswitchPINVOKE.switch_chat_application_interface_rwlock_get(swigCPtr);
+ SWIGTYPE_p_switch_thread_rwlock_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_thread_rwlock_t(cPtr, false);
+ return ret;
+ }
+ }
+
+ public int refs {
+ set {
+ freeswitchPINVOKE.switch_chat_application_interface_refs_set(swigCPtr, value);
+ }
+ get {
+ int ret = freeswitchPINVOKE.switch_chat_application_interface_refs_get(swigCPtr);
+ return ret;
+ }
+ }
+
+ public SWIGTYPE_p_switch_mutex_t reflock {
+ set {
+ freeswitchPINVOKE.switch_chat_application_interface_reflock_set(swigCPtr, SWIGTYPE_p_switch_mutex_t.getCPtr(value));
+ }
+ get {
+ IntPtr cPtr = freeswitchPINVOKE.switch_chat_application_interface_reflock_get(swigCPtr);
+ SWIGTYPE_p_switch_mutex_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_switch_mutex_t(cPtr, false);
+ return ret;
+ }
+ }
+
+ public switch_loadable_module_interface parent {
+ set {
+ freeswitchPINVOKE.switch_chat_application_interface_parent_set(swigCPtr, switch_loadable_module_interface.getCPtr(value));
+ }
+ get {
+ IntPtr cPtr = freeswitchPINVOKE.switch_chat_application_interface_parent_get(swigCPtr);
+ switch_loadable_module_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_loadable_module_interface(cPtr, false);
+ return ret;
+ }
+ }
+
+ public switch_chat_application_interface next {
+ set {
+ freeswitchPINVOKE.switch_chat_application_interface_next_set(swigCPtr, switch_chat_application_interface.getCPtr(value));
+ }
+ get {
+ IntPtr cPtr = freeswitchPINVOKE.switch_chat_application_interface_next_get(swigCPtr);
+ switch_chat_application_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_chat_application_interface(cPtr, false);
+ return ret;
+ }
+ }
+
+ public switch_chat_application_interface() : this(freeswitchPINVOKE.new_switch_chat_application_interface(), true) {
+ }
+
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 1.3.35
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
using System;
using System.Runtime.InteropServices;
namespace FreeSWITCH.Native {
public enum switch_event_flag_t {
- EF_UNIQ_HEADERS = (1 << 0)
+ EF_UNIQ_HEADERS = (1 << 0),
+ EF_NO_CHAT_EXEC = (1 << 1)
}
}
using System;
using System.Runtime.InteropServices;
-public class switch_io_event_hooks : IDisposable {
+public class switch_io_event_hook_kill_channel : IDisposable {
private HandleRef swigCPtr;
protected bool swigCMemOwn;
- internal switch_io_event_hooks(IntPtr cPtr, bool cMemoryOwn) {
+ internal switch_io_event_hook_kill_channel(IntPtr cPtr, bool cMemoryOwn) {
swigCMemOwn = cMemoryOwn;
swigCPtr = new HandleRef(this, cPtr);
}
- internal static HandleRef getCPtr(switch_io_event_hooks obj) {
+ internal static HandleRef getCPtr(switch_io_event_hook_kill_channel obj) {
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
}
- ~switch_io_event_hooks() {
+ ~switch_io_event_hook_kill_channel() {
Dispose();
}
lock(this) {
if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) {
swigCMemOwn = false;
- freeswitchPINVOKE.delete_switch_io_event_hooks(swigCPtr);
+ freeswitchPINVOKE.delete_switch_io_event_hook_kill_channel(swigCPtr);
}
swigCPtr = new HandleRef(null, IntPtr.Zero);
GC.SuppressFinalize(this);
}
}
- public switch_io_event_hook_outgoing_channel outgoing_channel {
+ public SWIGTYPE_p_f_p_switch_core_session_int__switch_status_t kill_channel {
set {
- freeswitchPINVOKE.switch_io_event_hooks_outgoing_channel_set(swigCPtr, switch_io_event_hook_outgoing_channel.getCPtr(value));
+ freeswitchPINVOKE.switch_io_event_hook_kill_channel_kill_channel_set(swigCPtr, SWIGTYPE_p_f_p_switch_core_session_int__switch_status_t.getCPtr(value));
}
get {
- IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_outgoing_channel_get(swigCPtr);
- switch_io_event_hook_outgoing_channel ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_outgoing_channel(cPtr, false);
+ IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hook_kill_channel_kill_channel_get(swigCPtr);
+ SWIGTYPE_p_f_p_switch_core_session_int__switch_status_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_f_p_switch_core_session_int__switch_status_t(cPtr, false);
return ret;
}
}
- public switch_io_event_hook_receive_message receive_message {
+ public switch_io_event_hook_kill_channel next {
set {
- freeswitchPINVOKE.switch_io_event_hooks_receive_message_set(swigCPtr, switch_io_event_hook_receive_message.getCPtr(value));
+ freeswitchPINVOKE.switch_io_event_hook_kill_channel_next_set(swigCPtr, switch_io_event_hook_kill_channel.getCPtr(value));
}
get {
- IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_receive_message_get(swigCPtr);
- switch_io_event_hook_receive_message ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_receive_message(cPtr, false);
+ IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hook_kill_channel_next_get(swigCPtr);
+ switch_io_event_hook_kill_channel ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_kill_channel(cPtr, false);
return ret;
}
}
- public switch_io_event_hook_receive_event receive_event {
- set {
- freeswitchPINVOKE.switch_io_event_hooks_receive_event_set(swigCPtr, switch_io_event_hook_receive_event.getCPtr(value));
- }
- get {
- IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_receive_event_get(swigCPtr);
- switch_io_event_hook_receive_event ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_receive_event(cPtr, false);
- return ret;
- }
+ public switch_io_event_hook_kill_channel() : this(freeswitchPINVOKE.new_switch_io_event_hook_kill_channel(), true) {
}
- public switch_io_event_hook_read_frame read_frame {
- set {
- freeswitchPINVOKE.switch_io_event_hooks_read_frame_set(swigCPtr, switch_io_event_hook_read_frame.getCPtr(value));
- }
- get {
- IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_read_frame_get(swigCPtr);
- switch_io_event_hook_read_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_read_frame(cPtr, false);
- return ret;
- }
- }
-
- public switch_io_event_hook_video_read_frame video_read_frame {
- set {
- freeswitchPINVOKE.switch_io_event_hooks_video_read_frame_set(swigCPtr, switch_io_event_hook_video_read_frame.getCPtr(value));
- }
- get {
- IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_video_read_frame_get(swigCPtr);
- switch_io_event_hook_video_read_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_video_read_frame(cPtr, false);
- return ret;
- }
- }
-
- public switch_io_event_hook_write_frame write_frame {
- set {
- freeswitchPINVOKE.switch_io_event_hooks_write_frame_set(swigCPtr, switch_io_event_hook_write_frame.getCPtr(value));
- }
- get {
- IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_write_frame_get(swigCPtr);
- switch_io_event_hook_write_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_write_frame(cPtr, false);
- return ret;
- }
- }
-
- public switch_io_event_hook_video_write_frame video_write_frame {
- set {
- freeswitchPINVOKE.switch_io_event_hooks_video_write_frame_set(swigCPtr, switch_io_event_hook_video_write_frame.getCPtr(value));
- }
- get {
- IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_video_write_frame_get(swigCPtr);
- switch_io_event_hook_video_write_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_video_write_frame(cPtr, false);
- return ret;
- }
- }
-
- public switch_io_event_hook_kill_channel kill_channel {
- set {
- freeswitchPINVOKE.switch_io_event_hooks_kill_channel_set(swigCPtr, switch_io_event_hook_kill_channel.getCPtr(value));
- }
- get {
- IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_kill_channel_get(swigCPtr);
- switch_io_event_hook_kill_channel ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_kill_channel(cPtr, false);
- return ret;
- }
- }
-
- public switch_io_event_hook_send_dtmf send_dtmf {
- set {
- freeswitchPINVOKE.switch_io_event_hooks_send_dtmf_set(swigCPtr, switch_io_event_hook_send_dtmf.getCPtr(value));
- }
- get {
- IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_send_dtmf_get(swigCPtr);
- switch_io_event_hook_send_dtmf ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_send_dtmf(cPtr, false);
- return ret;
- }
- }
-
- public switch_io_event_hook_recv_dtmf recv_dtmf {
- set {
- freeswitchPINVOKE.switch_io_event_hooks_recv_dtmf_set(swigCPtr, switch_io_event_hook_recv_dtmf.getCPtr(value));
- }
- get {
- IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_recv_dtmf_get(swigCPtr);
- switch_io_event_hook_recv_dtmf ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_recv_dtmf(cPtr, false);
- return ret;
- }
- }
-
- public switch_io_event_hook_state_change state_change {
- set {
- freeswitchPINVOKE.switch_io_event_hooks_state_change_set(swigCPtr, switch_io_event_hook_state_change.getCPtr(value));
- }
- get {
- IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_state_change_get(swigCPtr);
- switch_io_event_hook_state_change ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_state_change(cPtr, false);
- return ret;
- }
- }
-
- public switch_io_event_hook_state_run state_run {
- set {
- freeswitchPINVOKE.switch_io_event_hooks_state_run_set(swigCPtr, switch_io_event_hook_state_run.getCPtr(value));
- }
- get {
- IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_state_run_get(swigCPtr);
- switch_io_event_hook_state_run ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_state_run(cPtr, false);
- return ret;
- }
- }
-
- public switch_io_event_hook_resurrect_session resurrect_session {
- set {
- freeswitchPINVOKE.switch_io_event_hooks_resurrect_session_set(swigCPtr, switch_io_event_hook_resurrect_session.getCPtr(value));
- }
- get {
- IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_resurrect_session_get(swigCPtr);
- switch_io_event_hook_resurrect_session ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_resurrect_session(cPtr, false);
- return ret;
- }
- }
-
- public switch_io_event_hooks() : this(freeswitchPINVOKE.new_switch_io_event_hooks(), true) {
- }
-
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
-using System;
-using System.Runtime.InteropServices;
-
-public class switch_io_event_hook_kill_channel : IDisposable {
- private HandleRef swigCPtr;
- protected bool swigCMemOwn;
-
- internal switch_io_event_hook_kill_channel(IntPtr cPtr, bool cMemoryOwn) {
- swigCMemOwn = cMemoryOwn;
- swigCPtr = new HandleRef(this, cPtr);
- }
-
- internal static HandleRef getCPtr(switch_io_event_hook_kill_channel obj) {
- return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
- }
-
- ~switch_io_event_hook_kill_channel() {
- Dispose();
- }
-
- public virtual void Dispose() {
- lock(this) {
- if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) {
- swigCMemOwn = false;
- freeswitchPINVOKE.delete_switch_io_event_hook_kill_channel(swigCPtr);
- }
- swigCPtr = new HandleRef(null, IntPtr.Zero);
- GC.SuppressFinalize(this);
- }
- }
-
- public SWIGTYPE_p_f_p_switch_core_session_int__switch_status_t kill_channel {
- set {
- freeswitchPINVOKE.switch_io_event_hook_kill_channel_kill_channel_set(swigCPtr, SWIGTYPE_p_f_p_switch_core_session_int__switch_status_t.getCPtr(value));
- }
- get {
- IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hook_kill_channel_kill_channel_get(swigCPtr);
- SWIGTYPE_p_f_p_switch_core_session_int__switch_status_t ret = (cPtr == IntPtr.Zero) ? null : new SWIGTYPE_p_f_p_switch_core_session_int__switch_status_t(cPtr, false);
- return ret;
- }
- }
-
- public switch_io_event_hook_kill_channel next {
- set {
- freeswitchPINVOKE.switch_io_event_hook_kill_channel_next_set(swigCPtr, switch_io_event_hook_kill_channel.getCPtr(value));
- }
- get {
- IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hook_kill_channel_next_get(swigCPtr);
- switch_io_event_hook_kill_channel ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_kill_channel(cPtr, false);
- return ret;
- }
- }
-
- public switch_io_event_hook_kill_channel() : this(freeswitchPINVOKE.new_switch_io_event_hook_kill_channel(), true) {
- }
-
-}
+}
}
/* ----------------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
+public class switch_io_event_hooks : IDisposable {
+ private HandleRef swigCPtr;
+ protected bool swigCMemOwn;
+
+ internal switch_io_event_hooks(IntPtr cPtr, bool cMemoryOwn) {
+ swigCMemOwn = cMemoryOwn;
+ swigCPtr = new HandleRef(this, cPtr);
+ }
+
+ internal static HandleRef getCPtr(switch_io_event_hooks obj) {
+ return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+ }
+
+ ~switch_io_event_hooks() {
+ Dispose();
+ }
+
+ public virtual void Dispose() {
+ lock(this) {
+ if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) {
+ swigCMemOwn = false;
+ freeswitchPINVOKE.delete_switch_io_event_hooks(swigCPtr);
+ }
+ swigCPtr = new HandleRef(null, IntPtr.Zero);
+ GC.SuppressFinalize(this);
+ }
+ }
+
+ public switch_io_event_hook_outgoing_channel outgoing_channel {
+ set {
+ freeswitchPINVOKE.switch_io_event_hooks_outgoing_channel_set(swigCPtr, switch_io_event_hook_outgoing_channel.getCPtr(value));
+ }
+ get {
+ IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_outgoing_channel_get(swigCPtr);
+ switch_io_event_hook_outgoing_channel ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_outgoing_channel(cPtr, false);
+ return ret;
+ }
+ }
+
+ public switch_io_event_hook_receive_message receive_message {
+ set {
+ freeswitchPINVOKE.switch_io_event_hooks_receive_message_set(swigCPtr, switch_io_event_hook_receive_message.getCPtr(value));
+ }
+ get {
+ IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_receive_message_get(swigCPtr);
+ switch_io_event_hook_receive_message ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_receive_message(cPtr, false);
+ return ret;
+ }
+ }
+
+ public switch_io_event_hook_receive_event receive_event {
+ set {
+ freeswitchPINVOKE.switch_io_event_hooks_receive_event_set(swigCPtr, switch_io_event_hook_receive_event.getCPtr(value));
+ }
+ get {
+ IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_receive_event_get(swigCPtr);
+ switch_io_event_hook_receive_event ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_receive_event(cPtr, false);
+ return ret;
+ }
+ }
+
+ public switch_io_event_hook_read_frame read_frame {
+ set {
+ freeswitchPINVOKE.switch_io_event_hooks_read_frame_set(swigCPtr, switch_io_event_hook_read_frame.getCPtr(value));
+ }
+ get {
+ IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_read_frame_get(swigCPtr);
+ switch_io_event_hook_read_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_read_frame(cPtr, false);
+ return ret;
+ }
+ }
+
+ public switch_io_event_hook_video_read_frame video_read_frame {
+ set {
+ freeswitchPINVOKE.switch_io_event_hooks_video_read_frame_set(swigCPtr, switch_io_event_hook_video_read_frame.getCPtr(value));
+ }
+ get {
+ IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_video_read_frame_get(swigCPtr);
+ switch_io_event_hook_video_read_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_video_read_frame(cPtr, false);
+ return ret;
+ }
+ }
+
+ public switch_io_event_hook_write_frame write_frame {
+ set {
+ freeswitchPINVOKE.switch_io_event_hooks_write_frame_set(swigCPtr, switch_io_event_hook_write_frame.getCPtr(value));
+ }
+ get {
+ IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_write_frame_get(swigCPtr);
+ switch_io_event_hook_write_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_write_frame(cPtr, false);
+ return ret;
+ }
+ }
+
+ public switch_io_event_hook_video_write_frame video_write_frame {
+ set {
+ freeswitchPINVOKE.switch_io_event_hooks_video_write_frame_set(swigCPtr, switch_io_event_hook_video_write_frame.getCPtr(value));
+ }
+ get {
+ IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_video_write_frame_get(swigCPtr);
+ switch_io_event_hook_video_write_frame ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_video_write_frame(cPtr, false);
+ return ret;
+ }
+ }
+
+ public switch_io_event_hook_kill_channel kill_channel {
+ set {
+ freeswitchPINVOKE.switch_io_event_hooks_kill_channel_set(swigCPtr, switch_io_event_hook_kill_channel.getCPtr(value));
+ }
+ get {
+ IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_kill_channel_get(swigCPtr);
+ switch_io_event_hook_kill_channel ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_kill_channel(cPtr, false);
+ return ret;
+ }
+ }
+
+ public switch_io_event_hook_send_dtmf send_dtmf {
+ set {
+ freeswitchPINVOKE.switch_io_event_hooks_send_dtmf_set(swigCPtr, switch_io_event_hook_send_dtmf.getCPtr(value));
+ }
+ get {
+ IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_send_dtmf_get(swigCPtr);
+ switch_io_event_hook_send_dtmf ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_send_dtmf(cPtr, false);
+ return ret;
+ }
+ }
+
+ public switch_io_event_hook_recv_dtmf recv_dtmf {
+ set {
+ freeswitchPINVOKE.switch_io_event_hooks_recv_dtmf_set(swigCPtr, switch_io_event_hook_recv_dtmf.getCPtr(value));
+ }
+ get {
+ IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_recv_dtmf_get(swigCPtr);
+ switch_io_event_hook_recv_dtmf ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_recv_dtmf(cPtr, false);
+ return ret;
+ }
+ }
+
+ public switch_io_event_hook_state_change state_change {
+ set {
+ freeswitchPINVOKE.switch_io_event_hooks_state_change_set(swigCPtr, switch_io_event_hook_state_change.getCPtr(value));
+ }
+ get {
+ IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_state_change_get(swigCPtr);
+ switch_io_event_hook_state_change ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_state_change(cPtr, false);
+ return ret;
+ }
+ }
+
+ public switch_io_event_hook_state_run state_run {
+ set {
+ freeswitchPINVOKE.switch_io_event_hooks_state_run_set(swigCPtr, switch_io_event_hook_state_run.getCPtr(value));
+ }
+ get {
+ IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_state_run_get(swigCPtr);
+ switch_io_event_hook_state_run ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_state_run(cPtr, false);
+ return ret;
+ }
+ }
+
+ public switch_io_event_hook_resurrect_session resurrect_session {
+ set {
+ freeswitchPINVOKE.switch_io_event_hooks_resurrect_session_set(swigCPtr, switch_io_event_hook_resurrect_session.getCPtr(value));
+ }
+ get {
+ IntPtr cPtr = freeswitchPINVOKE.switch_io_event_hooks_resurrect_session_get(swigCPtr);
+ switch_io_event_hook_resurrect_session ret = (cPtr == IntPtr.Zero) ? null : new switch_io_event_hook_resurrect_session(cPtr, false);
+ return ret;
+ }
+ }
+
+ public switch_io_event_hooks() : this(freeswitchPINVOKE.new_switch_io_event_hooks(), true) {
+ }
+
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 1.3.35
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
+using System;
+using System.Runtime.InteropServices;
+
public class switch_io_event_hook_send_dtmf : IDisposable {
private HandleRef swigCPtr;
protected bool swigCMemOwn;
namespace FreeSWITCH.Native {
+public enum switch_io_routine_name_t {
+ SWITCH_IO_OUTGOING_CHANNEL,
+ SWITCH_IO_READ_FRAME,
+ SWITCH_IO_WRITE_FRAME,
+ SWITCH_IO_KILL_CHANNEL,
+ SWITCH_IO_SEND_DTMF,
+ SWITCH_IO_RECEIVE_MESSAGE,
+ SWITCH_IO_RECEIVE_EVENT,
+ SWITCH_IO_STATE_CHANGE,
+ SWITCH_IO_READ_VIDEO_FRAME,
+ SWITCH_IO_WRITE_VIDEO_FRAME,
+ SWITCH_IO_RESURRECT_SESSION
+}
+
+}
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 1.3.35
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+namespace FreeSWITCH.Native {
+
using System;
using System.Runtime.InteropServices;
namespace FreeSWITCH.Native {
-public enum switch_io_routine_name_t {
- SWITCH_IO_OUTGOING_CHANNEL,
- SWITCH_IO_READ_FRAME,
- SWITCH_IO_WRITE_FRAME,
- SWITCH_IO_KILL_CHANNEL,
- SWITCH_IO_SEND_DTMF,
- SWITCH_IO_RECEIVE_MESSAGE,
- SWITCH_IO_RECEIVE_EVENT,
- SWITCH_IO_STATE_CHANGE,
- SWITCH_IO_READ_VIDEO_FRAME,
- SWITCH_IO_WRITE_VIDEO_FRAME,
- SWITCH_IO_RESURRECT_SESSION
-}
-
-}
-/* ----------------------------------------------------------------------------
- * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.35
- *
- * Do not make changes to this file unless you know what you are doing--modify
- * the SWIG interface file instead.
- * ----------------------------------------------------------------------------- */
-
-namespace FreeSWITCH.Native {
-
public enum switch_ivr_action_t {
SWITCH_IVR_ACTION_DIE,
SWITCH_IVR_ACTION_EXECMENU,
}
}
+ public switch_chat_application_interface chat_application_interface {
+ set {
+ freeswitchPINVOKE.switch_loadable_module_interface_chat_application_interface_set(swigCPtr, switch_chat_application_interface.getCPtr(value));
+ }
+ get {
+ IntPtr cPtr = freeswitchPINVOKE.switch_loadable_module_interface_chat_application_interface_get(swigCPtr);
+ switch_chat_application_interface ret = (cPtr == IntPtr.Zero) ? null : new switch_chat_application_interface(cPtr, false);
+ return ret;
+ }
+ }
+
public switch_api_interface api_interface {
set {
freeswitchPINVOKE.switch_loadable_module_interface_api_interface_set(swigCPtr, switch_api_interface.getCPtr(value));
SWITCH_SAY_INTERFACE,
SWITCH_ASR_INTERFACE,
SWITCH_MANAGEMENT_INTERFACE,
- SWITCH_LIMIT_INTERFACE
+ SWITCH_LIMIT_INTERFACE,
+ SWITCH_CHAT_APPLICATION_INTERFACE
}
}
}
}
+*chat_execute = *freeswitchc::Event_chat_execute;
+*chat_send = *freeswitchc::Event_chat_send;
*serialize = *freeswitchc::Event_serialize;
*setPriority = *freeswitchc::Event_setPriority;
*getHeader = *freeswitchc::Event_getHeader;
}
+XS(_wrap_Event_chat_execute) {
+ {
+ Event *arg1 = (Event *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) NULL ;
+ int result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ int res3 ;
+ char *buf3 = 0 ;
+ int alloc3 = 0 ;
+ int argvi = 0;
+ dXSARGS;
+
+ if ((items < 2) || (items > 3)) {
+ SWIG_croak("Usage: Event_chat_execute(self,app,data);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Event, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Event_chat_execute" "', argument " "1"" of type '" "Event *""'");
+ }
+ arg1 = reinterpret_cast< Event * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Event_chat_execute" "', argument " "2"" of type '" "char const *""'");
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ if (items > 2) {
+ res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Event_chat_execute" "', argument " "3"" of type '" "char const *""'");
+ }
+ arg3 = reinterpret_cast< char * >(buf3);
+ }
+ result = (int)(arg1)->chat_execute((char const *)arg2,(char const *)arg3);
+ ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
+
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ XSRETURN(argvi);
+ fail:
+
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_Event_chat_send) {
+ {
+ Event *arg1 = (Event *) 0 ;
+ char *arg2 = (char *) NULL ;
+ int result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ int argvi = 0;
+ dXSARGS;
+
+ if ((items < 1) || (items > 2)) {
+ SWIG_croak("Usage: Event_chat_send(self,dest_proto);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Event, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Event_chat_send" "', argument " "1"" of type '" "Event *""'");
+ }
+ arg1 = reinterpret_cast< Event * >(argp1);
+ if (items > 1) {
+ res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Event_chat_send" "', argument " "2"" of type '" "char const *""'");
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ }
+ result = (int)(arg1)->chat_send((char const *)arg2);
+ ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
+
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ XSRETURN(argvi);
+ fail:
+
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ SWIG_croak_null();
+ }
+}
+
+
XS(_wrap_Event_serialize) {
{
Event *arg1 = (Event *) 0 ;
{"freeswitchc::Event_mine_get", _wrap_Event_mine_get},
{"freeswitchc::new_Event", _wrap_new_Event},
{"freeswitchc::delete_Event", _wrap_delete_Event},
+{"freeswitchc::Event_chat_execute", _wrap_Event_chat_execute},
+{"freeswitchc::Event_chat_send", _wrap_Event_chat_send},
{"freeswitchc::Event_serialize", _wrap_Event_serialize},
{"freeswitchc::Event_setPriority", _wrap_Event_setPriority},
{"freeswitchc::Event_getHeader", _wrap_Event_getHeader},
except: self.this = this
__swig_destroy__ = _freeswitch.delete_Event
__del__ = lambda self : None;
+ def chat_execute(*args): return _freeswitch.Event_chat_execute(*args)
+ def chat_send(*args): return _freeswitch.Event_chat_send(*args)
def serialize(*args): return _freeswitch.Event_serialize(*args)
def setPriority(*args): return _freeswitch.Event_setPriority(*args)
def getHeader(*args): return _freeswitch.Event_getHeader(*args)
}
+SWIGINTERN PyObject *_wrap_Event_chat_execute(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ Event *arg1 = (Event *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *arg3 = (char *) NULL ;
+ int result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ int res3 ;
+ char *buf3 = 0 ;
+ int alloc3 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"OO|O:Event_chat_execute",&obj0,&obj1,&obj2)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Event, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Event_chat_execute" "', argument " "1"" of type '" "Event *""'");
+ }
+ arg1 = reinterpret_cast< Event * >(argp1);
+ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Event_chat_execute" "', argument " "2"" of type '" "char const *""'");
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ if (obj2) {
+ res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Event_chat_execute" "', argument " "3"" of type '" "char const *""'");
+ }
+ arg3 = reinterpret_cast< char * >(buf3);
+ }
+ result = (int)(arg1)->chat_execute((char const *)arg2,(char const *)arg3);
+ resultobj = SWIG_From_int(static_cast< int >(result));
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ return resultobj;
+fail:
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
+ return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Event_chat_send(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+ PyObject *resultobj = 0;
+ Event *arg1 = (Event *) 0 ;
+ char *arg2 = (char *) NULL ;
+ int result;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ char *buf2 = 0 ;
+ int alloc2 = 0 ;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+
+ if (!PyArg_ParseTuple(args,(char *)"O|O:Event_chat_send",&obj0,&obj1)) SWIG_fail;
+ res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Event, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Event_chat_send" "', argument " "1"" of type '" "Event *""'");
+ }
+ arg1 = reinterpret_cast< Event * >(argp1);
+ if (obj1) {
+ res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Event_chat_send" "', argument " "2"" of type '" "char const *""'");
+ }
+ arg2 = reinterpret_cast< char * >(buf2);
+ }
+ result = (int)(arg1)->chat_send((char const *)arg2);
+ resultobj = SWIG_From_int(static_cast< int >(result));
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ return resultobj;
+fail:
+ if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+ return NULL;
+}
+
+
SWIGINTERN PyObject *_wrap_Event_serialize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
Event *arg1 = (Event *) 0 ;
{ (char *)"Event_mine_get", _wrap_Event_mine_get, METH_VARARGS, NULL},
{ (char *)"new_Event", _wrap_new_Event, METH_VARARGS, NULL},
{ (char *)"delete_Event", _wrap_delete_Event, METH_VARARGS, NULL},
+ { (char *)"Event_chat_execute", _wrap_Event_chat_execute, METH_VARARGS, NULL},
+ { (char *)"Event_chat_send", _wrap_Event_chat_send, METH_VARARGS, NULL},
{ (char *)"Event_serialize", _wrap_Event_serialize, METH_VARARGS, NULL},
{ (char *)"Event_setPriority", _wrap_Event_setPriority, METH_VARARGS, NULL},
{ (char *)"Event_getHeader", _wrap_Event_getHeader, METH_VARARGS, NULL},
}
}
+SWITCH_DECLARE(int)Event::chat_execute(const char *app, const char *data)
+{
+ return (int) switch_core_execute_chat_app(event, app, data);
+}
+
+SWITCH_DECLARE(int)Event::chat_send(const char *dest_proto)
+{
+ if (zstr(dest_proto)) {
+ dest_proto = switch_event_get_header(event, "dest_proto");
+ }
+
+ return (int) switch_core_chat_send(dest_proto, event);
+}
SWITCH_DECLARE(const char *)Event::serialize(const char *format)
{
memset(*event, 0, sizeof(switch_event_t));
- if (event_id == SWITCH_EVENT_REQUEST_PARAMS || event_id == SWITCH_EVENT_CHANNEL_DATA) {
+ if (event_id == SWITCH_EVENT_REQUEST_PARAMS || event_id == SWITCH_EVENT_CHANNEL_DATA || event_id == SWITCH_EVENT_MESSAGE) {
(*event)->flags |= EF_UNIQ_HEADERS;
}
return SWITCH_STATUS_SUCCESS;
}
+SWITCH_DECLARE(switch_status_t) switch_event_rename_header(switch_event_t *event, const char *header_name, const char *new_header_name)
+{
+ switch_event_header_t *hp;
+ switch_ssize_t hlen = -1;
+ unsigned long hash = 0;
+ int x = 0;
+
+ switch_assert(event);
+
+ if (!header_name) {
+ return SWITCH_STATUS_FALSE;
+ }
+
+ hash = switch_ci_hashfunc_default(header_name, &hlen);
+
+ for (hp = event->headers; hp; hp = hp->next) {
+ if ((!hp->hash || hash == hp->hash) && !strcasecmp(hp->name, header_name)) {
+ FREE(hp->name);
+ hp->name = DUP(new_header_name);
+ hlen = -1;
+ hp->hash = switch_ci_hashfunc_default(hp->name, &hlen);
+ x++;
+ }
+ }
+
+ return x ? SWITCH_STATUS_SUCCESS : SWITCH_STATUS_FALSE;
+}
+
+
SWITCH_DECLARE(switch_event_header_t *) switch_event_get_header_ptr(switch_event_t *event, const char *header_name)
{
switch_event_header_t *hp;
}
return hp->value;
+ } else if (!strcmp(header_name, "_body")) {
+ return event->body;
}
return NULL;
int index = 0;
char *real_header_name = NULL;
+
+ if (!strcmp(header_name, "_body")) {
+ switch_event_set_body(event, data);
+ }
+
if ((index_ptr = strchr(header_name, '['))) {
index_ptr++;
index = atoi(index_ptr);
return SWITCH_STATUS_GENERR;
}
+SWITCH_DECLARE(switch_status_t) switch_event_set_body(switch_event_t *event, const char *body)
+{
+ switch_safe_free(event->body);
+
+ if (body) {
+ event->body = DUP(body);
+ }
+
+ return SWITCH_STATUS_SUCCESS;
+}
+
SWITCH_DECLARE(switch_status_t) switch_event_add_body(switch_event_t *event, const char *fmt, ...)
{
int ret = 0;
return SWITCH_STATUS_SUCCESS;
}
+
+SWITCH_DECLARE(switch_status_t) switch_event_dup_reply(switch_event_t **event, switch_event_t *todup)
+{
+ switch_event_header_t *hp;
+ char hname[1024] = "";
+ char *p;
+
+ if (switch_event_create_subclass(event, SWITCH_EVENT_CLONE, todup->subclass_name) != SWITCH_STATUS_SUCCESS) {
+ return SWITCH_STATUS_GENERR;
+ }
+
+ (*event)->event_id = todup->event_id;
+ (*event)->event_user_data = todup->event_user_data;
+ (*event)->bind_user_data = todup->bind_user_data;
+ (*event)->flags = todup->flags;
+
+ for (hp = todup->headers; hp; hp = hp->next) {
+ char *name = hp->name, *value = hp->value;
+
+ if (todup->subclass_name && !strcmp(hp->name, "Event-Subclass")) {
+ continue;
+ }
+
+ if (!strncasecmp(hp->name, "from_", 5)) {
+ p = hp->name + 5;
+ switch_snprintf(hname, sizeof(hname), "to_%s", p);
+ name = hname;
+ } else if (!strncasecmp(hp->name, "to_", 3)) {
+ p = hp->name + 3;
+ switch_snprintf(hname, sizeof(hname), "from_%s", p);
+ name = hname;
+ } else if (!strcasecmp(name, "to")) {
+ name = "from";
+ } else if (!strcasecmp(name, "from")) {
+ name = "to";
+ }
+
+ if (hp->idx) {
+ int i;
+ for (i = 0; i < hp->idx; i++) {
+ switch_event_add_header_string(*event, SWITCH_STACK_PUSH, name, hp->array[i]);
+ }
+ } else {
+ switch_event_add_header_string(*event, SWITCH_STACK_BOTTOM, name, value);
+ }
+ }
+
+ switch_event_add_header_string(*event, SWITCH_STACK_BOTTOM, "replying", "true");
+
+ if (todup->body) {
+ switch_event_add_header_string(*event, SWITCH_STACK_BOTTOM, "orig_body", todup->body);
+ }
+
+ (*event)->key = todup->key;
+
+ return SWITCH_STATUS_SUCCESS;
+}
+
SWITCH_DECLARE(switch_status_t) switch_event_serialize(switch_event_t *event, char **str, switch_bool_t encode)
{
switch_size_t len = 0;
}
+SWITCH_DECLARE(switch_status_t) switch_ivr_create_message_reply(switch_event_t **reply, switch_event_t *message, const char *new_proto)
+{
+ switch_status_t status = SWITCH_STATUS_SUCCESS;
+
+ if ((status = switch_event_dup_reply(reply, message) != SWITCH_STATUS_SUCCESS)) {
+ abort();
+ }
+
+ switch_event_add_header_string(*reply, SWITCH_STACK_BOTTOM, "proto", new_proto);
+
+ return status;
+}
+
/* For Emacs:
* Local Variables:
switch_hash_t *dialplan_hash;
switch_hash_t *timer_hash;
switch_hash_t *application_hash;
+ switch_hash_t *chat_application_hash;
switch_hash_t *api_hash;
switch_hash_t *file_hash;
switch_hash_t *speech_hash;
}
}
+ if (new_module->module_interface->chat_application_interface) {
+ const switch_chat_application_interface_t *ptr;
+
+ for (ptr = new_module->module_interface->chat_application_interface; ptr; ptr = ptr->next) {
+ if (!ptr->interface_name) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Failed to load application interface from %s due to no interface name.\n", key);
+ } else {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Adding Chat Application '%s'\n", ptr->interface_name);
+ if (switch_event_create(&event, SWITCH_EVENT_MODULE_LOAD) == SWITCH_STATUS_SUCCESS) {
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "application");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "description", switch_str_nil(ptr->short_desc));
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "syntax", switch_str_nil(ptr->syntax));
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "key", new_module->key);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "filename", new_module->filename);
+ switch_event_fire(&event);
+ }
+ switch_core_hash_insert(loadable_modules.chat_application_hash, ptr->interface_name, (const void *) ptr);
+ }
+ }
+ }
+
if (new_module->module_interface->api_interface) {
const switch_api_interface_t *ptr;
}
-SWITCH_DECLARE(switch_status_t) switch_core_chat_send_args(const char *dest_proto, const char *proto, const char *from, const char *to,
- const char *subject, const char *body, const char *type, const char *hint)
-{
- switch_event_t *message_event;
- switch_status_t status;
+#define CHAT_MAX_MSG_QUEUE 101
+#define CHAT_QUEUE_SIZE 5000
- if (switch_event_create(&message_event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
- switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "proto", proto);
- switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "from", from);
- switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "to", to);
- switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "subject", subject);
- switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "type", type);
- switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "hint", hint);
-
- if (body) {
- switch_event_add_body(message_event, "%s", body);
- }
- } else {
- abort();
- }
-
- status = switch_core_chat_send(dest_proto, message_event);
+static struct {
+ switch_queue_t *msg_queue[CHAT_MAX_MSG_QUEUE];
+ switch_thread_t *msg_queue_thread[CHAT_MAX_MSG_QUEUE];
+ int msg_queue_len;
+ switch_mutex_t *mutex;
+ switch_memory_pool_t *pool;
+ int running;
+} chat_globals;
- switch_event_destroy(&message_event);
+static int IDX = 0;
- return status;
-
-}
-SWITCH_DECLARE(switch_status_t) switch_core_chat_send(const char *dest_proto, switch_event_t *message_event)
+static switch_status_t do_chat_send(switch_event_t *message_event)
{
switch_chat_interface_t *ci;
switch_hash_index_t *hi;
const void *var;
void *val;
+ const char *proto;
+ const char *replying;
+ const char *dest_proto;
+ int do_skip = 0;
/*
- const char *proto;
+
const char *from;
const char *to;
const char *subject;
const char *hint;
*/
+
+
+ dest_proto = switch_event_get_header(message_event, "dest_proto");
+
if (!dest_proto) {
return SWITCH_STATUS_FALSE;
}
/*
- proto = switch_event_get_header(message_event, "proto");
+
from = switch_event_get_header(message_event, "from");
to = switch_event_get_header(message_event, "to");
subject = switch_event_get_header(message_event, "subject");
hint = switch_event_get_header(message_event, "hint");
*/
-
- if (!strcasecmp(dest_proto, "GLOBAL")) {
+ proto = switch_event_get_header(message_event, "proto");
+ replying = switch_event_get_header(message_event, "replying");
+
+ if (!switch_true(replying) && !switch_stristr("global", proto)) {
switch_mutex_lock(loadable_modules.mutex);
for (hi = switch_hash_first(NULL, loadable_modules.chat_hash); hi; hi = switch_hash_next(hi)) {
switch_hash_this(hi, &var, NULL, &val);
if ((ci = (switch_chat_interface_t *) val)) {
if (ci->chat_send && !strncasecmp(ci->interface_name, "GLOBAL_", 7)) {
- if ((status = ci->chat_send(message_event)) != SWITCH_STATUS_SUCCESS) {
+ status = ci->chat_send(message_event);
+
+ if (status == SWITCH_STATUS_BREAK) {
+ do_skip = 1;
+ }
+
+ if (status != SWITCH_STATUS_SUCCESS && status != SWITCH_STATUS_BREAK) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Chat Interface Error [%s]!\n", dest_proto);
break;
- }
+ }
}
}
}
switch_mutex_unlock(loadable_modules.mutex);
- } else {
+ }
+
+ if (!do_skip && !switch_stristr("GLOBAL", dest_proto)) {
if (!(ci = switch_loadable_module_get_chat_interface(dest_proto)) || !ci->chat_send) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid chat interface [%s]!\n", dest_proto);
return SWITCH_STATUS_FALSE;
return status;
}
+static void chat_process_event(switch_event_t **eventp)
+{
+ switch_event_t *event;
+
+ switch_assert(eventp);
+
+ event = *eventp;
+ *eventp = NULL;
+
+ do_chat_send(event);
+ switch_event_destroy(&event);
+}
+
+
+void *SWITCH_THREAD_FUNC chat_thread_run(switch_thread_t *thread, void *obj)
+{
+ void *pop;
+ switch_queue_t *q = (switch_queue_t *) obj;
+
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Chat Thread Started\n");
+
+
+ while(switch_queue_pop(q, &pop) == SWITCH_STATUS_SUCCESS && pop) {
+ switch_event_t *event = (switch_event_t *) pop;
+ chat_process_event(&event);
+ switch_cond_next();
+ }
+
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Chat Thread Ended\n");
+
+ return NULL;
+}
+
+
+static void chat_thread_start(int idx)
+{
+
+ if (idx >= CHAT_MAX_MSG_QUEUE || (idx < chat_globals.msg_queue_len && chat_globals.msg_queue_thread[idx])) {
+ return;
+ }
+
+ switch_mutex_lock(chat_globals.mutex);
+
+ if (idx >= chat_globals.msg_queue_len) {
+ int i;
+ chat_globals.msg_queue_len = idx + 1;
+
+ for (i = 0; i < chat_globals.msg_queue_len; i++) {
+ if (!chat_globals.msg_queue[i]) {
+ switch_threadattr_t *thd_attr = NULL;
+
+ switch_queue_create(&chat_globals.msg_queue[i], CHAT_QUEUE_SIZE, chat_globals.pool);
+
+ switch_threadattr_create(&thd_attr, chat_globals.pool);
+ switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
+ //switch_threadattr_priority_increase(thd_attr);
+ switch_thread_create(&chat_globals.msg_queue_thread[i],
+ thd_attr,
+ chat_thread_run,
+ chat_globals.msg_queue[i],
+ chat_globals.pool);
+ }
+ }
+ }
+
+ switch_mutex_unlock(chat_globals.mutex);
+}
+
+
+static void chat_queue_message(switch_event_t **eventp)
+{
+ int idx = 0;
+ switch_event_t *event;
+
+ switch_assert(eventp);
+
+ event = *eventp;
+ *eventp = NULL;
+
+ if (chat_globals.running == 0) {
+ chat_process_event(&event);
+ return;
+ }
+
+ again:
+
+ switch_mutex_lock(chat_globals.mutex);
+ idx = IDX;
+ IDX++;
+ if (IDX >= chat_globals.msg_queue_len) IDX = 0;
+ switch_mutex_unlock(chat_globals.mutex);
+
+ chat_thread_start(idx);
+
+ if (switch_queue_trypush(chat_globals.msg_queue[idx], event) != SWITCH_STATUS_SUCCESS) {
+ if (chat_globals.msg_queue_len < CHAT_MAX_MSG_QUEUE) {
+ chat_thread_start(idx + 1);
+ goto again;
+ } else {
+ switch_queue_push(chat_globals.msg_queue[idx], event);
+ }
+ }
+}
+
+
+SWITCH_DECLARE(switch_status_t) switch_core_execute_chat_app(switch_event_t *message, const char *app, const char *data)
+{
+ switch_chat_application_interface_t *cai;
+ switch_status_t status = SWITCH_STATUS_SUCCESS;
+ char *expanded;
+
+ if (!(cai = switch_loadable_module_get_chat_application_interface(app)) || !cai->chat_application_function) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid chat application interface [%s]!\n", app);
+ return SWITCH_STATUS_FALSE;
+ }
+
+ if (switch_test_flag(message, EF_NO_CHAT_EXEC)) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Message is not allowed to execute apps\n");
+ switch_goto_status(SWITCH_STATUS_FALSE, end);
+ }
+
+ expanded = switch_event_expand_headers(message, data);
+
+ status = cai->chat_application_function(message, expanded);
+
+ if (expanded != data) {
+ free(expanded);
+ }
+
+ end:
+
+ UNPROTECT_INTERFACE(cai);
+
+ return status;
+
+}
+
+
+
+SWITCH_DECLARE(switch_status_t) switch_core_chat_send_args(const char *dest_proto, const char *proto, const char *from, const char *to,
+ const char *subject, const char *body, const char *type, const char *hint)
+{
+ switch_event_t *message_event;
+ switch_status_t status;
+
+ if (switch_event_create(&message_event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
+ switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "proto", proto);
+ switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "from", from);
+ switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "to", to);
+ switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "subject", subject);
+ switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "type", type);
+ switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "hint", hint);
+
+ if (body) {
+ switch_event_add_body(message_event, "%s", body);
+ }
+ } else {
+ abort();
+ }
+
+ if (dest_proto) {
+ switch_event_add_header_string(message_event, SWITCH_STACK_BOTTOM, "dest_proto", dest_proto);
+ }
+
+ chat_queue_message(&message_event);
+ status = SWITCH_STATUS_SUCCESS;
+
+ return status;
+
+}
+
+
+SWITCH_DECLARE(switch_status_t) switch_core_chat_send(const char *dest_proto, switch_event_t *message_event)
+{
+ switch_event_t *dup;
+
+ switch_event_dup(&dup, message_event);
+
+ if (dest_proto) {
+ switch_event_add_header_string(dup, SWITCH_STACK_BOTTOM, "dest_proto", dest_proto);
+ }
+
+ chat_queue_message(&dup);
+ return SWITCH_STATUS_SUCCESS;
+}
+
+
+SWITCH_DECLARE(switch_status_t) switch_core_chat_deliver(const char *dest_proto, switch_event_t **message_event)
+{
+
+ if (dest_proto) {
+ switch_event_add_header_string(*message_event, SWITCH_STACK_BOTTOM, "dest_proto", dest_proto);
+ }
+
+ chat_queue_message(message_event);
+
+ return SWITCH_STATUS_SUCCESS;
+}
+
static switch_status_t switch_loadable_module_unprocess(switch_loadable_module_t *old_module)
{
}
}
+ if (old_module->module_interface->chat_application_interface) {
+ const switch_chat_application_interface_t *ptr;
+ for (ptr = old_module->module_interface->chat_application_interface; ptr; ptr = ptr->next) {
+ if (ptr->interface_name) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Deleting Application '%s'\n", ptr->interface_name);
+ switch_core_session_hupall_matching_var(SWITCH_CURRENT_APPLICATION_VARIABLE, ptr->interface_name, SWITCH_CAUSE_MANAGER_REQUEST);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Write lock interface '%s' to wait for existing references.\n",
+ ptr->interface_name);
+ if (switch_thread_rwlock_trywrlock_timeout(ptr->rwlock, 10) == SWITCH_STATUS_SUCCESS) {
+ switch_thread_rwlock_unlock(ptr->rwlock);
+ } else {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Giving up on '%s' waiting for existing references.\n", ptr->interface_name);
+ }
+
+ if (switch_event_create(&event, SWITCH_EVENT_MODULE_UNLOAD) == SWITCH_STATUS_SUCCESS) {
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "type", "application");
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "name", ptr->interface_name);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "description", switch_str_nil(ptr->short_desc));
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "syntax", switch_str_nil(ptr->syntax));
+ switch_event_fire(&event);
+ }
+ switch_core_hash_delete(loadable_modules.chat_application_hash, ptr->interface_name);
+ }
+ }
+ }
+
if (old_module->module_interface->api_interface) {
const switch_api_interface_t *ptr;
switch_core_hash_init_nocase(&loadable_modules.codec_hash, loadable_modules.pool);
switch_core_hash_init_nocase(&loadable_modules.timer_hash, loadable_modules.pool);
switch_core_hash_init_nocase(&loadable_modules.application_hash, loadable_modules.pool);
+ switch_core_hash_init_nocase(&loadable_modules.chat_application_hash, loadable_modules.pool);
switch_core_hash_init_nocase(&loadable_modules.api_hash, loadable_modules.pool);
switch_core_hash_init(&loadable_modules.file_hash, loadable_modules.pool);
switch_core_hash_init_nocase(&loadable_modules.speech_hash, loadable_modules.pool);
switch_loadable_module_runtime();
+ chat_globals.running = 1;
+ memset(&chat_globals, 0, sizeof(chat_globals));
+ chat_globals.pool = loadable_modules.pool;
+ switch_mutex_init(&chat_globals.mutex, SWITCH_MUTEX_NESTED, chat_globals.pool);
+
+ chat_thread_start(1);
+
return SWITCH_STATUS_SUCCESS;
}
switch_hash_index_t *hi;
void *val;
switch_loadable_module_t *module;
+ int i;
if (!loadable_modules.module_hash) {
return;
}
+ chat_globals.running = 0;
+
+ for (i = 0; i < chat_globals.msg_queue_len; i++) {
+ switch_queue_push(chat_globals.msg_queue[i], NULL);
+ }
+
+ for (i = 0; i < chat_globals.msg_queue_len; i++) {
+ switch_status_t st;
+ switch_thread_join(&st, chat_globals.msg_queue_thread[i]);
+ }
+
+
for (hi = switch_hash_first(NULL, loadable_modules.module_hash); hi; hi = switch_hash_next(hi)) {
switch_hash_this(hi, NULL, NULL, &val);
module = (switch_loadable_module_t *) val;
switch_core_hash_destroy(&loadable_modules.codec_hash);
switch_core_hash_destroy(&loadable_modules.timer_hash);
switch_core_hash_destroy(&loadable_modules.application_hash);
+ switch_core_hash_destroy(&loadable_modules.chat_application_hash);
switch_core_hash_destroy(&loadable_modules.api_hash);
switch_core_hash_destroy(&loadable_modules.file_hash);
switch_core_hash_destroy(&loadable_modules.speech_hash);
HASH_FUNC(dialplan)
HASH_FUNC(timer)
HASH_FUNC(application)
+HASH_FUNC(chat_application)
HASH_FUNC(api)
HASH_FUNC(file)
HASH_FUNC(speech)
case SWITCH_APPLICATION_INTERFACE:
ALLOC_INTERFACE(application)
+ case SWITCH_CHAT_APPLICATION_INTERFACE:
+ ALLOC_INTERFACE(chat_application)
+
case SWITCH_API_INTERFACE:
ALLOC_INTERFACE(api)
switch_channel_add_variable_var_check(channel, var, val, SWITCH_FALSE, SWITCH_STACK_PUSH);
}
+SWITCH_DECLARE_NONSTD(void) switch_regex_set_event_header_callback(const char *var, const char *val, void *user_data)
+{
+
+ switch_event_t *event = (switch_event_t *) user_data;
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, var, val);
+}
+
/* For Emacs:
{"directory", SWITCH_XML_SECTION_DIRECTORY},
{"dialplan", SWITCH_XML_SECTION_DIALPLAN},
{"phrases", SWITCH_XML_SECTION_PHRASES},
+ {"chatplan", SWITCH_XML_SECTION_CHATPLAN},
{NULL, 0}
};