All pastes #9623 Raw Edit

Unnamed

public text v1 · immutable
#9623 ·published 2005-04-15 20:36 UTC
rendered paste body
diff -u -r1.222 pbx.c
--- pbx.c       3 Apr 2005 22:24:17 -0000       1.222
+++ pbx.c       15 Apr 2005 19:36:02 -0000
@@ -2247,11 +2247,17 @@
        c->pbx->dtimeout = 5;

        /* Start by trying whatever the channel is set to */
-       if (!ast_exists_extension(c, c->context, c->exten, c->priority, c->cid.cid_num)) {
-               /* JK02: If not successfull fall back to 's' */
+       if(ast_strlen_zero(c->exten)) {
                if (option_verbose > 1)
-                       ast_verbose( VERBOSE_PREFIX_2 "Starting %s at %s,%s,%d failed so falling back to exten 's'\n", c->name, c->context, c->exten, c->priority);
+                       ast_verbose( VERBOSE_PREFIX_2 "No extension given, defaulting to exten 's'\n");
                strncpy(c->exten, "s", sizeof(c->exten)-1);
+       }
+
+       if (!ast_exists_extension(c, c->context, c->exten, c->priority, c->cid.cid_num)) {
+               /* extension not found, jump to 'i' */
+               if (option_verbose > 1)
+                       ast_verbose( VERBOSE_PREFIX_2 "Starting %s at %s,%s,%d failed, jumping to exten 'i'\n", c->name, c->context, c->exten, c->priority);
+               strncpy(c->exten, "i", sizeof(c->exten)-1);
                if (!ast_exists_extension(c, c->context, c->exten, c->priority, c->cid.cid_num)) {
                        /* JK02: And finally back to default if everything else failed */
                        if (option_verbose > 1)