Apply Volume Gain to Extension

I have a legacy analog paging system I’m attempting to connect to FreePBX via a SIP Paging gateway. Unfortunately the audio output from my paging gateway is a bit too quiet and neither the gateway, nor the legacy system have a means of increasing the volume. The gateway registers as an extension on the system. Is there some way I can use the VOLUME() command in the dialplan to increase the gain for this extension? Would it be as simple as adding the following to extensions_custom.conf?

exten => 2222,1,Set(VOLUME(TX)=10)
exten => 2222,1,Set(VOLUME(RX)=10)

That would be a one way of doing it. It increases the channel volume. However, i do not know if it will be invoked with ext-local-custom to continue in the dialplan for ext-local.

If that don’ work, create a separate context and use that context inside the device configuration, at the end of that context, simply send the call back to “from-internal”.

An example, create something like this in extensions_custom.conf

exten => _X.,1,NoOp(Increase volume)
same => n,Set(VOLUME(TX)=10)
same => n,Set(VOLUME(RX)=10)
same => n,Goto(from-internal,${EXTEN},1)

*Make sure the dial pattern matches your “old paging device”

Then set the context to from-internal-increase-vol on each FPBX device setting page that you need to increase volume.

Worked for me for a quick hack exactly what u wanted here.


Thanks sanjayws!

I’ve implemented your solution above, however, when I attempt to call my gateway device I get the following (repeated 4x each time) in my Asterisk logs:

WARNING[1465][C-000440a4]: chan_sip.c:21886 func_header_read: This function can only be used on SIP channels.

I’m not sure why it doesn’t think that my analog gateway is a sip channel (it shows up under sip show peer). Is there any other information I can provide?

Thanks again!

1 Like

Actually that might be completely unrelated as it shows up after I set the context back to from-internal. Nevermind! Sorry!

Thanks again sanjayws!

I did have some trouble with creating the custom context and assigning that context to the device, so I cheated a bit and just made a new extension under [from-internal-custom] that does exactly what you said, just with explicitly defining the extension in the Goto. Works great!

[from-internal-custom] exten => 3333,1,NoOp(Increase volume) same => n,Set(VOLUME(RX)=10) same => n,Goto(from-internal,2222,1)