BulkCall allows you to initiate multiple outbound calls through one request. The calls can be to any device or endpoint that FreeSWITCH supports like SIP phone, Regular Phone or even GTalk.

BulkCall Request URL

To make a bulk call, make an HTTP POST to the below URL with the required parameters:

http://{BASEURL}/{ApiVersion}/BulkCall/

POST Parameters

Required Parameters

You must POST the following parameters:

Parameter Description
Delimiter Any special character (with the exception of ‘/’ and ‘,’) which will be used as a delimiter for the string of parameters below. E.g. ‘<
From The phone number to use as the caller id (with the country code). E.g. 15551234567
To The numbers to call (regular phone numbers must be prefixed with country code but without the ‘+’ sign) separated by the Delimiter E.g. 15557654321<15556543210
AnswerUrl The fully qualified URL that Plivo will request RESTXML from, each time a call connects. This will be used to control the connected call, as is the case for inbound calls. Parameters mentioned here would be sent along.
Gateways Gateways for a given number: This should be valid FreeSWITCH gateway strings separated by comma. If multiple gateways are specified, all the gateways will be tried sequentially for failover for the specified number of retries. E.g. 'user/,sofia/gateway/PSTN1/'.
Gateways between each number: These should be separated by delimiters. E.g. 'user/,sofia/gateway/PSTN1/<user/,sofia/gateway/PSTN2/'.
Optional Parameters

You may POST the following parameters:

Parameter Description
HangupUrl The URL that will be notified by Plivo when the call hangs up. HangupCause will be sent to the URL as a POST parameter along with other parameters.
RingUrl The URL that Plivo will notify when the call starts ringing. RequestUUID corresponding to the API request sent earlier and CallUUID will be sent along with the other parameters.
ExtraDialString E.g. "bridge_early_media=true,hangup_after_bridge=true" This will add these channel variables to the dialstring in FreeSWITCH while dialing a number. You can use any channel variables supported by FreeSWITCH for granular control. Please refer to this link for more details
CallerName List of caller name to use with the calls separated by Delimiter.
GatewayCodecs GatewayCodecs for a given number: Through this parameter you can choose the valid codec(s) to be used for each FreeSWITCH gateway. E.g.'PCMA,PCMU','G729,PCMU'.
GatewayCodecs between each number: These should be separated by delimiters. E.g. 'PCMA,PCMU','G729,PCMU'<'PCMA,PCMU','PCMA,G729'
GatewayTimeouts GatewayTimeouts for a given number: As the name suggests, gatewayTimeouts indicates the timeouts (in seconds) for each FreeSWITCH gateway. E.g "10,10,10". Here Plivo will use 10 seconds timeouts while trying to dial a call through each of the three gateways.
GatewayTimeouts between each number: These should be separated by delimiters. E.g. "10,10,10<20,20,20". Here Plivo will use 10 seconds timeouts for the first call and 20 seconds timeouts for the second call.
GatewayRetries GatewayRetries for a given number: The number of times each of the gateways must be tried. E.g. "2,1,1" Here gateway 1 will be tried twice and others gateways will be tried once each.
GatewayRetries between each number: These should be separated by delimiters. E.g. "2,1,1<3,3,3" For the first call, gateway 1 will be tried twice and others gateways will be tried once each. For the second call, each gateway will be tried thrice.
SendDigits The SendDigits parameter tells Plivo to play DTMF tones when the call is answered. This is useful when dialing a phone number and an extension. Plivo will dial the number, and when the automated system picks up, send the DTMF tones to connect to the extension. SendDigits for each number being dialed should be separated by the Delimiter. E.g. wwww2410<wwww1411
Each ‘w’ character waits 0.5 seconds instead of sending a digit.
Each ‘W’ character waits 0.5 seconds instead of sending a digit.
You can also add the tone duration in ms by appending @duration after string (default duration is 2000 ms).
Eg. 1w2w3@1000
SendOnPreanswer List separated by Delimiter. If set to ‘true’, SendDigits is executed when called party is in early media instead of answer state. (default ‘false’)
TimeLimit This parameter will schedule the call for hangup at a specified time after the call is answered. It should be an integer >0 in seconds. TimeLimit for each number being dialled should be separated by the Delimiter. E.g. 5<10 The first call will hangup 5 seconds after it is answered while the second call will hangup 10 seconds after it is answered.
HangupOnRing This parameter will schedule the call for hangup at a specified time after the call starts ringing. It should be an integer >=0 in seconds. HangupOnRing for each number being dialled should be separated by the Delimiter. E.g. 5<10 The first call will hangup 5 seconds after it starts ringing while the second call will hangup 10 seconds after it starts ringing.

Response Parameters

When you initiate a RESTAPI, Plivo responds with the standard parameters as mentioned here. Along with that the following additional parameters are sent:

  • RequestUUID: A list of unique identifiers for the API request associated with the calls initiated. E.g. ["75b26856-8638-11e0-802c-6d99d509954e", "56hf4856-8638-11e0-802c-65j6gd39954e"]

Comments are closed.