Mute/Unmute not working with Asterik 20.4.0 AMI

Hello,

I am running Asterisk 20.4.0 and trying to use AMI.
I can successfully generate the call using originate action. Now, I want to use below two features :
Mute/Unmute

When I have a call connected between two channels, I want to put a caller leg A on Mute using AMI. After a some I want to unmute the same channel and the caller and callee can communicate with each other.

I cant find a way to do it as asterisk 20.x has no AMI action like MuteAudio. I tried with Redirect Action but in that the other channel just hangs up.

Help me for how to achieve this?

It does have a MuteAudio[1] AMI action, it is part of the res_mutestream module.

[1] MuteAudio - Asterisk Documentation

Thanks for the quick help @jcolp .

I tried using the same and I m getting below :

<— Examining AMI action: →
action: MuteAudio
actionid: 1691233731.6031
channel: sip/8002
state: on

← Examining AMI event: →
Event: RequestBadFormat
Privilege: security,all
SequenceNumber: 535
File: manager.c
Line: 1984
Func: manager_default_msg_cb
EventTV: 2023-08-05T16:38:51.618+0530
Severity: Error
Service: AMI
EventVersion: 1
SessionID: 0x55c411a3f080
LocalAddress: IPV4/TCP/0.0.0.0/5038
RemoteAddress: IPV4/TCP/64.227.154.37/47646
RequestType: Action: MuteAudio
SessionTV: 2023-08-05T16:38:51.609+0530
AccountID: renAMI

Is the module loaded? Did you look at any response you got in AMI?

Will you please guide me - Which module should be loaded ?

Aside to this, No, I m not getting any response on AMI. I got below in manager debug :

← Examining AMI event: →
Event: RequestBadFormat
Privilege: security,all
SequenceNumber: 535
File: manager.c
Line: 1984
Func: manager_default_msg_cb
EventTV: 2023-08-05T16:38:51.618+0530
Severity: Error
Service: AMI
EventVersion: 1
SessionID: 0x55c411a3f080
LocalAddress: IPV4/TCP/0.0.0.0/5038
RemoteAddress: IPV4/TCP/64.227.154.37/47646
RequestType: Action: MuteAudio
SessionTV: 2023-08-05T16:38:51.609+0530
AccountID: renAMI

The res_mutestream module should be loaded. It can be confirmed by doing “module show like mute” in the Asterisk console. If it is not loaded it can be done manually using “module load res_mutestream.so” and then you’d have to investigate why it wasn’t loaded originally, such as examining modules.conf to see if only certain modules are loaded.

1 Like

sip/8002 is a dialstring, not a channel. The action requires a channel. It is possible for SIP peer 8002 to have multiple channels open to it (in fact that is normal during an attended transfer).

Also note that SIP/ will cease to be valid in the next release of Asterisk, due in just over two months. Support will no longer be optional; it won’t exist.

Thanks david for your reply.

The module was not loaded which I load and now its started working.

Thanks.

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