Custom Ring Back Tones

From FreeSWITCH Wiki
Jump to: navigation, search



This addition lets you set artificial ringback on a channel that is waiting for an originated call to be answered.

The syntax is:

<action application="set" data="ringback=[data]"/>

Where data is either the full path (important! must be full path!) to an audio file or teletone generation markup language.

You may also combine this with the ring_ready application. In this case the caller hears the normal ringback tone for a fraction of a second, then he hears the defined ringback media.

Note: Since r15025 local ringback tone is generated only when there is no early media. To force local ringback despite of early media use the ignore_early_media channel variable.


<action application="set" data="ringback=%(2000,4000,440.0,480.0)"/>


You can send ringback after the call is answered.

 def handler(uuid):
    session = PySession(uuid)
    session.speak("Hello, connecting your call to the first available agent")

Ringback will not be sent unless the variable is set *and* there's a ringing indication from the party that is being called.

If you want to use fake ringback via the ringback variable and you want it to happen instantly, you can also do:

<action application="set" data="instant_ringback=true"/>

and FS will send ringback without waiting for a ringing indication. Note that this may cause undesirable effects, like ringing for 3 seconds that turns into a busy signal.


This is the sound that will play if a call has already been answered, and it is then transferred to another endpoint.

<action application="set" data="transfer_ringback=[data]"/>

where data is either the full path to an audio file or teletone generation markup language.


<action application="set" data="transfer_ringback=$${us-ring}"/>