wiki:asterisk

Asterisk DECT channel driver

The Asterisk DECT channel driver implements the IWU of a DECT FP. See Build instructions for build instructions.

Build instructions

See Build instructions page.

Channel driver configuration

The DECT channel driver's configuration is read from /etc/asterisk/dect.conf. An example configuration file is included in the asterisk source and can be installed by running

make samples

Global DECT options

The global configuration options are contained in the section called [general]. These options are

  • cluster = NAME -- cluster name to bind to
  • context = NAME -- dialplan context for incoming calls
  • language = COUNTRY-CODE -- default language for newly registered PPs
  • regcontext = NAME -- dialplan context in which to create an extension for newly registered PPs
  • regexten_base = NUMBER -- base number to use for allocating new extensions
  • pin = NUMBER -- PIN code (up to 8 digits) to use for registering PPs

The context option specifies the dialplan context in which incoming calls will be placed. When registering a PP, an extension is automatically allocated for the PP. The extension used will be the first unused number starting at the number specified as regexten_base. This extension is registered in the dialplan context specified as regcontext and can be used to route outgoing calls to the PP. Additionally a name of the format DECT-PT-<extension> is allocated for each PP.

Jitter buffer options

An asterisk jitter buffer can be configured using the following options:

  • jbenable = yes/no -- enable jitter buffer, defaults to no
  • jbmaxsize = NUMBER -- maximum buffer size in milliseconds
  • jbimpl = fixed/adaptive -- use fixed or adaptive jitter buffer implementation
  • jblog = yes/no -- enable or disable jitter buffer frame logging, defaults to no

When enabled, the jitter buffer will be used when the sending channel can create jitter. Refer to the asterisk documentation for more details about the jitter buffer.

PP subscription data storage

PP subscription data is stored in the asterisk database under /dect/<IPEI>/.

*CLI> database show

/dect/0298406861222/capabilities/display_capabilities: 5
/dect/0298406861222/capabilities/display_charsets : 0
/dect/0298406861222/capabilities/display_columns  : 10
/dect/0298406861222/capabilities/display_control  : 2
/dect/0298406861222/capabilities/display_lines    : 3
/dect/0298406861222/capabilities/display_memory   : 30
/dect/0298406861222/capabilities/echo_parameters  : 1
/dect/0298406861222/capabilities/noise_rejection  : 1
/dect/0298406861222/capabilities/profile_indicator: 200000000000000
/dect/0298406861222/capabilities/scrolling        : 0
/dect/0298406861222/capabilities/slot_capabilities: 8
/dect/0298406861222/capabilities/tone_capabilities: 2
/dect/0298406861222/capabilities/volume_ctrl      : 1
/dect/0298406861222/codec_list/0/codec            : 3
/dect/0298406861222/codec_list/0/cplane           : 0
/dect/0298406861222/codec_list/0/service          : 0
/dect/0298406861222/codec_list/0/slot             : 1
/dect/0298406861222/codec_list/1/codec            : 2
/dect/0298406861222/codec_list/1/cplane           : 0
/dect/0298406861222/codec_list/1/service          : 0
/dect/0298406861222/codec_list/1/slot             : 4
/dect/0298406861222/cid_name                      : Patrick McHardy
/dect/0298406861222/cid_num                       : 600
/dect/0298406861222/context                       : default
/dect/0298406861222/language                      : de
/dect/0298406861222/name                          : sinus501
/dect/0298406861222/regexten                      : 600
/dect/0298406861222/ring_pattern                  : 0
/dect/0298406861222/uak                           : upS/TqQLli5D8MZAcqpA7w==

The subtrees capabilities and codec_list are automatically updated based on data submitted during the access rights request and location updates and should not be changed manually. The other values might be changed using the database put command. To activate changes made to the database, use the dect reload database command.

CLI commands

The DECT channel driver supports the following CLI commands:

  • dect set debug on/off -- enable/disable libdect debugging
  • dect access-rights enable/disable -- enable/disable access rights requests
  • dect access-rights terminate NAME -- terminate access rights for the given PP
  • dect show portables -- show a list of all registered PPs
  • dect show portable NAME -- show information about a specific PP
  • dect reload database -- reload PT information from database

To pair a PP, access rights requests must be enabled. They are disabled again automatically after 120 seconds or when an access rights request has been successfully completed. During the access rights request, key allocation for the PP is performed, which transforms the PIN into an 128 bit authentication key.

Dialplan

Incoming calls (from PP)

There are two options how to construct the dialplan. The line can be either answered manually using the Answer() command, in which case an asterisk generated dialtone will be played to the phone while waiting for a valid extension, or the dect channel driver can instruct the phone to generate a dialtone itself without answering a line and wait until a valid extension is dialed. For manually picking up the line, use the commands below in your dialplan. For channel controlled pickup, just use a regular dialplan without the Answer() command.

Manually answered:

exten => s,1,Answer                    ; Answer the line
exten => s,n,Set(TIMEOUT(digit)=5)     ; Set Digit Timeout to 5 seconds
exten => s,n,Set(TIMEOUT(response)=10) ; Set Response Timeout to 10 seconds
exten => s,n,WaitExten(,d)             ; Wait for an extension to be dialed.

Outgoing calls (to PP)

Calls to a PP are directed to the DECT channel driver similar as with other channel drivers. Ring patterns can be configured in the dialplan by setting the environment variable RING_PATTERN to a value from 0-7 or silent.

Example using the automatically allocated extensions 600 and 601 in the regcontext dect_register for routing outgoing calls:

include => dect_register                ; regcontext

Example manually setting different ring patterns and invoking the asterisk stdexten macro for routing outgoing calls.

include => stdexten

exten => 600,1,Set(RING_PATTERN=3)
exten => 600,n,Gosub(stdexten(600,DECT/DECT-PT-600))
exten => 600,1,Set(RING_PATTERN=silent)
exten => 601,n,Gosub(stdexten(601,DECT/DECT-PT-601))

DectUserAuth application

All connections from a PP are authenticated using the allocated user authentication key. To additionally authenticate the user using the PP, the DectUserAuth application can be used. It takes an UPI (User Personal Identity, up to 8 digit PIN code) as argument and requests the PP to authenticate the user. The application returns the authentication result (SUCCESS/FAILURE) in the USERAUTHSTATUS variable.

exten => 1000,1,DectUserAuth(1234)
exten => 1000,n,Goto(1000-${USERAUTHSTATUS},1)

exten => 1000-SUCCESS,1,SendText(Authentication successful)
exten => 1000-SUCCESS,n,Wait(3)
exten => 1000-SUCCESS,n,Hangup()

exten => 1000-FAILURE,1,SendText(Authentication failed)
exten => 1000-FAILURE,n,Wait(3)
exten => 1000-FAILURE,n,Hangup()

Misc

The SendText() application can be used to display text on the PP's display during an active call.

[from-dect]

exten => s,1,Answer()
exten => s,n,Set(TIMEOUT(digit)=5)
exten => s,n,Set(TIMEOUT(response)=10)
exten => s,n,WaitExten(,d)

exten => _X.,1,SendText(Connecting call to SIP/${EXTEN})
exten => _X.,n,Dial(SIP/${EXTEN}@dect,,rT)
exten => _X.,n,Goto(dect-${DIALSTATUS},1)

exten => dect-NOANSWER,1,SendText(No answer)
exten => dect-NOANSWER,n,Wait(3)
exten => dect-NOANSWER,n,Hangup()

exten => dect-BUSY,1,SendText(Line busy)
exten => dect-BUSY,n,Wait(3)
exten => dect-BUSY,n,Hangup()

exten => t,1,SendText(Timeout waiting for extension)
exten => t,n,Wait(3)
exten => t,n,Hangup()
Last modified 7 years ago Last modified on Oct 15, 2010, 2:07:41 AM