0

I have created a Twilio application in Python using the client like this:

    application = client.applications.create(voice_method='POST',
                                             voice_url='<voice-url>',
                                             status_callback='<voice-status-callback-url>',
                                             status_callback_method="POST",
                                             sms_url='<sms-url>',
                                             sms_method='POST',
                                             sms_status_callback='<sms-status-callback-url>',
                                             friendly_name='xyz')

Whenever a call needs to be made, I generate a token, add voice grant and send the token to React Front-end, and React uses JS SDK's Device.connect() to make the call like so:

  const callTwilioNumber = (token, phoneNumber) => {
    const postData = {
      phoneNumber: phoneNumber
    }
    currentCallDeviceCopy = new Device(token);
    let conn = await currentCallDeviceCopy.connect({ 
      params: {
        To:response.data.data,
      }
    });
    }).catch((error) => {
      ... Error handling ...
    });
  }

When I get callbacks using this implementation, The "to" parameter within the callback is an empty string. Is there any way to get the "to" num in the callback?

I have tried sending custom parameters in the Device.connect() method, but these custom parameters go to the application, and are not returned in the callbacks.

prabu naresh
  • 405
  • 1
  • 10

0 Answers0