diff --git a/fern/advanced/sip/sip-telynx.mdx b/fern/advanced/sip/sip-telynx.mdx new file mode 100644 index 0000000..56988bd --- /dev/null +++ b/fern/advanced/sip/sip-telynx.mdx @@ -0,0 +1,167 @@ +--- +title: Telynx SIP Integration +subtitle: How to integrate SIP Telnyx to Vapi +slug: advanced/sip/telynx +--- +## Inbound +### On Vapi + + + +First we will create a personalized origination SIP URI via the Vapi API + +```json +curl --location 'https://api.vapi.ai/phone-number' \ + --header 'Authorization: Bearer your-vapi-private-api-key' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "provider": "vapi", + "sipUri": "sip:username@sip.vapi.ai", + "assistantId": "your-assistant-id" + }' +``` + - ```provider```: This is set to "vapi". + - ```sipUri```: Replace ` username ` with your desired SIP username. + - ```assistantId```: Provide your specific `assistant ID` associated with your Vapi AI account. + + + + +Send a PATCH to /phone-number/your_phone_id + +```json + curl --location --request PATCH 'https://api.vapi.ai/phone-number/your_phone_id' \ + --header 'Content-Type: application/json' \ + --header 'Authorization: Bearer your-vapi-private-api-key' \ + --data '{ + "assistantId": null, + "serverUrl": "https://your_server_url" + }' +``` +- `your_server_url` is the webhook link that will receive the assistant request. +- `your_phone_id` is the id of your just created origination sip URI + +Now every time you make a call to this number (i.e. assigned numbers on SIP trunking to this origination URI), you'll get a webhook event requesting an assistant. + + + +### On Telynx + + +1. Go to Voice / SIP Trunking / Create +2. Select FQDN +3. Select add FQDN +4. Select A +5. Add created SIP URI +6. FQDN: sip.vapi.ai +7. Port should be 5060 by default + + +Set as follows: + + + + + +Go to numbers tab, assign number + + +Modify SIP invite so your VAPI and Telnyx accounts will be matched correctly +1. Go to numbers, edit the one your will be using +2. Navigate do voice +3. Scroll down till the end to find Translated Number + +*This setting will modify the SIP Invite to the vapi platform so invites are sent to your vapi sip URI. It will be whatever value you set when you created it.* + +4. If your chosen sipURI from previous step is username@sip.vapi.ai , this should be username +5. Done! You should now be receiving calls! + + + +## Outbound +### On Telynx + + +1. Go to Voice / Sip Trunking / Authentication and routing +2. Scroll down to outbound calls authentication and: +- Add the two fixed IPs from VAPI, select Tech Prefix and create a unique 4-digits Tech Prefix (example 1234 - don't use 1234, must be unique to your account) + + + + + +1. Go to voice / outbound voice profiles +2. Create profile +3. Name it as you will (1. details) +4. Allow as desired destination (2. destinations) +5. Leave the next screen as is (3. configuration) +6. Assign the desired sip trunk (4. …) +7. Complete + +Or you an just go to sip trunk / you sip trunk / outbound / and select your just created outbound voice profile. + + +Set as follows, choosing the country that you will be making most calls to (example Brazil) + +*We recommend creating a separate SIP Trunk for each country you aim to be making most calls to.* + + + + + +### On Vapi + + +```json +curl -X POST https://api.vapi.ai/credential \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer your-vapi-private-api-key" \ + -d '{ + "provider": "byo-sip-trunk", + "name": "Telnyx Trunk", + "gateways": [ + { + "ip": "sip.telnyx.com" + } + ] + }' +``` + + +```json +curl -X POST https://api.vapi.ai/phone-number \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer your-vapi-private-api-key" \ + -d '{ + "provider": "byo-phone-number", + "name": "Telnyx SIP Number", + "number": "your-sip-phone-number", + "numberE164CheckEnabled": false, + "credentialId": "your-new-trunk-credential-id-which-you-got-from-previous-step" + }' +``` + + +Use this cURL to trigger calls with tech prefix +```json +curl --location 'https://api.vapi.ai/call/phone' \ + --header 'Authorization: Bearer your-vapi-private-api-key' \ + --header 'Content-Type: application/json' \ + --data '{ + "assistantId": "your-assistant-id", + "customer": { + "number": "tech-prefix-with-phone-number-without-plus-signal", + "numberE164CheckEnabled": false + }, + "phoneNumberId": "your-phone-id" +}' +``` +Example of tech-prefix-with-phone-number-without-plus-signal +- Phone number: +6699999999 +- Tech Prefix: 1234 +- Should look like this: 12346699999999 +- No + as you can see + +Done! Outbound should now be working! + + \ No newline at end of file diff --git a/fern/advanced/calls/sip.mdx b/fern/advanced/sip/sip.mdx similarity index 97% rename from fern/advanced/calls/sip.mdx rename to fern/advanced/sip/sip.mdx index dcf8f17..a09e2c4 100644 --- a/fern/advanced/calls/sip.mdx +++ b/fern/advanced/sip/sip.mdx @@ -1,7 +1,7 @@ --- -title: SIP +title: SIP Introduction subtitle: You can make SIP calls to Vapi Assistants. -slug: advanced/calls/sip +slug: advanced/sip --- diff --git a/fern/docs.yml b/fern/docs.yml index a10b671..5fca4b7 100644 --- a/fern/docs.yml +++ b/fern/docs.yml @@ -237,10 +237,14 @@ navigation: path: call-forwarding.mdx - page: Ended Reason path: calls/call-ended-reason.mdx - - page: SIP - path: advanced/calls/sip.mdx - page: Live Call Control path: calls/call-features.mdx + - section: SIP + contents: + - page: SIP Introduction + path: advanced/sip/sip.mdx + - page: Telynx Integration + path: advanced/sip/sip-telynx.mdx - page: Make & GHL Integration path: GHL.mdx - page: Tools Calling diff --git a/fern/static/images/.DS_Store b/fern/static/images/.DS_Store index 0e3b477..ec5497f 100644 Binary files a/fern/static/images/.DS_Store and b/fern/static/images/.DS_Store differ diff --git a/fern/static/images/sip/.DS_Store b/fern/static/images/sip/.DS_Store new file mode 100644 index 0000000..939f321 Binary files /dev/null and b/fern/static/images/sip/.DS_Store differ diff --git a/fern/static/images/sip/telynx-inbound.png b/fern/static/images/sip/telynx-inbound.png new file mode 100644 index 0000000..03508a2 Binary files /dev/null and b/fern/static/images/sip/telynx-inbound.png differ diff --git a/fern/static/images/sip/telynx-outbound-auth.png b/fern/static/images/sip/telynx-outbound-auth.png new file mode 100644 index 0000000..7335959 Binary files /dev/null and b/fern/static/images/sip/telynx-outbound-auth.png differ diff --git a/fern/static/images/sip/telynx-outbound-settings.png b/fern/static/images/sip/telynx-outbound-settings.png new file mode 100644 index 0000000..39dd992 Binary files /dev/null and b/fern/static/images/sip/telynx-outbound-settings.png differ