Custom Ring Back Tones

From FreeSWITCH Wiki
Jump to: navigation, search

Contents

Ringback

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.

Example

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


Example2

You can send ringback after the call is answered.



 def handler(uuid):
    session = PySession(uuid)
    session.answer()
    session.speak("Hello, connecting your call to the first available agent")
    session.execute("set","call_timeout=30")
    session.execute("set","continue_on_fail=true")
    session.execute("set","hangup_after_bridge=true")
    session.execute("set","ringback=%(2000,4000,440.0,480.0)")
    session.execute("bridge","sofia/foo/bar@test.com,sofia/foo/baz@test2.com:5070")
    session.speak("doh!")


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.

Transfer_Ringback

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.

Example

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