No ring back tone on outbound calls over trunk

I have a FreePBX 13 server set up with a SIP Trunk connection, however for some reason we are not getting the ring back tone for calls going out of the trunk connection.

I was able to implement a work around for this by placing the “Tr” options under “Asterisk Trunk Dial Options” to force Asterisk to produce the ring back tone for outbound calls.

However this only works while manually dialing from a soft-phone / VoIP Phone, when I try to launch a call via the Asterisk AMI “Originate” command we are not getting the ring back tone, even when the “r” option is set on the trunk. This is how the command I’m sending looks:

Action: Originate,
Channel: SIP/{extension},
Context: from-internal,
Exten: {phoneNumber},
Priority: 1,
Callerid: {callerId},
Timeout: 30000,
Async: yes

Is there a way to force the ring back tone for calls originated this way? So the person on the extension can hear the ring tone after picking the phone and waiting for the remote end to answer?

Thanks

You can use local channel to in order to be able to use the dial r option

Hey, thanks for the reply.

What do you mean by “use a local channel”?
Is that some modification I can do to the syntax of the AMI commands I’m using?

Local Channels provide a channel type for calling back into Asterisk itself.
That is, when dialing a Local Channel you are dialing within Asterisk into the Asterisk dialplan.

http://www.asteriskdocs.org/en/3rd_Edition/asterisk-book-html-chunk/DeeperDialplan_id324598.html

I investigated further, but it seems that won’t work on this scenario, as the call is going to an external phone number, not to another extension.

It seems it will work between 2 extensions as covered on this article:

https://asterisk-java.org/originate-using-asterisk-local-channels-566/

However I’m trying to place a call between an extension and an external phone number.

Is there something I’m missing?

Local channels will work with anything that you could call from another phone on the Asterisk system. That is not just physically attached devices.

Of course, if you are using FreePBX, your current approach is completely subverting FreePBX, but using dialplan, for a local channel, could well conflict with FreePBX’s dialplan.

One other thing, at least for a pure Asterisk environment, you can get this effect if the ITSP doesn’t signal call progress with specific SIP events, but simply uses early media. To have Asterisk pass through early media on SIP, you need to call Progress() before Dial() (it may also work if you call Answer() before Dial().

Honestly, I’m not sure how to solve this using local channels…

I only want calls set up using the Originate AMI command to have ring back tone and be ended when the other end hangs up, right now by using the “r” option on the trunk I get the desired behavior but only when manually dialing the external number from one of the extensions via a Softphone.

If I launch the call from the same extension, to the same external number, but via the originate AMI command, then I won’t get ring back tone and when the other end hangs up the call will continue on the extension just hearing silent!!!