Call Actions

makeCall

This function should be used to connect the first call with another party.

The following is an example of the JSON response you would need to provide:

{
   "clientActionId": "NumberMaskingId1",
   "callflow": [
      {
         "action": "makeCall",
         "params": {
            "source": "6512345678",
            "destination": "6587654321",
            "callRecording": true //Optional. Use only if call recording has been set up.
         }
      }
   ]
}

The action should contain the following parameters:

NameTypeDescription
actionStringMakeCall – Action to Connect/Bridge call between two users
destinationStringNumber of the called party in E.164 format (The second user's number).
sourceStringNumber of the calling party in E.164 format. This should be the Virtual Number allocated to your sub-account
callRecordingBoolean(Optional) Trigger to start recording the Number Masking session. Before using this option please reach out to your Account Manager since this option might include additional costs. Additionally please make sure that the Call Recording has been configured on your account. To configure call recording please take a look at Call Recordings

say

This action should be used to play a text to speech message on the call.

The following is an example of the JSON response you would need to provide:

{
  "clientActionId": "NumberMaskingId1",
  "callflow": [
    {
      "action": "say",
      "params": {
        "text": "Hello This is a test message",
        "language": "en",
        "voiceProfile": "generic-en-male",
        "repetition": 1
      }
    }
  ]
}

The above example would be used if you want the message β€œThis is a test message” to be pronounced in an English female voice.

The action should contain the following parameters:

NameTypeDescription
actionStringsay – Text to speech function
textStringThe text to speech message that will be played on the call
languageStringThe language of the spoken text, see in the table below of supported languages
voiceProfileStringThe voice profile of the spoken text, see in the table below the supported voice profiles
repetitionIntegerDefines the number of times the text will be repeated during the call.

Supported TTS Voice and language are:

LanguageLanguage codeMale voice profileFemale voice profile
EnglishENgeneric-en-malegeneric-en-female
ChineseZNN/Ageneric-zn-female
DanishDAgeneric-da-malegeneric-da-female
DutchNLgeneric-nl-malegeneric-nl-female
FrenchFRgeneric-fr-malegeneric-fr-female
GermanDEgeneric-de-malegeneric-de-female
HindiHIN/Ageneric-hi-female
IcelandicISgeneric-is-malegeneric-is-female
ItalianITgeneric-it-malegeneric-it-female
JapaneseJAgeneric-ja-malegeneric-ja-female
KoreanSVN/Ageneric-sv-female
NorwegianNBN/Ageneric-nb-female
PolishPLgeneric-pl-malegeneric-pl-female
PortuguesePTgeneric-pt-malegeneric-pt-female
RomanianRON/Ageneric-ro-female
RussianRUgeneric-ru-malegeneric-ru-female
SpanishESgeneric-es-malegeneric-es-female
SwedishSVN/Ageneric-sv-female
ThaiTHN/Ageneric-th-female
TurkishTRN/Ageneric-tr-female
VietnameseVNgeneric-vn-malegeneric-vn-female
WelshCYN/Ageneric-cy-female

say&capture

This action should be used to play a text to speech message and capture user inputs.

The following is an example of the JSON response you would need to provide:

{
  "clientActionId": "NumberMaskingId1",
	"callflow": [ 
    {
      "action": "say&capture",
        "params": {
          "text": "Hello This is a test message", 
          "language": "en",
          "voiceProfile": "generic-en-male",
          "repetition": 1,
          "minDigits": 5
       }
    }
  ] 
}

The action should contain the following parameters:

NameTypeDescription
actionStringsay&capture – Action to play an TTS message and capture user inputs
textStringThe text to speech message that will be played on the call
languageStringThe language code of the spoken text, see in the table above the supported languages
voiceProfileStringThe voice profile of the spoken text, see in the table above the supported voice profiles
repetitionIntegerDefines the number of times the text will be repeated during the call.
minDigitsInteger(Optional) Minimum number of dial-pad inputs that the calling user can make. Accepted values are from 1 to 20.

Hangup

This action should be used to hang up the incoming call.

The following is an example of the JSON response you would need to provide:

{
	"clientActionId": "NumberMaskingId1",
	"callflow": [ 
		{
  		"action": "hangup" 
    }
  ]
}

Note: The Hangup action is needed only if you do not want to complete any other action. This action is not necessary if the calling user hangs up the call.

Commands Example

On the following example it is demonstrated how multiple actions can be used in the same callHandle reply:

{
  "clientActionId": "NumberMaskingId1",
	"callflow": [ 
    {
      "action": "say&capture",
        "params": {
          "text": "Hello This is a test message", 
          "language": "en",
          "voiceProfile": "generic-en-male",
          "repetition": 1,
          "minDigits": 5
      }
    },
    {
  		"action": "hangup" 
    }
  ] 
}