Changing Volume Via Dialplan

Home » Asterisk Users » Changing Volume Via Dialplan
Asterisk Users 2 Comments

Greetings everyone, I am attempting to adjust the volume of a call using Set(VOLUME) in my extensions.conf file. I am finding that Set(VOLUME(TX)=x) and Set(VOLUME(RX)=y) have no discernable effect on my endpoints (Snom 300 IP phones). I have tried setting x and y to -30, -10, -3, -2, -1, 0, 1, 2, 3, 4, 10, and 100 and there appears to be no change on the phone volume. I can see that the Set(VOLUME) instruction is being executed on the Asterisk CLI. I have also tried using Set(CHANNEL(txgain)=x) and Set(CHANNEL(rxgain)=y) and those don’t seem to have any effect either. I have tried setting x and y to -30, -10, -3, -2, -1, 0, 1, 2, 3, 4, 10, and 100 and there appears to be no change on the phone volume. I can see that the Set(CHANNEL) instruction is being executed on the Asterisk CLI. I am using PJSIP and just upgraded to Asterisk 13.5.0. It wasn’t working on 13.4.0 either, but when I saw the release notes on 13.5 and volume was addressed, I was hopeful that it might solve my problem for me. So I have a couple of questions:
1) Am I using the correct functions in the dial plan to adjust volume? It would be something like:same => n,Set(VOLUME(TX)=3)orsame =>n,Set(CHANNEL(rxgain)=0)2) If this is correct, what are the min/max values that I can use when adjusting volume? I was digging around the source code and it looked like maybe a min of -4 and max of +4 was expected – but I am unsure. If anyone has any ideas on how to do this, I would appreciate any help. Thanks a lot,
–Matt

2 thoughts on - Changing Volume Via Dialplan

  • Matthew Murphy wrote:

    Kia ora,

    I just did the following on 13.5.0:

    exten => 1002,1,Answer exten => 1002,2,Set(VOLUME(tx))
    exten => 1002,3,Playback(demo-congrats)

    From my D70 and confirmed the audio was … louder/horrible.

    Do you have any other endpoints you could test from?

    These aren’t applicable to PJSIP.

    Yes, the VOLUME dialplan function should do the job.

    There is no enforced minimum/maximum. The value provided is in dB.

    Cheers,

  • You are right, it works just fine!
    Needless to say, I had tricked myself into thinking I was using Asterisk 13.5. There was a build error getting covered up by my install script. So I was still using the “old” Asterisk 13.4.0 that I had previously installed. Once I fixed that, everything worked nicely. Typical PICNIC error: Problem In Chair, Not In Computer. Thanks for the help!