Twilio caller name on receive programmable voice call in ios application

0 votes

I’m using Twilio’s Programmable Voice in one of the projects. My primary requirement is to place VoIP class between mobile devices (no PSTN calls). I am able to place calls from one device to another, but unable to set appropriate Caller Name on Incoming Call screen.

Please guide me about how to display Caller’s name on receiving device. TVOCallInvite’s “from” value shows a mobile number “+18xxxxxxxx”, but I need to display the name of the caller. . We have created TwiML PHP file which contains the dialled client name and callerID (my twill number). We have assigned url of this file in TwiML app’s request URL (https://www.twilio.com/console/voice/twiml/apps/myappid).

We can assign name of the caller in CallKit’s “localizedCallerName”, but we are receiving phone number instead of caller’s identity.

Details: Tutorial Followed : https://github.com/twilio/voice-quickstart-swift TwilioVoice -> 2.0.0 iOS Version : 10.1 Device : iPhone 7 & iPhone 5S

Please find the attached screenshot.

enter image description here

Please note that I have searched google but I could not found the answer.

Thanks.

Below is my voice.php file

<?php

require __DIR__ . '/TwilioSdk/Twilio/autoload.php';
include('config.php');
use Twilio\Twiml;
$response = new Twiml;

if (isset($_REQUEST['To']) && strlen($_REQUEST['To']) > 0) 
{
  $number = htmlspecialchars($_REQUEST['To']);
  $dial = $response->dial(array('callerId' => $callerid)); // callerid is +18XXXXXXXXX
  if (preg_match("/^[\d\+\-\(\) ]+$/", $number)) 
  {
    $dial->number($number);
  } 
  else 
  {
    $dial->client($number);
  }
} 
else 
{
   $response->say("Thanks for calling!");
}
header('Content-Type: text/xml');
echo $response;

?>

Twilio console for call logs

enter image description here


 

Nov 22, 2022 in Mobile Development by gaurav
• 23,260 points
912 views

1 answer to this question.

0 votes

Twilio developer evangelist here.

In order to get a name to appear on the iOS call screen in CallKit you need to pass a client identifier as the callerId rather than a phone number.

Client identifiers should be prefixed with client:. So in the code above, the important part is generating the TwiML, which should look like this:

$response->dial(array('callerId' => 'client:' . $clientName));

Note, you must use a number as a callerID if you a dialling a phone number. If you are dialling another client, then you can use a phone number or client identifier. If you want the name to appear in the application, then I recommend a client identifier as above.

answered Dec 15, 2022 by gaurav
• 23,260 points

Related Questions In Mobile Development

0 votes
0 answers

Can't play video on iOS in Safari: NotAllowedError

When I click a play button on ...READ MORE

Nov 8, 2022 in Mobile Development by gaurav
• 23,260 points
1,396 views
0 votes
0 answers
0 votes
1 answer

How can I record a conversation / phone call on iOS?

For incoming calls, you can go to Settings ...READ MORE

answered Dec 15, 2022 in Mobile Development by gaurav
• 23,260 points
473 views
0 votes
0 answers

Accurate timing in iOS

I am looking at the 'Metronome' sample ...READ MORE

Nov 8, 2022 in Mobile Development by gaurav
• 23,260 points
395 views
0 votes
1 answer

How to show caller image on iOS native ui call by using callkit framework?

Apple's CallKit is a framework introduced with iOS ...READ MORE

answered Nov 4, 2022 in Others by gaurav
• 23,260 points
1,357 views
0 votes
0 answers

Twilio incoming call is not working in iOS

I am working on Twilio programmable voice ...READ MORE

Nov 17, 2022 in Mobile Development by gaurav
• 23,260 points
691 views
0 votes
0 answers

Default Ringtone on a VOIP app in iOS

I'm trying to find a way to ...READ MORE

Nov 16, 2022 in Mobile Development by gaurav
• 23,260 points
675 views
0 votes
1 answer

How do I create folder under an Amazon S3 bucket through PHP API?

Of Course, it is possible to create ...READ MORE

answered Apr 24, 2018 in AWS by anonymous
11,401 views
0 votes
1 answer

Flutter project in iOS emulator takes forever to run, but its worked on Android emulator

Try flutter clean and flutter build ios ...READ MORE

answered Nov 18, 2022 in Mobile Development by gaurav
• 23,260 points
640 views
0 votes
1 answer

Open webpage in fullscreen in Safari on iOS

Not all platforms are equal. iOS Safari doesn't ...READ MORE

answered Nov 25, 2022 in Mobile Development by gaurav
• 23,260 points
653 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP