]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add voicemail work tag
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 9 Jan 2012 21:00:26 +0000 (15:00 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 9 Jan 2012 21:00:26 +0000 (15:00 -0600)
src/mod/applications/mod_httapi/mod_httapi.c
src/mod/applications/mod_httapi/mod_httapi_doc.txt

index 8a668bbd80f1af733793d672366d9d35d2e1649a..98aba3ae032c20a849006ed06b61432426442f3c 100644 (file)
@@ -238,6 +238,49 @@ static switch_status_t digit_nomatch_action_callback(switch_ivr_dmachine_match_t
        return SWITCH_STATUS_BREAK;
 }
 
+
+static switch_status_t parse_voicemail(const char *tag_name, client_t *client, switch_xml_t tag, const char *body)
+{
+       const char *check = switch_xml_attr(tag, "check");
+       const char *auth = switch_xml_attr(tag, "auth-only");
+       const char *profile = switch_xml_attr(tag, "profile");
+       const char *domain = switch_xml_attr(tag, "domain");
+       const char *id = switch_xml_attr(tag, "id");
+       char *ddom = NULL;
+       char *str;
+       switch_status_t status;
+
+       if (zstr(profile)) profile = "default";
+
+       if (zstr(domain)) {
+               if ((ddom = switch_core_get_variable_dup("domain"))) {
+                       domain = ddom;
+               }
+       }
+
+       if (switch_true(check)) {
+               check = "check";
+       } else {
+               check = "";
+       }
+
+       if (switch_true(auth)) {
+               auth = "auth_only";
+       } else {
+               auth = "";
+       }
+
+       str = switch_core_session_sprintf(client->session, "%s %s %s %s %s", check, auth, profile, domain, id);
+
+       while(*str == ' ') str++;
+
+       status = switch_core_session_execute_application(client->session, "voicemail", str);
+
+       switch_safe_free(ddom);
+
+       return status;
+}
+
 static switch_status_t parse_break(const char *tag_name, client_t *client, switch_xml_t tag, const char *body)
 {
        return SWITCH_STATUS_FALSE;
@@ -2599,6 +2642,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_httapi_load)
        bind_parser("log", parse_log);
        bind_parser("continue", parse_continue);
        bind_parser("setVar", parse_get_var);
+       bind_parser("voicemail", parse_voicemail);
 
        if (do_config() != SWITCH_STATUS_SUCCESS) {
                return SWITCH_STATUS_FALSE;
index cb5463dca437f15048ba851728bd67893c40db95..92f24409a4d4169af3cb13acb706eb8154febab5 100644 (file)
@@ -258,6 +258,19 @@ temp-action            : Change url to submit to. just for the next loop.
 permanent          : Add as a permanent param or just once.
 
 
+<voicemail action temp-action check auth-only profile domain id/>
+                    : Get a Channel variable (depends on permissions)
+
+ATTRS:
+action             : Change url to submit to.
+temp-action        : Change url to submit to. just for the next loop.
+check              : true to check (omit to leave)
+auth-only          : authenticate only and move on
+profile                    : profile name to use (omit for "default")
+domain             : domain to use (omit for global domain variable)
+id                 : id to use (omit to prompt for id)
+
+