We use the following api to make an outbound call. Can we use a sip address in the From parameter to use SIP trunk.
$call = $client->calls->create(
"+1XXXXXXXXXX", "+1XXXXXXXXXX",
array("url" => "http://demo.twilio.com/docs/voice.xml")
);
Twilio developer evangelist here.
You cannot provide a SIP address as a From parameter when making calls. The documentation describes the required parameters for a call as:
Parameter Description
From The phone number or client identifier to use as the caller id.
If using a phone number, it must be a Twilio number or a Verified
outgoing caller id for your account.
To The phone number, SIP address or client identifier to call.
So, you can only use a phone number or a client identifier. The To
parameter can be a SIP address, so you can make calls from the API to a SIP address, just not from one.
If you are using SIP trunking you need to initiate calls via SIP.