0
votes

I would like my Twilio app to be able to redirect the inbound SIP INVITE to a different telephony system in some cases. We are not using Twilio's carrier but using our own (thinQ) for origination and termination via SIP.

I do not want to forward the call via the Dial command as it would keep the Twilio app in the loop during call setup. Is is possible to do this?

1
How are you receiving this call? Is it a call to a Twilio number that you are responding to with TwiML? Do you have a SIP trunk or are you using SIP registration?philnash
It is a call to a ThinQ number which is configured to send the call over SIP to <account_domain>.sip.twilio.com using the instructions provided here - thinq.com/… No SIP registration is involved. The idea is for our Twilio app to handle some of these calls but also have the ability to redirect some of them to a different telephony system.andy318
Thanks for the extra detail. This is beyond what I know about SIP and Twilio, but I'm checking with the team about this and will have an answer for you soon.philnash

1 Answers

1
votes

Twilio developer evangelist here.

Twilio does not support returning a 302 redirect when receiving SIP as you describe.

When you set up to receive SIP and channel it through Twilio you need to respond to those incoming calls using TwiML and not SIP commands. Like you suggested, you could use a <Dial> which would direct the call elsewhere (including to other SIP addresses if you use <Sip>) but you cannot just respond with SIP instructions or a redirect.

If you do not want these calls to be handled by Twilio, then you will need to adjust your call routing before the SIP is sent to Twilio.