5

Our application accepts phone calls or VoIP connections via the twilio.js client into our twilio endpoint. Phone calls are logged by caller ID, but VoIP connections all appear as Anonymous in the twilio call log, e.g.:

Date    Direction   From        To  Type    Status      Recording   Duration
XXYY    Incoming    Anonymous   --- Client  Completed   ---         17 min 7 sec
YYZZ    Incoming    Anonymous   --- Client  Completed   ---         17 min 23 sec

Is there a way to set the From field for outgoing (client->twilio) calls? Looked through Twilio.Device.connect as well as the capability token docs and couldn't find any hints.

mygzi
  • 1,303
  • 1
  • 11
  • 21

3 Answers3

4

It all ties into the capability token step, in a completely undocumented (and apparently unknown to Twilio themselves) manner.

In order to get the twilio logs to identify the VoIP endpoint that called into a conference, we had to bind the client ID to the allow_client_incoming capability, and make sure the ID was a straight alphanumeric (e.g. dashes in the string prevented the ID from coming through).

In our server side (ruby) token generation step, it looks something like this:

    capability.allow_client_incoming sanitized_client_id
mygzi
  • 1,303
  • 1
  • 11
  • 21
1

Twilio evangelist here.

When Client connects to your TwiML app endpoint, the From parameter that is passed to the Voice Request URL should be the name of the client.

If that Voice Request URL includes the <Dial> verb telling Twilio to make an outbound phone call and bridge it with the Client call, you can set the callerId parameter:

<Dial callerId="+15555555555" />

Hope that helps.

Devin Rader
  • 10,260
  • 1
  • 20
  • 32
  • 1
    Tried that but still showing anonymous. Here's the TwiML we now send back: ``` conferenceId ``` – mygzi Feb 27 '15 at 00:32
  • Is the name you are giving your instance of Client when you create the capability token "Anonymous"? – Devin Rader Feb 27 '15 at 01:26
  • 1
    We use twilio-ruby gem to generate the capability token (with capability.allow_client_outgoing). Is there a way to name the client when creating the token? We certainly don't name it Anonymous ourselves, though I imagine the gem might do so under the hood. – mygzi Feb 27 '15 at 05:02
  • 1
    So the I think in your scenario that setting the callerID attribute on the Dial verb won't help since you are dialing a Conference. If you were dialing out to a number, setting the CallerID would tell Twilio to use that number as the caller ID of the outbound leg. I'm not sure however why the incoming call from Client is showing Anonymous as the From value. AFAIK, it should be showing the name of the client instance that is making the inbound call to Twilio. I'm trying to find out more details. – Devin Rader Feb 27 '15 at 15:52
  • @DevinRader, do you have any updates on this? I'd also like to be able to specify the client when dialing into a conference. – Justin Poliey Jun 14 '16 at 22:11
0

What worked for me was to set the clientName parameter in the OutgoingClientScope capability.

This is a code sample in js:

capability.addScope(
  new ClientCapability.OutgoingClientScope({
    clientName: 'mike',
    applicationSid: 'AP...'
  })
);

None of the other answers worked for me.

eminescu
  • 65
  • 6