Skip to main content

Generic integration (custom web app): Set up Softphone v2

Embed Call Center Studio Softphone v2 in your own web application or CRM with an iframe before Softphone v1 is retired on March 1, 2027.

O
Written by Oğulcan Culfa

Softphone v1 will be retired on March 1, 2027. If you embed the softphone in your own web application, or in a CRM that has no dedicated Call Center Studio integration, follow the steps below to switch to Softphone v2 before that date.

What you get with Softphone v2

  • The full softphone in your page: Agents make and receive calls, handle chats and change their status without leaving your application.

  • Click-to-call: Your application can start a call by sending a phone number to the softphone.

  • Call events: Your application receives a message at each step of a call (incoming, answered, ended and more), so you can open the caller's record or log the call.

  • Pre-filled tenant: Put your tenant address in the URL so agents only enter their email and password.

  • OAuth sign-in (optional): Agents can sign in through your Call Center Studio login page instead of typing a password in the softphone.

Before you start

Step 1 – Add the softphone to your page

Add an iframe that loads the softphone. Replace yourcompany.callcenterstudio.com with your tenant address.

<iframe
  id="softphone"
  src="https://softphone-cti.callcenterstudio.com/integrations/generic?tenant=yourcompany.callcenterstudio.com"
  sandbox="allow-forms allow-modals allow-popups allow-same-origin allow-scripts"
  allow="camera *; geolocation *; microphone *; clipboard-write *"
  width="400"
  height="650"
  style="border: 0;">
</iframe>

  • microphone in the allow attribute is required for calls. Without it, the browser blocks the microphone and calls have no audio.

  • Choose a width and height that fit your layout. The softphone adjusts to the space it is given.

  • Use the sandbox and allow values exactly as shown above.

Step 2 – Choose the URL parameters

Add these parameters to the end of the iframe URL, for example ?tenant=yourcompany.callcenterstudio.com&clientId=123456.

Parameter

What it does

tenant (recommended)

Your Call Center Studio tenant address, for example yourcompany.callcenterstudio.com. When it is set, the tenant field is hidden on the login screen. If you leave it out, agents type the tenant address themselves.

clientId

Optional. Create it in the panel, see Optional: Create an OAuth client ID below. When it is set, the login screen shows a Sign in with OAuth button and agents sign in through your Call Center Studio login page. Leave it out to sign in with email and password.

ssoLogin

Optional. Set to true to show only an SSO Login button, which opens your tenant's single sign-on page in a new tab. Use it only if single sign-on is set up for your tenant, and always together with tenant. Don't combine ssoLogin=true with clientId: with both, the button runs OAuth sign-in instead of single sign-on.

Note: If you later change tenant or clientId in the URL to a different value, signed-in agents are signed out and need to sign in again. Removing the parameter from the URL doesn't sign them out.

Optional: Create an OAuth client ID

  1. Sign in to the panel as a System Administrator and open System Administrator > Applications > Alotech CTI SSO.

  2. Click New.

  3. In the CTI SSO Integration Settings window, fill in:

    • Turn on Active.

    • Enter an OAuth Integration Name. Any descriptive name works.

    • In Callback URL, enter both https://softphone-cti.alo-tech.com/oauth and https://softphone-cti.callcenterstudio.com/oauth.

  4. Click Save. A Client ID is generated. Copy it and add it to the iframe URL as the clientId parameter, alongside tenant, for example ?tenant=yourcompany.callcenterstudio.com&clientId=123456.

Note: Turning Active off signs out all users immediately. For security, users must sign in with their username and password again every 30 days.

Step 3 – Sign in and test

  1. Open the page that contains the softphone.

  2. Sign in:

    • Without clientId: Enter your email and password (and your tenant address, if it isn't in the URL), and click Log In.

    • With clientId: Click Sign in with OAuth and complete the sign-in on the Call Center Studio page that opens in a new tab. The softphone signs you in automatically. To sign in with email and password instead, turn off the Sign in with OAuth switch.

  3. If the browser asks for microphone access, click Allow.

  4. Set your status to Ready.

  5. Make a test call from the softphone.

Note: Keep the softphone open in only one browser tab per user. Signing in from several tabs at once causes problems with calls.

Step 4 – Connect your application (optional)

Your application and the softphone exchange browser postMessage messages. You need this step only if you want click-to-call, or want your application to react to calls.

Start a call from your application (click-to-call)

Send a Click2Call message with the number to call to the softphone iframe:

const SOFTPHONE_ORIGIN = "https://softphone-cti.callcenterstudio.com";
const softphone = document.getElementById("softphone");
 
softphone.contentWindow.postMessage(
  { messageType: "Click2Call", number: "905551234567" },
  SOFTPHONE_ORIGIN
);

The softphone accepts the message as an object or as a JSON string. number must be text, written the way the agent would dial it. The agent must be signed in and connected. If the agent is signed in but not connected, the softphone shows an error and doesn't dial; if the agent isn't signed in, the message is ignored.

Receive call events

The softphone sends every event to the top-level window of your page (window.top) as a JSON string. Each message contains:

  • messageType: the event name (see the table below).

  • sender: always AloTech.

  • username: the agent's email address.

  • session: the agent's session token.

  • tenant: your tenant address (included in call, status and chat messages).

const SOFTPHONE_ORIGIN = "https://softphone-cti.callcenterstudio.com";
 
window.addEventListener("message", (event) => {
  if (event.origin !== SOFTPHONE_ORIGIN) return;
 
  let data;
  try {
    data = typeof event.data === "string" ? JSON.parse(event.data) : event.data;
  } catch {
    return;
  }
 
  if (data?.sender !== "AloTech") return;
 
  switch (data.messageType) {
    case "IncomingCall":
      console.log("Incoming call from", data.number);
      break;
    case "Hangup":
      console.log("Call ended", data.activecallkey);
      break;
  }
});

The main call events are:

Event (messageType)

When it is sent

Key fields

Registered

The softphone is connected and can make and receive calls.

–

Unregistered, RegistrationFailed, Disconnected

The softphone lost its connection or couldn't connect.

–

AgentStatus

The agent's status changes.

status

IncomingCall

A call starts ringing for the agent.

number, maskedNumber, queueName, activecallkey, call_id, active_line, isDialer, outbound

ShowRinging

The ringing call is shown in the softphone.

number, queueName, activecallkey, call_id, active_line, showRejectButton

Dial

The agent starts an outgoing call.

number, maskedNumber, queue_name, activeLine

OutgoingActiveCallKey

The outgoing call receives its call key.

number, activecallkey, active_line, click2call, isDialer, outbound

Answer

The agent answers a ringing call, or the call is answered automatically.

message, autoInstantAnswer (automatic answer only)

Accept

The call is connected (incoming or outgoing).

number, activecallkey, active_line, queueName, dnis, outbound, click2call, isDialer, isTransfer, transferType

Reject

The agent rejects a ringing call.

–

CallFailed

A call fails or is cancelled before it connects.

status_code (can be absent)

Hold, Talking

A call is put on hold, or taken off hold.

active_line

Transfer

The agent transfers a call. It is also sent when a transfer fails, so check success before acting on it.

transferType, success, attendantkey

Hangup

The call ends.

number, activecallkey, call_id, active_line, outbound, click2call, isDialer, causecode

  • number is the customer's phone number. When number masking is on, maskedNumber holds the masked version.

  • activecallkey identifies the call. Use it to match the events of one call.

  • active_line is Line1 or Line2, depending on which line the call is on.

  • A listed field can be absent from a message, for example status_code in CallFailed. Check that a field exists before you use it.

The softphone also sends other events, for example for chats (ChatRinging, ChatAnswer, NewMessage) and mute (MuteMicToggle). Ignore any messageType your application doesn't use.

To test, make a call from the softphone and check that your page receives the Dial, Accept and Hangup messages.

Moving from Softphone v1

If you embedded Softphone v1, make these changes:

  • Parameters: tenant works as before. logo and lang are no longer used; the softphone language follows each agent's language setting. clientId and ssoLogin are new.

  • SSO page: The v1 /generic/sso/ page, which signed agents in with a tenant and session, is not available. Use clientId (OAuth) or ssoLogin instead.

  • Click2Call: No change needed if you send number as text; Softphone v2 ignores a Click2Call message whose number is not text. Softphone v2 also accepts the message as a JSON string.

  • Status is now AgentStatus. Talking is now sent only when a call is taken off hold; use AgentStatus to see when the agent's status changes to talking.

  • Changed fields: ShowRinging sends queueName instead of queuename. IncomingCall no longer sends called_num, and OutgoingActiveCallKey no longer sends callerid. Transfer sends transferType, success and attendantkey instead of the raw event, and it is now also sent for failed transfers, so check success. Answer sends message instead of isAnswer, and after an automatic answer it sends autoInstantAnswer instead of number, queuename and call_id. MuteMicToggle sends message instead of isMuteMicrophone.

  • New: Call, status and chat messages include tenant; connection messages such as Registered, Unregistered and Disconnected don't. Hold and Talking include active_line. IncomingCall includes queueName and maskedNumber. CallFailed is a new event.

  • No longer sent: PopupEvent, SupervisorMessage and popupmessage.

Troubleshooting

  • The login page keeps reloading or you can't sign in: Allow third-party cookies in your browser.

  • The OAuth sign-in page doesn't open: Allow pop-ups for your application's site in your browser.

  • Calls have no audio or the microphone doesn't work: Check that the iframe has the sandbox and allow attributes exactly as shown in Step 1 (microphone is required for calls), that your page uses HTTPS, and that microphone access is allowed in the browser.

  • Your page doesn't receive events: Listen for messages on the top-level window. If the softphone iframe is inside another iframe, the messages go to the outermost page. Also check that your code compares event.origin with https://softphone-cti.callcenterstudio.com and parses the message with JSON.parse.

  • Click2Call doesn't start a call: Send the message to the iframe's contentWindow, write messageType exactly as Click2Call, send number as text, and make sure the agent is signed in and connected.

  • The softphone doesn't load or can't connect: Check that your firewall or proxy allows the following addresses: https://softphone-cti.callcenterstudio.com, https://cdn.alo-tech.com, https://chatserver.alo-tech.com, https://service-edge.alo-tech.com. Also make sure that access from foreign IP addresses is not blocked.

  • Browser settings are managed by your IT team: Ask them to check whether a group policy blocks third-party cookies.

  • Still not working: Try again in an incognito window. If it works there, a browser extension (such as an ad blocker) is likely blocking the softphone.

If the problem continues, contact our support team.

Did this answer your question?