Asterisk cmd DISA


DISA (Direct Inward System Access)


  • DISA(passcode[,context[,callerid[,mailbox[@vmcontext]]]])
  • DISA(password file[,callerid[,mailbox[@vmcontext]]])

DISA (Direct Inward System Access) allows someone calling in from outside the telephone switch (PBX) to obtain an "internal" system dialtone and dial calls as if from one of the extensions attached to the telephone switch. Frequently the user calls a number DISA number with invokes the DISA application. The DISA application in turn requires the user to enter his passcode, followed by the pound sign (#). If the passcode is correct, the user will hear dialtone on which a call may be placed. Obviously, this type of access has SERIOUS security implications, and GREAT care must be taken NOT to compromise your security.

If the password parameter is "no-password", then the DISA application will provide dial tone without first requiring a password. Obviously, this should only be done if the user's identity has already been proved by some other means or the set of numbers which can be dialed is tightly controlled.


If all you want is an immediate dialtone you could also dial your gateway technology (Zaptel, Dadhi, Capi, Srx...) with no target specified (see the double // in the example), e.g.:

exten => s,1,Dial(Srx/tgExternalPtP//${CALLERIDNUM}) ; example for Sirrix cards

In the CAPI world the term "early B3" can be used for a closely related - but not similar - way to arrange your configuration.

Example 1

exten => s,1,DISA(no-password,local)

Example 2

exten => s/XXXXXXXXXX,1,Answer
exten => s/XXXXXXXXXX,2,Set(TIMEOUT(digit)=3)
exten => s/XXXXXXXXXX,3,Set(TIMEOUT(response)=5)
exten => s/XXXXXXXXXX,4,Authenticate(XXXXX)
exten => s/XXXXXXXXXX,5,DISA(no-password,mycontext)

Replace the XXXXX's with the appropriate Caller ID number and PIN and DISA will give you a dial tone which can be used to dial any number in mycontext. Just remember that seemingly trivial errors can grant free-for-all access to your outgoing trunks and cost you a lot of money!

The arguments to this application (in extensions.conf ) allow either specification of a single global password (that everyone uses), or individual passwords contained in a file. It also allows specification of the context on which the user will be dialing. If no context is specified, the DISA application defaults the context to "disa" presumably that a normal system will have a special context set up for DISA use with some or a lot of restrictions. The arguments are one of the following:

  • numeric-passcode
  • numeric-passcode|context
  • full-pathname-of-file-that-contains-passcodes

The file that contains the passcodes (if used) allows specification of either just a passcode (defaulting to the "disa" context, or passcode|context on each line of the file. The file may contain blank lines, or comments starting with "#" or ";". In addition, the above arguments may have |new-callerid-string appended to them, to
specify a new (different) callerid to be used for this call, for example:

numeric-passcode|context|"My Phone" <(234) 123-4567>


full-pathname-of-passcode-file|"My Phone" <(234) 123-4567>

Note that in the case of specifying the numeric-passcode, the context must be specified if the callerid is specified also.

Versions of Asterisk 1.6 or above no longer use the pipe symbol (|) as a field separator in the file containing the passcodes. Instead, a comma (,) must be used to separate fields. Therefore, the above example for v1.6 or v1.8 will look like:

numeric-passcode,context,"My Phone" <(234) 123-4567>


full-pathname-of-passcode-file,"My Phone" <(234) 123-4567>

Return codes

If login is successful, the application parses the dialed number in the specified (or default) context, and returns 0 with the new extension context filled-in and the priority set to 1, so that the PBX may re-apply the routing tables to it and complete the call normally.

Example 3

Modified by G. Powell

include => voicemail
include => from-sip

exten => 123,1,Dial(Sip/123)
exten => 1234,1,Dial(Sip/1234)

exten => 5000,1,VoiceMailMain

exten => s,1,Answer
exten => s,2,Background(Sound-file)
exten => 000,1,DISA(no-password,default)

  • Call comes from PSTN
  • Asterisk answers it (incoming context)
  • The person decides to call 000, which would give them a second dial tone generated by asterisk
  • From there they could dial anyone of the sip phones or access Voicemail.

A setup like this really compromises security, so I suggest using a password. Don't watch the fact that I didn't use a password.

See also:

Asterisk | Applications | Functions | Variables | Expressions | Asterisk FAQ

Created by: oej, Last modification: Wed 09 of Feb, 2011 (06:11 UTC) by chandave
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+