callerId must be provided for TwilioClient and SIP calls when using Dial.
This error is notified to the the action callback (parameter) of the TwiML VoiceResponse instance,
before sdk finally shows a 403 (forbidden).
Steps to Reproduce
iOS SDK starts the call
The TwiML post action is called, linked to a serverless function.
The function returns correctly the TwiML steps.
However error is notified to the action URI on my server with the following (form) properties:
=> DialCallStatus: failed, ErrorMessage: callerId must be provided for TwilioClient and SIP calls when using Dial
On client (sdk) end, this is is logged as a SIP/2.0 403 Forbidden (not relevant).
exports.handler = async (context, event, callback) => {
// set-up the variables that this Function will use to forward a phone call using TwiML
// generate the TwiML to tell Twilio how to forward this call
let voiceResponse = new Twilio.twiml.VoiceResponse();
......
const { callId, numberFrom } = response.data;
let dialParams = {};
dialParams.callerId = numberFrom
dialParams.answerOnBridge = true
dialParams.method = 'POST'
dialParams.action = 'myserver'
dialParams.recordingStatusCallback = 'myserver'
dialParams.record = 'record-from-answer-dual'
dialParams.recordingStatusCallbackEvent = 'in-progress completed absent'
dialParams.timeout = 23
const dialObj = voiceResponse.dial(dialParams);
dialObj.number(numberTo);
// return the TwiML
callback(null, voiceResponse);
The weird thing is that the TwiML response looks correct.
And yes, I can guarantee it has nothing to do with the + character. Happens with or without it.
Expected Behavior
Call starts and following callbacks/actions occurr.
Actual Behavior
Call does not start because of the callerId error, which has been notified to the action endpoint (myserver).
Reproduces How Often
100%
Logs
Provided before. The following screenshot is the parameters section of the function call.
(I triggered an exception before the return callback to show this):
Above data is from a forced exception execution, the following CallSid is from a real one:
CallSid: "CAbe5a4f0be368ca7bf4aa7eae79691703"
Description
callerId must be provided for TwilioClient and SIP calls when using Dial. This error is notified to the the action callback (parameter) of the TwiML VoiceResponse instance, before sdk finally shows a 403 (forbidden).
Steps to Reproduce
iOS SDK starts the call
The TwiML post action is called, linked to a serverless function.
The function returns correctly the TwiML steps.
However error is notified to the action URI on my server with the following (form) properties:
=> DialCallStatus: failed, ErrorMessage: callerId must be provided for TwilioClient and SIP calls when using Dial
On client (sdk) end, this is is logged as a SIP/2.0 403 Forbidden (not relevant).
Code
Serverless / TwiML steps creation
If you are from Twilio team, the endpoint (protected) is: https://wheat-bat-8252.twil.io/live
Code of the function:
Generated TwiML (voiceResponse value at the end):
The weird thing is that the TwiML response looks correct. And yes, I can guarantee it has nothing to do with the + character. Happens with or without it.
Expected Behavior
Call starts and following callbacks/actions occurr.
Actual Behavior
Call does not start because of the callerId error, which has been notified to the action endpoint (myserver).
Reproduces How Often
100%
Logs
Provided before. The following screenshot is the parameters section of the function call. (I triggered an exception before the return callback to show this):
Above data is from a forced exception execution, the following CallSid is from a real one: CallSid: "CAbe5a4f0be368ca7bf4aa7eae79691703"
Versions
All relevant version information for the issue.
Voice iOS SDK
6.5.0 via CocoaPods
Xcode
14.0
iOS Version
16.1.1
iOS Device
iPhone SE 2020.