]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add preAnswer and ringReady too
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 27 Jun 2013 21:31:29 +0000 (16:31 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 27 Jun 2013 21:31:29 +0000 (16:31 -0500)
src/mod/applications/mod_httapi/docs/mod_httapi_doc.txt
src/mod/applications/mod_httapi/mod_httapi.c

index 399ea1a335099768145cc5f69f23e3b5d92949ed..b313dc5e15a0b94e10b9e9535a0419cb63322ea6 100644 (file)
@@ -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
 
index 8b76f36101a215993519d8d9c64a23e7a207a95c..52e4a21a6bf2c5d84aa11a68dd52b49863c63abd 100644 (file)
@@ -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);