You create a number masking session using the real phone numbers of the two parties that need to be connected. Plivo returns a virtual number from your account in response to the API request.
This method creates a session to anonymously connect two participants.
POST
https://api.plivo.com/v1/Account/{Auth ID}/Masking/Session
first_party stringRequired |
The actual phone number of the first participant. |
second_party stringRequired |
The actual phone number of the second participant. |
record boolean |
Recording status for a phone call.
|
recording_callback_url string |
URL to which the call recording is sent. |
record_file_format string |
Audio format for the recording. |
recording_callback_method string |
HTTP verb to invoke the URL configured as recording_callback_url. |
session_expiry integer |
Time in seconds after which the session mapping will expire. |
call_time_limit integer |
Time in seconds after which the call should be disconnected. |
initiate_call_to_first_party boolean |
If set to true, Plivo will immediately make a call to the first party number. If the call is answered, it will be bridged with the second party. |
callback_url string |
URL to receive important session events and status updates. |
callback_method string |
HTTP verb to invoke the URL configured as callback_url. |
ring_timeout integer |
Time in seconds after which the ring should be disconnected. |
first_party_play_url string |
URL that returns an MP3 or WAV file to be played to the first party before connecting to the second party. |
second_party_play_url string |
URL that returns an MP3 or WAV file to be played to the second party before connecting to the first party. |
{
"session_uuid": "abcd-1234-ab12-cd34",
"virtual_number": "+12205550020",
"status": "active",
"first_party": "+14155552345",
"second_party": "+12165554567",
"record": "false",
"recording_callback_url":"null",
"record_file_format": null,
"session_expiry": "3600",
"call_time_limit": "3600",
"initiate_call_to_first_party": "false",
"callback_url": "null",
"ring_timeout": "120",
"first_party_play_url": "null",
"second_party_play_url": "null",
"created_time": "2023-08-17 21:26:44",
"modified_time": "null",
"expiry_time": "null",
"last_interaction_time": "null",
"total_call_count": "0",
"total_call_amount": "0",
"total_call_billed_duration": "0",
"interaction": "{}"
}
1
2
3
4
5
6
curl -X POST "https://api.plivo.com/v1/Account/{Auth ID}/Masking/Session" \
-H "Content-Type: application/json" \
-d '{
"first_party": "+14155552345",
"second_party": "+12165554567",
}'