提交 2ea31f5d authored 作者: Anthony Minessale's avatar Anthony Minessale

add preAnswer and ringReady too

上级 41c1c1cb
......@@ -237,6 +237,13 @@ ATTRS:
is-conference : true|false (set the conference flag for RFC4579 stuff.
<preAnswer>
: Establish media on the call without answering.
<ringReady>
: Indicate ringing to an unaswered channel.
<hangup cause action>
: Hangup the call
......
......@@ -879,13 +879,20 @@ static switch_status_t parse_hangup(const char *tag_name, client_t *client, swit
static switch_status_t parse_answer(const char *tag_name, client_t *client, switch_xml_t tag, const char *body)
{
const char *conf = switch_xml_attr(tag, "is-conference");
if (conf && switch_true(conf)) {
switch_channel_set_flag(client->channel, CF_CONFERENCE);
}
if (!strcasecmp(tag_name, "answer")) {
const char *conf = switch_xml_attr(tag, "is-conference");
if (conf && switch_true(conf)) {
switch_channel_set_flag(client->channel, CF_CONFERENCE);
}
switch_channel_answer(client->channel);
switch_channel_answer(client->channel);
} else if (!strcasecmp(tag_name, "preAnswer")) {
switch_channel_pre_answer(client->channel);
} else if (!strcasecmp(tag_name, "ringReady")) {
switch_channel_ring_ready(client->channel);
}
return SWITCH_STATUS_FALSE;
}
......@@ -3011,6 +3018,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_httapi_load)
bind_parser("dial", parse_dial);
bind_parser("pause", parse_playback);
bind_parser("answer", parse_answer);
bind_parser("preAnswer", parse_answer);
bind_parser("ringReady", parse_answer);
bind_parser("hangup", parse_hangup);
bind_parser("record", parse_record);
bind_parser("recordCall", parse_record_call);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论