Skip to content

Instantly share code, notes, and snippets.

@rajneeshksoni
Created February 16, 2024 17:16
Show Gist options
  • Save rajneeshksoni/a9aa49115baedac5eea8c1e9de739be9 to your computer and use it in GitHub Desktop.
Save rajneeshksoni/a9aa49115baedac5eea8c1e9de739be9 to your computer and use it in GitHub Desktop.
twilio-sip-pstn-call-start
# start SIP and PSTN call
const accountSid = "";
const authToken = "";
const client = require("twilio")(accountSid, authToken);
client.calls
.create({
url: "WEB_HOOK_URI",
method: "POST",
to: "sip:DAILY_SIP_URI@daily-..............com",
from: "+1XXXXXXXX",
})
.then((call) => {
console.log("SIP call SID: " + call.sid);
return client.calls.create({
url: "WEB_HOOK_URI",
method: "POST",
to: "+1XXXXXXX",
from: "+91XXXXXXX",
});
})
.then((call) => {
console.log("PSTN call SID: " + JSON.stringify(call));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment