Add 'prefix' parameter to 'goto' action
[lcr.git] / route.c
diff --git a/route.c b/route.c
index ce8dcf6..6fa0adb 100644 (file)
--- a/route.c
+++ b/route.c
@@ -339,7 +339,7 @@ struct action_defs action_defs[] = {
 //       "Caller calls the timer."},
        { ACTION_GOTO,
          "goto",       NULL, &EndpointAppPBX::action_dialing_goto, NULL,
-         PARAM_PROCEEDING | PARAM_ALERTING | PARAM_CONNECT | PARAM_RULESET | PARAM_STRIP | PARAM_SAMPLE,
+         PARAM_PROCEEDING | PARAM_ALERTING | PARAM_CONNECT | PARAM_RULESET | PARAM_STRIP | PARAM_PREFIX | PARAM_SAMPLE,
          "Jump to given ruleset and optionally play sample. Dialed digits are not flushed."},
        { ACTION_MENU,
          "menu",       NULL, &EndpointAppPBX::action_dialing_menu, NULL,
@@ -2392,7 +2392,7 @@ struct route_action *EndpointAppPBX::route(struct route_ruleset *ruleset)
                                /* we must have greater or equal length to values */
                                if ((unsigned long)strlen(string) < comp_len) {
                                        /* special case for unfinished dialing */
-                                       if (cond->match == MATCH_DIALING) {
+                                       if (cond->match == MATCH_DIALING && !e_dialinginfo.sending_complete) {
                                                couldbetrue = 1; /* could match */
                                                comp_len = strlen(string);
                                        } else {
@@ -2466,7 +2466,8 @@ struct route_action *EndpointAppPBX::route(struct route_ruleset *ruleset)
 
                        cond = cond->next;
                }
-               if (timeout>now_ll && match==1) { /* the matching rule with timeout in the future */
+               /* if sending complete, we use future match now, since waiting does not make sense anymore */
+               if (timeout>now_ll && match==1 && !e_dialinginfo.sending_complete) { /* the matching rule with timeout in the future */
                        if (match_timeout == 0 || timeout < match_timeout) { /* first timeout or lower */
                                /* set timeout in the furture */
                                match_timeout = timeout;