SignalWire.Relay.Calling.Call
All calls in SignalWire have a common generic interface, Call. A Call is a connection between SignalWire and another device.
Properties
Methods
AMD
Alias for DetectAnsweringMachine.
AMDAsync
Alias for DetectAnsweringMachineAsync.
Answer
Answer an inbound call.
Parameters
None
Returns
SignalWire.Relay.Calling.AnswerResult - The result object to interact with.
Examples
Answer an inbound call and check if it was successful.
Connect
Attempt to connect an existing call to a new outbound call and waits until one of the remote parties answers the call or the connect fails.
This method involves complex nested parameters.
You can connect to multiple devices in series, parallel, or any combination of both with creative use of the parameters. Series implies one device at a time, while parallel implies multiple devices at the same time.
Parameters
Returns
SignalWire.Relay.Calling.ConnectResult - The result object to interact with.
Examples
Trying to connect a call by calling in series +18991114444 and +18991114445.
Combine serial and parallel calling. Call +18991114443 first and - if it doesn’t answer - try calling in parallel +18991114444 and +18991114445. If none of the devices answer, continue the same process with +18991114446 and +18991114447.
ConnectAsync
Asynchronous version of Connect. It does not wait the connect to complete or fail, but returns a ConnectAction object you can interact with.
Parameters
See Connect for the parameter list.
Returns
SignalWire.Relay.Calling.ConnectAction - The action object to interact with.
Examples
Trying to connect a call by calling in series +18991114444 and +18991114445.
Detect
Run a detector on the call and waits until the first detect update comes through. This is a general method for all types of detecting, see DetectAnsweringMachine, DetectDigit, or DetectFax for more specific usage.
Parameters
Returns
SignalWire.Relay.Calling.DetectResult - The result object to interact with.
Examples
Start a detector and if successful, checks whether the
Typeis human from theSignalWire.Relay.Calling.DetectResultobject.
DetectAsync
Asynchronous version of Detect. It does not wait for the detection update but returns a SignalWire.Relay.Calling.DetectAction object you can interact with. This is a general method for all types of detecting, see DetectAnsweringMachine, DetectDigit, or DetectFax for more specific usage.
Parameters
See Detect for the parameter list.
Returns
SignalWire.Relay.Calling.DetectAction - The action object to interact with.
Examples
Start a detector and stop it after 5 seconds.
DetectAnsweringMachine
This is a helper function that refines the use of Detect. This simplifies detecting machines.
Parameters
Returns
SignalWire.Relay.Calling.DetectResult - The result object to interact with.
Examples
Detect machine.
DetectAnsweringMachineAsync
Asynchronous version of DetectAnsweringMachine. It does not wait for the first detection update, but returns a SignalWire.Relay.Calling.DetectAction object you can interact with.
Parameters
See DetectAnsweringMachine for the parameter list.
Returns
SignalWire.Relay.Calling.DetectAction - The action object to interact with.
Examples
Detect machine and stop after 5 seconds.
DetectDigit
This is a helper function that refines the use of Detect. This simplifies detecting DTMF.
Parameters
Returns
SignalWire.Relay.Calling.DetectResult - The result object to interact with.
Examples
Detect DTMF digits.
DetectDigitAsync
Asynchronous version of DetectDigit. It does not wait for the first detection update, but returns a SignalWire.Relay.Calling.DetectAction object you can interact with.
Parameters
See DetectDigit for the parameter list.
Returns
SignalWire.Relay.Calling.DetectAction - The action object to interact with.
Examples
Detect DTMF digits and stop after 5 seconds.
DetectFax
This is a helper function that refines the use of Detect. This simplifies detecting fax.
Parameters
Returns
SignalWire.Relay.Calling.DetectResult - The result object to interact with.
Examples
Detect fax.
DetectFaxAsync
Asynchronous version of DetectFax. It does not wait for the first detection update, but returns a SignalWire.Relay.Calling.DetectAction object you can interact with.
Parameters
See DetectFax for the parameter list.
Returns
SignalWire.Relay.Calling.DetectAction - The action object to interact with.
Examples
Detect fax and stop after 5 seconds.
DetectHuman
This is a helper function that refines the use of Detect. This simplifies detecting humans.
Parameters
Returns
SignalWire.Relay.Calling.DetectResult - The result object to interact with.
Examples
Detect human.
DetectHumanAsync
Asynchronous version of DetectHuman. It does not wait for the first detection update, but returns a SignalWire.Relay.Calling.DetectAction object you can interact with.
Parameters
See DetectHuman for the parameter list.
Returns
SignalWire.Relay.Calling.DetectAction - The action object to interact with.
Examples
Detect human and stop after 5 seconds.
DetectMachine
This is a helper function that refines the use of Detect. This simplifies detecting machines.
Parameters
Returns
SignalWire.Relay.Calling.DetectResult - The result object to interact with.
Examples
Detect machine.
DetectMachineAsync
Asynchronous version of DetectMachine. It does not wait for the first detection update, but returns a SignalWire.Relay.Calling.DetectAction object you can interact with.
Parameters
See DetectMachine for the parameter list.
Returns
SignalWire.Relay.Calling.DetectAction - The action object to interact with.
Examples
Detect machine and stop after 5 seconds.
Dial
This will start a call that was created with NewPhoneCall (or another call creation method) and waits until the call has been answered or hung up.
Parameters
None
Returns
SignalWire.Relay.Calling.DialResult - The result object to interact with.
Examples
FaxReceive
Wait on a fax to come through the current call.
Parameters
None
Returns
SignalWire.Relay.Calling.FaxResult - The result object to interact with.
Examples
Start receiving a fax and check whether it was successful.
FaxSendAsync
Asynchronous version of FaxSend. It does not wait for a fax but returns a SignalWire.Relay.Calling.FaxAction object you can interact with.
Parameters
See FaxSend for the parameter list.
Returns
SignalWire.Relay.Calling.FaxAction - The action object to interact with.
Examples
Start listening for a fax and stop it after 5 seconds.
FaxSend
Wait on a fax to send to a destination.
Parameters
Returns
SignalWire.Relay.Calling.FaxResult - The result object to interact with.
Examples
Send a fax and check whether it was successful.
FaxSendAsync
Asynchronous version of FaxSend. It does not wait for a fax but returns a SignalWire.Relay.Calling.FaxAction object you can interact with.
Parameters
See FaxSend for the parameter list.
Returns
SignalWire.Relay.Calling.FaxAction - The action object to interact with.
Examples
Start sending a fax and stop it after 5 seconds.
Hangup
Hangup the call.
Parameters
SignalWire.Relay.Calling.DisconnectReason - The reason for the disconnect, defaulted to hangup.
Returns
SignalWire.Relay.Calling.HangupResult - The result object to interact with.
Examples
Hangup a call and check if it was successful.
Play
Play one or more media to a Call and wait until the playing has ended. This is a general method for all types of playing, see PlayAudio, PlaySilence, PlayTTS, or PlayRingtone for more specific usage.
Parameters
Returns
SignalWire.Relay.Calling.PlayResult - The result object to interact with.
Examples
Play multiple media elements in the call.
PlayAsync
Asynchronous version of Play. It does not wait for theplaying to complete, but returns a [SignalWire.Relay.Calling.PlayAction`]signalwire-relay-calling-playaction-9 object you can interact with.
Parameters
See Play for the parameter list.
Returns
SignalWire.Relay.Calling.PlayAction - The action object to interact with.
Examples
Play multiple media elements in the call and stop them after 5 seconds.
PlayAudio
This is a helper function that refines the use of Play. This simplifies playing an audio file.
Parameters
Returns
SignalWire.Relay.Calling.PlayResult - The result object to interact with.
Examples
Play an MP3 file.
PlayAudioAsync
Asynchronous version of PlayAudio. It does not wait for the playing to complete, but returns a SignalWire.Relay.Calling.PlayAction object you can interact with.
Parameters
See PlayAudio for the parameter list.
Returns
SignalWire.Relay.Calling.PlayAction - The action object to interact with.
Examples
Play an MP3 file and stop it after 5 seconds.
PlayRingtone
This is a helper function that refines the use of Play. This simplifies playing ringtones.
Parameters
Returns
SignalWire.Relay.Calling.PlayResult - The result object to interact with.
Examples
Play a single US ringtone.
PlayRingtoneAsync
Asynchronous version of PlayRingtone. It does not wait for the playing to complete, but returns a SignalWire.Relay.Calling.PlayAction object you can interact with.
Parameters
See PlayRingtone for the parameter list.
Returns
SignalWire.Relay.Calling.PlayAction - The action object to interact with.
Examples
Play US ringtone for 60 seconds, if Agent is available, stop the play.
PlaySilence
This is a helper function that refines the use of Play. This simplifies playing silence.
Parameters
Returns
SignalWire.Relay.Calling.PlayResult - The result object to interact with.
Examples
Play silence for 10 seconds.
PlaySilenceAsync
Asynchronous version of PlaySilence. It does not wait for the playing to complete, but returns a SignalWire.Relay.Calling.PlayAction object you can interact with.
Parameters
See PlaySilence for the parameter list.
Returns
SignalWire.Relay.Calling.PlayAction - The action object to interact with.
Examples
Play silence for 60 seconds, if Agent is available, stop the play.
PlayTTS
This is a helper function that refines the use of Play. This simplifies playing TTS.
Parameters
Returns
SignalWire.Relay.Calling.PlayResult - The result object to interact with.
Examples
Play TTS.
PlayTTSAsync
Asynchronous version of PlayTTS. It does not wait for the playing to complete, but returns a SignalWire.Relay.Calling.PlayAction object you can interact with.
Parameters
See PlayTTS for the parameter list.
Returns
SignalWire.Relay.Calling.PlayAction - The action object to interact with.
Examples
Play TTS and stop it after 3 seconds.
Prompt
Play one or more media while collecting user’s input from the call at the same time, such as digits and speech.
It waits until the collection succeed or timeout is reached. This is a general method for all types of playing, see PromptAudio or PromptTTS for more specific usage.
Parameters
Returns
SignalWire.Relay.Calling.PromptResult - The result object to interact with.
Examples
Ask user to enter their PIN and collect the digits.
PromptAsync
Asynchronous version of Prompt. It does not wait for the collect to complete, but returns a SignalWire.Relay.Calling.PromptAction object you can interact with.
Parameters
See Prompt for the parameter list.
Returns
SignalWire.Relay.Calling.PromptAction - The action object to interact with.
Examples
Ask user to enter their PIN and collect the digits.
PromptAudio
This is a helper function that refines the use of Prompt.
This function simplifies playing an audio file while collecting user input from the call, such as digits and speech.
Parameters
Returns
SignalWire.Relay.Calling.PromptResult - The result object to interact with.
Examples
Collect user digits while playing an MP3 file.
PromptAudioAsync
Asynchronous version of PromptAudio. It does not wait for the collection to complete, but returns a SignalWire.Relay.Calling.PromptAction object you can interact with.
Parameters
See PromptAudio for the parameter list.
Returns
SignalWire.Relay.Calling.PromptAction - The action object to interact with.
Examples
Collect user digits while playing an MP3 file.
PromptRingtone
This is a helper function that refines the use of Prompt.
This function simplifies playing ringtones while collecting user input from the call, such as digits and speech.
Parameters
Returns
SignalWire.Relay.Calling.PromptResult - The result object to interact with.
Examples
Play a US ringtone once and collect digits.
PromptRingtoneAsync
Asynchronous version of PromptRingtone. It does not wait for the collection to complete, but returns a SignalWire.Relay.Calling.PromptAction object you can interact with.
Parameters
See PromptRingtone for the parameter list.
Returns
SignalWire.Relay.Calling.PromptAction - The action object to interact with.
Examples
Play a US ringtone once and collect digits.
PromptTTS
This is a helper function that refines the use of Prompt.
This function simplifies playing TTS while collecting user input from the call, such as digits and speech.
Parameters
Returns
SignalWire.Relay.Calling.PromptResult - The result object to interact with.
Examples
Ask user to enter their PIN and collect the digits.
PromptTTSAsync
Asynchronous version of PromptTTS. It does not wait for the collection to complete, but returns a SignalWire.Relay.Calling.PromptAction object you can interact with.
Parameters
See PromptTTS for the parameter list.
Returns
SignalWire.Relay.Calling.PromptAction - The action object to interact with.
Examples
Ask user to enter their PIN and collect the digits.
Record
Start recording the call and waits until the recording ends or fails.
Parameters
Returns
SignalWire.Relay.Calling.RecordResult - The result object to interact with.
Examples
Start recording audio in the call for both direction in stereo mode, if successful, grab
Url,DurationandSizefrom theSignalWire.Relay.Calling.RecordResultobject.
RecordAsync
Asynchronous version of Record. It does not wait for the end of the recording but returns a SignalWire.Relay.Calling.RecordAction object you can interact with.
Parameters
See Record for the parameter list.
Returns
SignalWire.Relay.Calling.RecordAction - The action object to interact with.
Examples
Start recording audio in the call for both direction in stereo mode and stop it after 5 seconds.
SendDigits
Sends DTMF digits to the other party on the call.
Parameters
Returns
SignalWire.Relay.Calling.SendDigitsResult - The result object to interact with.
Examples
Send digits and check whether sending was successful.
SendDigitsAsync
Asynchronous version of SendDigits. It does not wait for all digits to be sent but returns a SignalWire.Relay.Calling.SendDigitsAction object you can interact with.
Parameters
See SendDigits for the parameter list.
Returns
SignalWire.Relay.Calling.SendDigitsAction - The action object to interact with.
Examples
Start sending digits.
Tap
Start tapping the call and waits until the tap ends or fails.
Parameters
Returns
SignalWire.Relay.Calling.TapResult - The result object to interact with.
Examples
Start tapping audio in the call for both directions.
TapAsync
Asynchronous version of Tap. It does not wait for the end of the tapping but returns a TapAction object you can interact with.
Parameters
See Tap for the parameter list.
Returns
SignalWire.Relay.Calling.TapAction - The action object to interact with.
Examples
Start tapping audio in the call for both directions and stop it after 5 seconds.
WaitFor
Block until the current state of the call is one of the specified SignalWire.Relay.Calling.CallState values. This is a general method, see WaitForAnswered, WaitForEnded, WaitForEnding, or WaitForRinging for more specific usage.
Parameters
Returns
bool - Will have the value true if the state is consistent with one of the provided states or false if a timeout occurred.
Examples
Wait to see if a call is answered
WaitForAnswered
This is a helper function that refines the use of WaitFor. Block until the current state of the call is the answered SignalWire.Relay.Calling.CallState.
Parameters
Returns
bool - Will have the value true if the state is consistent with the specified SignalWire.Relay.Calling.CallState or false if a timeout occurred.
Examples
Wait to see if a call is answered
WaitForEnded
This is a helper function that refines the use of WaitFor. Block until the current state of the call is the ended SignalWire.Relay.Calling.CallState.
Parameters
Returns
bool - Will have the value true if the state is consistent with the specified SignalWire.Relay.Calling.CallState or false if a timeout occurred.
Examples
Wait to see if a call is ended
WaitForEnding
This is a helper function that refines the use of WaitFor. Block until the current state of the call is the ending SignalWire.Relay.Calling.CallState.
Parameters
Returns
bool - Will have the value true if the state is consistent with the specified SignalWire.Relay.Calling.CallState or false if a timeout occurred.
Examples
Wait to see if a call is ending
WaitForRinging
This is a helper function that refines the use of WaitFor. Block until the current state of the call is the ringing SignalWire.Relay.Calling.CallState.
Parameters
Returns
bool - Will have the value true if the state is consistent with the specified SignalWire.Relay.Calling.CallState or false if a timeout occurred.
Examples
Wait to see if a call is ringing
Events
All these events can be used to track the calls lifecycle and instruct SignalWire on what to do for each different state.
State Events
To track the state of a call.
Connect Events
To track the connect state of a call.
Detect Events
To track a detection.
Fax Events
To track a fax operation.
Play Events
To track a playback state.
Prompt Events
To track a prompt state.
Record Events
To track a recording state.
Send Digits Events
To receive a message when the digits are finished sending.
Tap Events
To track an active tap.