CallAgent SDK Not Returning Agent Phone Number in E.164 Format

Zoho Corporation 0 Reputation points
2025-08-06T18:59:39.41+00:00

We are currently using Azure Communication Services (ACS) to make and receive calls via the CallAgent and CallClient SDKs.

When attempting to retrieve the agent's phone number using: CallAgent.TeamsCallAgentImpl.getUserProperties().phoneNumber, we receive the number without the '+' prefix (e.g., 1925XXXXXX).

However, for inbound calls, the customer's number is returned in E.164 format via: TeamsIncomingCallImp.callerInfo.identifier.phoneNumber.

Could you please confirm if it is expected behavior for the agent's phone number to be returned without the '+' symbol when using the CallAgent SDK?

Azure Communication Services
{count} votes

1 answer

Sort by: Most helpful
  1. Siva Nair 345 Reputation points Microsoft External Staff Moderator
    2025-08-06T19:28:24.5833333+00:00

    Hi Zoho Corporation,

    Yes, this is expected behavior.

    When retrieving the agent's phone number using:

    CallAgent``.TeamsCallAgentImpl.getUserProperties().phoneNumber

    The SDK may return the number without the '+' prefix, such as 1925XXXXXXX. This is because the SDK does not enforce E.164 formatting on the agent's own number in this context. The format returned depends on how the number was provisioned or stored in the ACS resource.

    In contrast, for incoming PSTN calls, the caller's number is returned in E.164 format (e.g., +1925XXXXXXX) via:

    TeamsIncomingCallImp.callerInfo.identifier.phoneNumber

    This is consistent with telephony standards, where incoming numbers are expected to be in E.164 format for interoperability and identification.

    Normalize Agent's Number to E.164 Format

    To ensure consistency across your application, you can normalize the agent’s number manually. simple JavaScript utility:

    function normalizeToE164(phoneNumber, countryCode = '+1') {
      if (!phoneNumber.startsWith('+')) {
        return `${countryCode}${phoneNumber}`;
      }
      return phoneNumber;
    }
    // Example usage
    const rawNumber = callAgent.getUserProperties().phoneNumber;
    const normalizedNumber = normalizeToE164(rawNumber);
    

    Let me know, if you need further assistance.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.