mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-11 12:07:06 +00:00
add mod_perl
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@740 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
9d8a280cde
commit
32a7b3c2ca
11 files changed
+1929
-58
No files matched your search
@@ -0,0 +1,68 @@
|
||||
#include <switch.h>
|
||||
|
||||
void fs_console_log(char *msg)
|
||||
{
|
||||
switch_console_printf(SWITCH_CHANNEL_CONSOLE, msg);
|
||||
}
|
||||
|
||||
void fs_console_clean(char *msg)
|
||||
{
|
||||
switch_console_printf(SWITCH_CHANNEL_CONSOLE_CLEAN, msg);
|
||||
}
|
||||
|
||||
struct switch_core_session *fs_core_session_locate(char *uuid)
|
||||
{
|
||||
return switch_core_session_locate(uuid);
|
||||
}
|
||||
|
||||
void fs_channel_answer(struct switch_core_session *session)
|
||||
{
|
||||
switch_channel *channel = switch_core_session_get_channel(session);
|
||||
switch_channel_answer(channel);
|
||||
}
|
||||
|
||||
void fs_channel_pre_answer(struct switch_core_session *session)
|
||||
{
|
||||
switch_channel *channel = switch_core_session_get_channel(session);
|
||||
switch_channel_pre_answer(channel);
|
||||
}
|
||||
|
||||
void fs_channel_hangup(struct switch_core_session *session)
|
||||
{
|
||||
switch_channel *channel = switch_core_session_get_channel(session);
|
||||
switch_channel_hangup(channel);
|
||||
}
|
||||
|
||||
void fs_channel_set_variable(struct switch_core_session *session, char *var, char *val)
|
||||
{
|
||||
switch_channel *channel = switch_core_session_get_channel(session);
|
||||
switch_channel_set_variable(channel, var, val);
|
||||
}
|
||||
|
||||
void fs_channel_get_variable(struct switch_core_session *session, char *var)
|
||||
{
|
||||
switch_channel *channel = switch_core_session_get_channel(session);
|
||||
switch_channel_get_variable(channel, var);
|
||||
}
|
||||
|
||||
void fs_channel_set_state(struct switch_core_session *session, char *state)
|
||||
{
|
||||
switch_channel *channel = switch_core_session_get_channel(session);
|
||||
switch_channel_state fs_state = switch_channel_get_state(channel);
|
||||
|
||||
if (!strcmp(state, "EXECUTE")) {
|
||||
fs_state = CS_EXECUTE;
|
||||
} else if (!strcmp(state, "TRANSMIT")) {
|
||||
fs_state = CS_TRANSMIT;
|
||||
}
|
||||
|
||||
switch_channel_set_state(channel, fs_state);
|
||||
}
|
||||
|
||||
int fs_ivr_play_file(struct switch_core_session *session, char *file, char *timer_name_in)
|
||||
{
|
||||
char *timer_name = switch_strlen_zero(timer_name_in) ? NULL : timer_name;
|
||||
switch_status status = switch_ivr_play_file(session, NULL, file, timer_name, NULL, NULL, 0);
|
||||
return status == SWITCH_STATUS_SUCCESS ? 1 : 0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user