Asterisk config alsa.conf

The alsa.conf Asterisk configuration file allows configuration of ALSA channels within Asterisk. ALSA channels allow calls to be placed to/from ALSA devices, using ALSA audio input/output devices as telephony devices. This allows a headphone and microphone plugged into a sound card, for example, to be used as a softphone. Calls can be placed and digits can be dialed from the Asterisk CLI, using the "dial", "answer", and "hangup" CLI commands.

The alsa.conf file may contain any of the following directives:

  • autoanswer = yes or no
Indicates whether or not calls to ALSA channels should be automatically answered as soon as they are rung. This can be used to provide, for exmaple, intercom-like functionality over IP. If autoanswer is disabled, the "answer" command must be entered at the CLI command prompt to answer a call ringing an ALSA channel. (For some reason, in the default configuration, the value of autoanswer is set to yes. If you value your privacy, you should disable it.)

  • context = <context name>
Indicates the context in which extensions dialed with the CLI "dial" command are looked up. Ex: "dial 100" will dial extension 100 in the context specified by this directive.

  • extension = <extension name or number>
Indicates the extension which will be dialed (in the context specified by the context= line) if the CLI "dial" command is issued with no extension argument. Ex: just "dial".

  • input_device = <ALSA device name>
Indicates the name of the ALSA device to use for capturing sound, i.e. for talking. A device name specified here is passed, unchanged, to the ALSA sound layer, so any ALSA device name should work. Simply specifying a value of "default" (which is actually an ALSA device name) here often works.

  • output_device = <ALSA device name>
Indicates the name of the ALSA device to use for playing sound, i.e. for listening. A device name specified here is passed, unchanged, to the ALSA sound layer, so any ALSA device name should work. Warning: Asterisk may lock the ALSA device specified here for the entire duration the Asterisk process is running. You may have to twiddle software and/or hardware mixing settings to keep Asterisk from hogging your output device.

With 1.2.x versions of Asterisk, only one ALSA channel can be created, only one input/output device pair can be associated with the ALSA channel, and only one call can be placed to/from the ALSA channel at a given time. If the ALSA channel is in use when an incoming call is routed to it, the destination will be treated as busy.

Similar to the ALSA channel driver, the OSS channel driver provides similar functionality, but for OSS-compatible devices. See Asterisk config oss.conf.

Only one of either the ALSA or OSS channel drivers may be loaded at a given time. So, if you plan to use an ALSA channel, you must enable chan_alsa and disable chan_oss in modules.conf. Ex:

noload => chan_oss.so
load => chan_alsa.so

The alsa.conf Asterisk configuration file allows configuration of ALSA channels within Asterisk. ALSA channels allow calls to be placed to/from ALSA devices, using ALSA audio input/output devices as telephony devices. This allows a headphone and microphone plugged into a sound card, for example, to be used as a softphone. Calls can be placed and digits can be dialed from the Asterisk CLI, using the "dial", "answer", and "hangup" CLI commands.

The alsa.conf file may contain any of the following directives:

  • autoanswer = yes or no
Indicates whether or not calls to ALSA channels should be automatically answered as soon as they are rung. This can be used to provide, for exmaple, intercom-like functionality over IP. If autoanswer is disabled, the "answer" command must be entered at the CLI command prompt to answer a call ringing an ALSA channel. (For some reason, in the default configuration, the value of autoanswer is set to yes. If you value your privacy, you should disable it.)

  • context = <context name>
Indicates the context in which extensions dialed with the CLI "dial" command are looked up. Ex: "dial 100" will dial extension 100 in the context specified by this directive.

  • extension = <extension name or number>
Indicates the extension which will be dialed (in the context specified by the context= line) if the CLI "dial" command is issued with no extension argument. Ex: just "dial".

  • input_device = <ALSA device name>
Indicates the name of the ALSA device to use for capturing sound, i.e. for talking. A device name specified here is passed, unchanged, to the ALSA sound layer, so any ALSA device name should work. Simply specifying a value of "default" (which is actually an ALSA device name) here often works.

  • output_device = <ALSA device name>
Indicates the name of the ALSA device to use for playing sound, i.e. for listening. A device name specified here is passed, unchanged, to the ALSA sound layer, so any ALSA device name should work. Warning: Asterisk may lock the ALSA device specified here for the entire duration the Asterisk process is running. You may have to twiddle software and/or hardware mixing settings to keep Asterisk from hogging your output device.

With 1.2.x versions of Asterisk, only one ALSA channel can be created, only one input/output device pair can be associated with the ALSA channel, and only one call can be placed to/from the ALSA channel at a given time. If the ALSA channel is in use when an incoming call is routed to it, the destination will be treated as busy.

Similar to the ALSA channel driver, the OSS channel driver provides similar functionality, but for OSS-compatible devices. See Asterisk config oss.conf.

Only one of either the ALSA or OSS channel drivers may be loaded at a given time. So, if you plan to use an ALSA channel, you must enable chan_alsa and disable chan_oss in modules.conf. Ex:

noload => chan_oss.so
load => chan_alsa.so

Created by: voipdog, Last modification: Tue 02 of Sep, 2008 (03:47 UTC)
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+