0

To make outbound calls, I have followed below steps.

  1. Created SIP domain
  2. Registered SIP domain with SIP client Linphone app in my mobile
  3. Bought number
  4. Created TWIML to dial SIP address like below

<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Dial callerId="+18509205223">
    <Sip>sip:101@rajendra.sip.us1.twilio.com</Sip>
  </Dial>
</Response>

Followed this steps to set up.

I could not make the call from Twilio to Sip client(Linphone android app) using below script.

client = Client(account_sid, auth_token)


call = client.calls.create(
 application_sid='APdfd1bcaf3d2xxxxxxxxxxxxxxxxxxxx',
url='/2010-04-01/Accounts/APdfd1xxxxxxxxxxxxxxxxxxxxx/Calls',
to='sip:101@example.sip.us1.twilio.com',
from_='+18509205223')

print(call.sid)

I didn't find any proper docs to make SIP outbound calls.

Rajendra
  • 373
  • 1
  • 2
  • 18

1 Answers1

0

Twilio developer evangelist here.

You have your SIP domain set up. You'll need to setup some credentials for your softphone. Credentials are username and passwords that will be accepted by your SIP domain. You can enter those credentials in your softphone and the phone will be registered with your SIP domain and ready to make and receive calls.

To make outbound calls, you initiate the call from your soft phone. When the call reaches Twilio, Twilio will make a request to your webhook you set up for your SIP domain for outbound calls.

The simplest thing you can do is set this to a TwiML Bin that forwards the call onto the number you dialed.

That TwiML Bin could look like this:

<Response>
    <Dial callerId="YOUR_CALLER_ID">{{#e164}}{{To}}{{/e164}}</Dial>
</Response>

There are more details on how this works available in the SIP registration documentation.

Let me know if that helps at all.

philnash
  • 70,667
  • 10
  • 60
  • 88