How to play audio on a call

Before playing audio file

  1. Create call with callback URL -or- Recieve Incoming Call
  2. Make sure call is answered and active

Play audio options

The fileURL is the location of the audio file. Bandwidth currently supports WAV and MP3 files. Click herefor more information about play audio options.

Play audio file to the resource (ie. .../{userId}/calls/{callId}/)

POST https://api.catapult.inetwork.com/v1/users/{userId}/.../{Resrouce_Id}/audio HTTP/1.1
Content-Type: application/json; charset=utf-8

{
    "fileUrl": "MP3"
}

Response

HTTP/1.1 200 OK

This sends these call backs

POST your_server.com HTTP/1.1
Content-Type: application/json; charset=utf-8
User-Agent: BandwidthAPI/v1

{
  "eventType" : "string",
  "callId"    : "string",
  "callUri"   : "string",
  "status"    : "string",
  "time"      : "date",
  "tag"       : "string"
}

Play Audio to call

client.Call.playAudioFile("callId", "http://myurl.com/file.mp3").then(function (res) {});

Play Audio to bridge

client.Bridge.playAudioFile("bridgeID", "http://myurl.com/file.mp3").then(function (res) {});

Play Audio to entire conference

client.Conference.playAudioFile("conferenceID", "http://myurl.com/file.mp3").then(function (res) {});

Play Audio to specific conference member

client.Conference.playAudioFileToMember("conferenceID", "memberId", "http://myurl.com/file.mp3")
  .then(function (res) {});

Stop Playing Audio on call

client.Call.stopAudioFilePlayback("callId").then(function (res) {});

Stop Playing Audio to bridge

client.Bridge.stopAudioFilePlayback("bridgeID").then(function (res) {});

Stop Playing Audio to entire conference

client.Conference.stopAudioFilePlayback("conferenceID").then(function (res) {});

Stop Playing Audio to specific conference member

client.Conference.stopAudioFilePlayback("conferenceID", "memberId").then(function (res) {});

Play Audio to call

await client.Call.PlayAudioFileAsync("{callId1}", "http://myurl.com/file.mp3");

Play Audio to bridge

await client.Bridge.PlayAudioFileAsync("bridgeID", "http://myurl.com/file.mp3");

Play Audio to entire conference

await client.Conference.PlayAudioFileAsync("{conferenceId1}", "http://myurl.com/file.mp3");

Play Audio to specific conference member

await client.Conference.PlayAudioFileToMemberAsync("{conferenceId1}", "{memberId1}", "http://myurl.com/file.mp3");

Stop Playing Audio on call

await client.Call.PlayAudioFileAsync("{callId1}", "");

Stop Playing Audio to bridge

await client.Bridge.PlayAudioFileAsync("{bridgeId1}", "");

Stop Playing Audio to entire conference

await client.Conference.PlayAudioFileAsync("{conferenceId1}", "");

Stop Playing Audio to specific conference member

await client.Conference.PlayAudioFileToMemberAsync("{conferenceId1}", "{memberId1}", "");

Play Audio to call

call.play_audio({:file_url => "http://myurl.com/file.mp3"})

Play Audio to bridge

bridge.play_audio({:file_url => "http://myurl.com/file.mp3"})

Play Audio to entire conference

conference.play_audio({:file_url => "http://myurl.com/file.mp3"})

Stop Playing Audio on call

call.play_audio({:file_url => ""})

Stop Playing Audio to bridge

bridge.play_audio({:file_url => ""})

Stop Playing Audio to entire conference

conference.play_audio({:file_url => ""})

Play Audio to call

api.play_audio_file_to_call('callId', 'http://myurl.com/file.mp3')

Play Audio to bridge

api.play_audio_file_to_bridge('bridgeId', 'http://myurl.com/file.mp3')

Play Audio to entire conference

api.play_audio_file_to_conference('conferenceId', 'http://myurl.com/file.mp3')

Play Audio to specific conference member

api.play_audio_file_to_conference_member('conferenceId', 'memberId', 'http://myurl.com/file.mp3')

Stop Playing Audio on call

api.play_audio_file_to_call('callId', '')

Stop Playing Audio to bridge

api.play_audio_file_to_bridge('bridgeId', '')

Stop Playing Audio to entire conference

api.play_audio_file_to_conference('conferenceId', '')

Stop Playing Audio to specific conference member

api.play_audio_file_to_conference_member('conferenceId', 'memberId', '')

results matching ""

    No results matching ""