AMI Command sample for SetOutboundRoute

Hi Experts

I am trying to create a software that perform some tasks via asterisks AMI. One of them is to tell the PBX to change the dialout plan to a different plan or to restrict a dialout access. So far, here is what I found:

####First, I listed all available commands
Action: ListCommands

####Then, I checked which routes is used by an extension - Edited

Action: QueryOutboundRoutes
Extension: 1000

####Then I tried to set a new outbound routes --> Edited

Action: SetOutboundRoutes
Extension: 1000
Value: NoWhere

####The code above returned no error, but the Routeout for extension 1000 is left blank. I missed the correct parameter for setting the OutboundRoutes value.

Response: Success
Message: Updated database successfully

####When I query the routeout for ext 1000 again, it is blank.

Action: QueryOutboundRoutes
Extension: 1000


####Here is my asterisks versions:

action: coresettings

Response: Success
AMIversion: 2.8.0
AsteriskVersion: 13.7.0
CoreMaxCalls: 60
CoreMaxLoadAvg: 0.000000
CoreMaxFilehandles: 5120
CoreRealTimeEnabled: No
CoreCDRenabled: Yes
CoreHTTPenabled: No

Can anyone help me how to use the SetOutboundRoutes action?

Thanks in advance.

The “SetOutboundRoute” AMI action is not part of Asterisk, it comes from somewhere else so you’d need to find where.

1 Like

I used Yeastar S300 PBX for testing. I am trying to contact them as well. No luck so far.

Maybe you know a way to disable/enable outgoing calls from a certain extension with AMI commands?

That is not a feature built into Asterisk.

Asterisk doesn’t even have a concept of outbound calls, let alone one of outbound routes.

Anyone knows how I can disable a certain extension from making external calls with AMI commands?

Delete priority 1 for the extension, and re-insert it. (Making priority 1 always be a Noop will help. This will generate an unknown number error. You can generalise by changing a priority to a GOTO.

Alternatively, define a global variable for each extension, and manipulate that. Test it within the dialplan for the extension.

Can you help explain to me in AMI commands? Sorry for my direct newbie question, as for this moment, my head is almost shutdown trying to find AMI commands for my solution. Also how to check all installed modules in the PBX. I want to reload one specific module only to test my solution for this matter.

Also note the CLI commands:

manager show commands
manager show command