Created
February 16, 2024 17:16
-
-
Save rajneeshksoni/a9aa49115baedac5eea8c1e9de739be9 to your computer and use it in GitHub Desktop.
twilio-sip-pstn-call-start
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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:[email protected]", | |
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