From Funky Motmot, 9 Years ago, written in C.
This paste is a reply to Untitled from Eratic Goat
- go back
Embed
Viewing differences between Untitled and Re: Untitled
\nstatic switch_digit_action_target_t str2target(const char *target_str)
{
        if (!strcasecmp(target_str, "peer")) {
                return DIGIT_TARGET_PEER;
        }

        if (!strcasecmp(target_str, "both")) {
                return DIGIT_TARGET_BOTH;
        }

        return DIGIT_TARGET_SELF;
}

#define CLEAR_DIGIT_ACTION_USAGE "<realm>|all[,target]"
SWITCH_STANDARD_APP(clear_digit_action_function)
{
        //switch_channel_t *channel = switch_core_session_get_channel(session);
        switch_ivr_dmachine_t *dmachine;
        char *realm = NULL;
        char *target_str;
        switch_digit_action_target_t target = DIGIT_TARGET_SELF;

        if (zstr((char *)data)) {
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "clear_digit_action called with no args");
                return;
        }