提交 e884116c authored 作者: Anthony Minessale's avatar Anthony Minessale

add answer work tag to httapi

上级 8a3cdc75
......@@ -230,6 +230,12 @@ action : Change url to submit to.
temp-action : Change url to submit to. just for the next loop.
<answer is-conference>
: Answer the call
ATTRS:
is-conference : true|false (set the conference flag for RFC4579 stuff.
<hangup cause action>
: Hangup the call
......
......@@ -877,6 +877,19 @@ static switch_status_t parse_hangup(const char *tag_name, client_t *client, swit
return SWITCH_STATUS_FALSE;
}
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);
}
switch_channel_answer(client->channel);
return SWITCH_STATUS_FALSE;
}
static switch_status_t parse_record_call(const char *tag_name, client_t *client, switch_xml_t tag, const char *body)
{
const char *limit_ = switch_xml_attr(tag, "limit");
......@@ -2997,6 +3010,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_httapi_load)
bind_parser("sms", parse_sms);
bind_parser("dial", parse_dial);
bind_parser("pause", parse_playback);
bind_parser("answer", parse_answer);
bind_parser("hangup", parse_hangup);
bind_parser("record", parse_record);
bind_parser("recordCall", parse_record_call);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论