[prev in list] [next in list] [prev in thread] [next in thread] 

List:       asterisk-dev
Subject:    [Asterisk-Dev] UPDATED: Patch to add INVALID_EXTEN variable
From:       Eric Wieling <eric () fnords ! org>
Date:       2003-06-24 21:27:23
Message-ID: 1056490043.4229.153.camel () vulcan ! fnords ! org
[Download RAW message or body]

Apparently there are two places that need to be modified, not just one. 
Updated patch is attached.

Attached is a small patch to pbx.c to set the variable INVALID_EXTEN
when exten => i is called, so you can know what the originally dialed
invalid extension was.  You can then do something like this:

exten => i,1,Playback(extension)
exten => i,2,SayDigits(${INVALID_EXTEN})
exten => i,3,Playback(isnotvalid)
exten => i,4,Hangup

--Eric
-- 
BTEL Consulting
850-484-4535 x2111 (Office)
504-595-3916 x2111 (Experimental)
877-552-0838 (Backup Phone)

["invalid-exten.diff" (invalid-exten.diff)]

*** pbx.c-orig	2003-06-24 11:50:35.000000000 -0500
--- pbx.c	2003-06-24 16:21:07.000000000 -0500
***************
*** 1726,1731 ****
--- 1726,1732 ----
  			if (ast_exists_extension(c, c->context, "i", 1, c->callerid)) {
  				if (option_verbose > 2)
  					ast_verbose(VERBOSE_PREFIX_3 "Sent into invalid extension '%s' in context '%s' \
on %s\n", c->exten, c->context, c->name); + 				pbx_builtin_setvar_helper(c, \
"INVALID_EXTEN", c->exten);  strncpy(c->exten, "i", sizeof(c->exten)-1);
  				c->priority = 1;
  			} else {
***************
*** 1770,1775 ****
--- 1771,1777 ----
  					if (ast_exists_extension(c, c->context, "i", 1, c->callerid)) {
  						if (option_verbose > 2)
  							ast_verbose( VERBOSE_PREFIX_3 "Invalid extension '%s' in context '%s' on \
%s\n", exten, c->context, c->name); + 						pbx_builtin_setvar_helper(c, \
"INVALID_EXTEN", exten);  strncpy(c->exten, "i", sizeof(c->exten)-1);
  						c->priority = 1;
  					} else {



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic