Correct ari command for call between external

Got task to create call between two mobiles using ARI. Got access to prepared asterisk server
version: 18.16.0. But can’t find actual example with my case. I tried to use example from this topic from stack:

Command executed without errors, i see a lot of logs in asterisk, but there are no dialing on any numbers. Support says that params are invalid and i must use extension for external calls. Obviously example from 2015 is not good =) So I would appreciate any relevant example !

There is no such thing as “external” in ARI. You use originate to place calls to endpoints (including to ITSPs), create a bridge to connect them together, and place each channel in the bridge to have them talk. That’s the general gist of what you do. There are routes for doing these in ARI. I don’t have a written example, someone else may, but you’re going to need to understand ARI and experiment if you ultimately plan to use it for anything real. An understanding of VoIP and basic Asterisk is also needed.

Was such logic with avaya and their javax.telephony library. Creating two calls and merge them. But there are plenty of working examples for avaya. Easy to make app from scratch. Now i’m stuck cause need fast prototype. Strange that solution from stack was working 8 years ago with single api call.
Will try to make your described logic. Will post solution here if i achive any success

My examples repo for Seaskirt includes various ways of originating calls with AMI and ARI.

So solution for ari4java was like this:

      val channel: Channel =

SIP and FW - Tech and Name of a trunk (got freepbx ui Connectivity → Trunk)
222 - is created extension
Template will look like this:

      val channel: Channel =
            ari.channels().originate("{trunk tech}/{trunk name}/{first number to call}")
                .setExtension("{second number to call}")
                .setContext("{predefined context for outbound calls}")

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