Twilio: client to client call across subaccounts - twilio

I am working on Twilio APIs for client to client call. Everything is working fine with main account.
Now I have created a sub account and I wanted o see how the call connections are made across the sub accounts.
Using the sub account's account sid and auth token I am able to make outbound calls to phone numbers and is connecting fine.
Now when I tried to connect another client who has registered with the master accounts sid and auth token, I get the status as an answered even-though no call came at the other client end. And it is not at all connecting
And I noticed that even conference names are not visible across sub accounts. That is I tried to call to same conference room from different sub accounts of the same main account, but the users did not connect each other.
What could be the reason. How can I connect clients across sub accounts.

I got to understand from Twilio that calls can not be connected across sub accounts.

Related

Twilio: Send SMS from connected account

Here's what I'm trying:
curl -X POST -d "Body=Hi there, this is a test message from cURL" -d 'From=+1aaabbbcccc' -d "To=+1zzzxxxyyyy" "https://api.twilio.com/2010-04-01/Accounts/$TWILIO_CONNECTED_SUBACCOUNT_SID/Messages" -u "$TWILIO_CONNECTED_MAIN_ACCOUNT_SID:$TWILIO_AUTH_TOKEN"
Where $TWILIO_CONNECTED_SUBACCOUNT_SID is a account SID with the phone number I want to send from. $TWILIO_CONNECTED_MAIN_ACCOUNT_SID is the account SID that the connect button sent back to me (has a name like "Subaccount for ConnectApp: ..."). $TWILIO_AUTH_TOKEN is my (not the connected account's) auth token.
I've tried various permutations of the 3 account SIDs but can't get any of them to work. How do I send an SMS on behalf of a connected account?
I got it to work if I purchase a new number for the $TWILIO_CONNECTED_MAIN_ACCOUNT_SID account via cURL. But I don't want to build a UI for purchasing numbers in my app, I want to let users just pick a number they already own on Twilio, from their main account. Is that possible?
Twilio developer evangelist here.
According to the docs, under permissions:
Charge account for usage
This allows your Connect App to perform actions that charge your user’s Twilio account such as make and receive phone calls, send and receive SMS messages, and buy phone numbers. Your Connect App will not have access to resources in the user’s parent account, like phone numbers. Instead, your Connect App must buy phone numbers on behalf of the user, using the Account SID passed to your Authorize URL.
Emphasis mine.
So, you cannot use a connect account to send messages from existing resources. You will need to buy a new number to send.
An alternative to using Connect here, that would give you access to the account's resources would be to have the user submit their Account SID and an API Key/Secret pair. While it's never ideal to share credentials, an API Key/Secret pair can be easily deactivated without affecting the rest of the account.

Adding Existing Numbers to Twilio Connect SID

We're currently building a Twilio Connect App and testing with our Twilio Projects.
Our main SID is e.g. AC336 and when flow through Twilio Connect, we get a new SID e.g. AC294
We can successfully authenticate with this SID and contact the REST API.
The issue is, this new SID (AC294) has no numbers associated with it, hence we can't send any messages. However, with our App, we want existing Twilio customers to authorise our App and use their existing numbers. We do not wish to or need to, offer to buy them numbers as they likely already have them on their account.
When we currently call the following using the 'new' SID, we get no data:
$incomingPhoneNumbers = $this->twilio->incomingPhoneNumbers
->read(array(), 20);
But if we authenticate with our parent SID e.g. AC336 then we get our phone numbers, as expected.
Is it possible, via Twilio Connect, to make the numbers available in the 'parent' SID (AC336 in our case) available to the authorised App SID (AC294 in this example)?

twilio how to get possible users

I retrieved an access token from my server and have connected the JavaScript SDk chat client like so. I have created a channel like so. The next step I'd like to invite a user like this. In that example they invite the user 'elmo'. Where do I get 'elmo' or how do I present the user with a selection of possible 'elmo's? The client sdk has no list users functionality.
Edit:
It looks like the REST API has a list users method. But can't find any examples of it used. Should the 1st person chat client be using the REST API as well to supplement gaps in the client SDK or should it get the identity from backend? Our team has different interpretations of the docs: twilio REST API is strictly for backend vs. twilio REST API can and should be used any where. Moved to twilio REST API: strictly backend?
Twilio developer evangelist here.
In my opinion Twilio's Chat API should not be the central source of truth of the users in your system. I don't know anything more about your application than what you've written here, but I would expect that you have a user model within your own system that you have used to generate or create an identity that is then used by the Chat API as well as how your user logs in to your system. I would then use that user model to connect users and provide their identities so that they can join chats together.

Twilio studio connect call to SIP

I'm trying to setup a simple flow using Twilio studio, with the last widget being "Connect call to".
I want to have a caller connected to an agent with a SIP client, registered with the SIP domain in Twilio. The SIP client that's registered to the SIP domain is nothing but a Bria SIP client iOS app that has successfully registered with the SIP domain.
When I type in twilio's SIP domain details as the end point along with the username and password, the flow gets published fine.
When I test the flow by calling the number that triggers the flow, I do get the options as per the flow. I then press certain keys that triggers the "Connect call to" widget in question. At this point, call ends without connecting to the SIP client. I also see this error event, 32009 - The user you tried to dial is not registered with the corresponding SIP Domain.
Am confused. I tried looking into the documentation on Twilio but no luck.
Did you use the below format, making sure to include the us1 subdomain?
USERNAME#SIPDOMAIN.sip.us1.twilio.com

Twilio Connect problems

I'm trying to implement Twilio Connect to allow users to use their phone numbers with my app.
In the Twilio console, I see ACd8e3e060b587765318760d5bcd05e3b0 as my Account Sid. However, when I connected a Twilio Connect app to my account, it redirects me to an authorization page with a totally different Account Sid: ACbab18d9990e7af4a42feb51c96cc136f. The problem is that this Account Sid does not have any Incoming Phone Numbers. I provided all the required permissions, how do I use it?
According to the documentation:
When a user revokes permission to your Connect App, Twilio will make an HTTP request to the DeauthorizeCallbackURL. You should update your user database to reflect this.
Where can I revoke permission? Is there some list of Connect Apps which I allowed to use with my account?

Resources