Volume issue with analogue phone

Hello,

I have an analogue phone connected to Asterisk via a Linksys SPA2102 VoIP/SIP interface. The gain on the speaker’s voice on this phone is low but I can increase it successfully with the following in the extension configuration:

Set(VOLUME(TX)=3);

A problem arises however when the caller to this extension makes a transfer to another number, the “transfer” audio message becomes blisteringly loud and distorted (the distortion starts at VOLUME(TX)=2).

Is there some way I can lower the gain on the message for this particular extension only?

I’m running Asterisk 13.18.3

Thank you,

I suppose the trick would be to set the volume back to a lower value before the transfer code is sent by the softfone. It is actually a script that is sending the DTMF codes to a Linphone daemon, so the script could potentially send a message to Asterisk to change the volume. I’m still learning the basics of Asterisk and this messaging, if possible, I don’t know how to do.
Thanks

Post the dial plan it is easier to help you with that, but if you get the variable holding that device you can set the volume lower using ExecIf

Thanks, I’ll look at ExecIf. Pasted below are the relevant entries in extensions.ael. The sequence is that extension 8001 (a softphone on the Asterisk server itself) calls ext. 601 and then makes a transfer to extension 602. The caller on ext 8001 that hears the distorted signal.

	601 => {     // green phone
        System(oscsend localhost 11222 /micthrough sii on 0 1); 
	Set(CHANNEL(hangup_handler_push)=hangerupper,voicecall,1(args));
	Set(VOLUME(TX)=4);     // increase gain on green phone speaker's voice
   	    Dial(SIP/sip-spa1,20,tT);
    	    Hangup();
	    }

	602 => {   // white phone
        System(oscsend localhost 11222 /micthrough sii on 0 1); 
	Set(CHANNEL(hangup_handler_push)=hangerupper,voicecall,1(args));
   	    Dial(SIP/sip-spa2,20,tT);
    	    Hangup();
	    }

Still haven’t got it working, could you please elaborate a little?

There is audiohok on the volume function, so the channel with the increased volume need to be adjusted after the transfer, I dont use ael but i think you can simple use this same syntax with the correct volume

Set(VOLUME(TX)=x);

Thanks but how can that be done? In features.conf I am using the default “*2” to set “atxfer”. Is there a way of manually performing the attended transfer with an applicationmap and resetting the volume in the process?

My calling phone is SIP/switchboard1 and the receiving phone with the low gain on its microphone is SIP/sip-spa1. In CLI, if instead of adjusting the volume for the SIP/switchboard1 channel with, for example:

dialplan set chanvar SIP/switchboard1-0000002d VOLUME(TX) 4

I instead set for the following for the receiving channel:

dialplan set chanvar SIP/sip-spa1-0000002b VOLUME(RX) 4

The volume of the phone SIP/sip-spa1 is corrected and there is no distortion on the voice prompt when the caller on SIP/switchboard1 makes the transfer since the voice prompt pertains to its own channel and not that of SIP/sip-spa1.

Is it possible to configure this volume adjustment on the receiver’s channel via the dialplan and if so, how?

Found a solution in pre-dial handlers. The handler allows the gain to be set on the receiving phone’s channel before the dial:

here’s are the relevant bits in extensions.ael

context outgoing {

     greenphone_pre_dial_handler => {
	Set(VOLUME(RX)=5);
	Return();
	}

    601 => {     // green phone
	Set(VOLUME(TX)=1);     
	Dial(SIP/sip-spa1,20,Tb(outgoing^greenphone_pre_dial_handler^1));
        Hangup();
	}	 
}
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.