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.
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
callerId
to a client identifier, likeclient:yourClientIdentifier
. You should also be able to catch that identifier in the notification, replace it with a better identifier and update the display in the notification. I've not yet worked with CallKit myself though, so I'm not the best person to answer how you'd do that. – philnash$response->dial(array('callerId' => 'client:' . $clientName));
So you are seeing a name on the incoming call to the iOS app now then? – philnash