mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-07-25 03:10:39 +00:00
add hangup dp app
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3893 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
6bc5a49b72
commit
64bc419497
@ -128,10 +128,27 @@ static void phrase_function(switch_core_session_t *session, char *data)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void hangup_function(switch_core_session_t *session, char *data)
|
||||||
|
{
|
||||||
|
switch_channel_t *channel;
|
||||||
|
switch_call_cause_t cause = SWITCH_CAUSE_NORMAL_CLEARING;
|
||||||
|
|
||||||
|
channel = switch_core_session_get_channel(session);
|
||||||
|
assert(channel != NULL);
|
||||||
|
|
||||||
|
if (!switch_strlen_zero((char *) data)) {
|
||||||
|
cause = switch_channel_str2cause((char *) data);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch_channel_hangup(channel, cause);
|
||||||
|
}
|
||||||
|
|
||||||
static void answer_function(switch_core_session_t *session, char *data)
|
static void answer_function(switch_core_session_t *session, char *data)
|
||||||
{
|
{
|
||||||
switch_channel_t *channel;
|
switch_channel_t *channel;
|
||||||
channel = switch_core_session_get_channel(session);
|
channel = switch_core_session_get_channel(session);
|
||||||
|
|
||||||
assert(channel != NULL);
|
assert(channel != NULL);
|
||||||
switch_channel_answer(channel);
|
switch_channel_answer(channel);
|
||||||
}
|
}
|
||||||
@ -468,13 +485,24 @@ static const switch_application_interface_t log_application_interface = {
|
|||||||
/*.next */ &info_application_interface
|
/*.next */ &info_application_interface
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static const switch_application_interface_t hangup_application_interface = {
|
||||||
|
/*.interface_name */ "hangup",
|
||||||
|
/*.application_function */ hangup_function,
|
||||||
|
/* long_desc */ "Hangup the call for a channel.",
|
||||||
|
/* short_desc */ "Hangup the call",
|
||||||
|
/* syntax */ "[<cause>]",
|
||||||
|
/*.next */ &log_application_interface
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
static const switch_application_interface_t answer_application_interface = {
|
static const switch_application_interface_t answer_application_interface = {
|
||||||
/*.interface_name */ "answer",
|
/*.interface_name */ "answer",
|
||||||
/*.application_function */ answer_function,
|
/*.application_function */ answer_function,
|
||||||
/* long_desc */ "Answer the call for a channel.",
|
/* long_desc */ "Answer the call for a channel.",
|
||||||
/* short_desc */ "Answer the call",
|
/* short_desc */ "Answer the call",
|
||||||
/* syntax */ "",
|
/* syntax */ "",
|
||||||
/*.next */ &log_application_interface
|
/*.next */ &hangup_application_interface
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user