Invalid number catch

Comment on Asterisk i extension
Joined: Wed 29 of Sep, 2010

Invalid number catch

Posted:Wed 29 of Sep, 2010 (00:53 UTC)
As 'i' only works on extensions dialed once the line has been picked up, it will not work on numbers dialed that are not bound/set in the extensions.conf/ael file. Below is a simple example for catching an extension that is not handled in the dialplan (e.g invalid number). Ensure to include this at the bottom of the extensions.conf/ael file so as to not override any previous extensions, also note that an invalid number will 'soft hangup' after the _. extension match has completed, this may cause another run of ._ (as it matches 'h' in this context) unless handled. This has been tested and confirmed working on


  1. include "somethingelse.ael";
  2. include "invalidnumber.ael";

context default {
includes {

h => {
// Have a registered/answered extension hangup handled here

includes {
// invalid number context allows handling of calls to numbers
// which have not been bound to a context. The import/include
// must be done after all extension information above, otherwise
// this context will override other extensions created after it


context invalidnumber {
// all unbound/unregistered calls will be grabbed here

_. => {
// Example to set logging information in database via custom ODBC calls