3
votes

I have this specific Twilio use-case :-

Customer C1 calls Twilio Number T1. Call is received on T1 and it dials out to Customer C2, but C2 should see call coming from Twilio number T2 (Another number that I own but it lies in a different subaccount).

Now I know that if T1 and T2 belonged to the same subaccount, I could have used T2 as callerId while dialing out, something like :-

<?xml version="1.0" encoding="UTF-8" ?>
<Response>
        <Dial timeout="180" callerId="_fromNumber" record="_recordflag" action="_actionURL" >_toNumber</Dial>
</Response>

Here _fromNumber would have been T2. But since T1 and T2 don't belong to the same subaccount. I wasn't able to do it. Receiving :-

com.twilio.sdk.TwilioRestException: The source phone number provided, +1abc-efg-hijk, is not yet verified for your account. You may only make calls from phone numbers that you've verified or purchased from Twilio.

Is there a way I can achieve this using Master Keys ? I found that someone tried to achieve something similar here : Can I use a subaccount's number when making outgoing calls in Twilo

But since I am not the initiator of this call, that solution doesn't work for me.

1

1 Answers

0
votes

This is a more complicated approach but here is what you could do. When C1 calls T1, place him on a conference room. Hold music could be ring tone to make the callers experience seamless. Then Using the REST API spawn an outbound call to C2. At this point you could use the appropriate credentials to instantiate the client, and use the desired caller id. When C2 answers simply dial into the conference room, and you have both parties connected.