]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add answer work tag to httapi
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 27 Jun 2013 21:25:59 +0000 (16:25 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 27 Jun 2013 21:25:59 +0000 (16:25 -0500)
src/mod/applications/mod_httapi/docs/mod_httapi_doc.txt
src/mod/applications/mod_httapi/mod_httapi.c

index f659db39af54aee645fd77723a63172bcfc2be20..399ea1a335099768145cc5f69f23e3b5d92949ed 100644 (file)
@@ -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
index 005f66bdbd43e1bce3682dd8fb0c0f87405c7b84..8b76f36101a215993519d8d9c64a23e7a207a95c 100644 (file)
@@ -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);