Skip to main content

SIP Integration

Integrate Kallglot with your existing PBX, contact center, or telephony infrastructure using standard SIP protocols.

Prerequisites

  • A SIP-capable PBX or telephony system
  • Network connectivity between your PBX and Kallglot
  • A Kallglot API key
  • TLS support recommended for secure media

Architecture

Setup Steps

1. Configure SIP Credentials

Create your developer account at kallglot.com, then in the Developer Portal:
  1. Go to Settings > SIP Configuration
  2. Create SIP credentials:
    • Username: Your SIP username
    • Password: Generate a secure password
    • Allowed IPs: Your PBX IP addresses (optional but recommended)
  3. Note the SIP endpoint: sip.kallglot.com

2. Create Sessions via API

Before routing a call to Kallglot, create a session:
Kallglot does not currently provide official SDKs. Helper functions like createKallglotSession(...) and endKallglotSession(...) in this guide are thin wrappers around the HTTP API.
async function createSIPSession(callerInfo) {
  const session = await createKallglotSession({
    mode: 'bidirectional_translation',
    source_language: 'de',
    target_language: 'en',
    provider: {
      type: 'sip',
      transport: 'tls',  // Use TLS for encryption
      codecs: ['PCMU', 'PCMA', 'opus']  // Preferred codecs
    },
    metadata: {
      caller_id: callerInfo.callerId,
      internal_call_id: callerInfo.internalId
    }
  });

  // The SIP URI to route the call to:
  const sipUri = `sip:${session.id}@sip.kallglot.com`;

  return { session, sipUri };
}

3. Configure Your PBX

Route calls to the Kallglot SIP endpoint. Configuration varies by PBX:

Asterisk

; sip.conf
[kallglot]
type=peer
host=sip.kallglot.com
port=5061
transport=tls
username=your_sip_username
secret=your_sip_password
fromdomain=sip.kallglot.com
qualify=yes
disallow=all
allow=opus
allow=ulaw
allow=alaw

; extensions.conf
[translated-calls]
exten => _X.,1,Dial(SIP/kallglot/${SESSION_ID})

FreeSWITCH

<!-- sofia.conf.xml -->
<gateway name="kallglot">
  <param name="username" value="your_sip_username"/>
  <param name="password" value="your_sip_password"/>
  <param name="realm" value="sip.kallglot.com"/>
  <param name="proxy" value="sip.kallglot.com"/>
  <param name="register" value="false"/>
  <param name="caller-id-in-from" value="true"/>
</gateway>

<!-- dialplan -->
<extension name="translated_call">
  <condition field="destination_number" expression="^(\d+)$">
    <action application="bridge" data="sofia/gateway/kallglot/${SESSION_ID}@sip.kallglot.com"/>
  </condition>
</extension>

Cisco CUCM

  1. Add a SIP Trunk:
    • Destination Address: sip.kallglot.com
    • Port: 5061
    • Transport Type: TLS
  2. Configure SIP Security Profile with digest authentication
  3. Create a Route Pattern pointing to the trunk

4. Handle Call Flow

Typical call flow with session management:
// When a call comes in to your PBX
app.post('/pbx/incoming', async (req, res) => {
  const { callId, from, to } = req.body;

  // 1. Create Kallglot session
  const { session, sipUri } = await createSIPSession({
    callerId: from,
    internalId: callId
  });

  // 2. Store mapping
  await db.callMappings.insert({
    internal_call_id: callId,
    kallglot_session_id: session.id
  });

  // 3. Return SIP URI for PBX to route to
  res.json({
    action: 'route',
    destination: sipUri
  });
});

// When call ends
app.post('/pbx/hangup', async (req, res) => {
  const { callId } = req.body;

  // Find and end Kallglot session
  const mapping = await db.callMappings.findOne({ internal_call_id: callId });
  if (mapping) {
    await endKallglotSession(mapping.kallglot_session_id);
  }

  res.status(200).send('OK');
});

SIP Configuration Options

Transport

TransportPortSecurity
TLS5061Recommended for production
TCP5060Unencrypted, use only in private networks
UDP5060Not recommended

Codecs

Kallglot supports these audio codecs (in order of preference):
CodecBandwidthQuality
OpusVariableBest
G.72264 kbpsHigh
PCMU (G.711μ)64 kbpsGood
PCMA (G.711a)64 kbpsGood
provider: {
  type: 'sip',
  codecs: ['opus', 'G722', 'PCMU']  // Priority order
}

DTMF

DTMF is passed through transparently:
// Handle DTMF events
session.on('dtmf', (data) => {
  console.log(`DTMF digit: ${data.digit}`);
});

Security

TLS Configuration

Always use TLS for SIP:
provider: {
  type: 'sip',
  transport: 'tls',
  tls: {
    verify_certificate: true,
    min_version: 'TLSv1.2'
  }
}

IP Allowlisting

Restrict which IPs can connect:
  1. Go to Developer Portal > SIP Configuration
  2. Add your PBX IP addresses to Allowed IPs
  3. Connections from other IPs will be rejected

SRTP for Media

Enable SRTP for encrypted media:
provider: {
  type: 'sip',
  transport: 'tls',
  srtp: {
    enabled: true,
    crypto_suites: ['AES_CM_128_HMAC_SHA1_80']
  }
}

Advanced Scenarios

SIP REFER for Transfers

Handle call transfers with SIP REFER:
// Enable REFER support
const session = await createKallglotSession({
  mode: 'bidirectional_translation',
  provider: {
    type: 'sip',
    refer: {
      enabled: true,
      notify_url: 'https://your-app.com/webhooks/sip/refer'
    }
  }
});

// Handle REFER requests
app.post('/webhooks/sip/refer', async (req, res) => {
  const { session_id, refer_to, referred_by } = req.body;

  // Create new session for transfer target
  const newSession = await createKallglotSession({
    mode: 'bidirectional_translation',
    // ... same config
  });

  // Accept the REFER
  res.json({
    accept: true,
    new_session_id: newSession.id
  });
});

Multiple Participants

For conference calls with translation:
// Create a conference session
const conferenceSession = await createKallglotSession({
  mode: 'bidirectional_translation',
  source_language: 'auto',  // Detect each participant's language
  target_language: 'en',
  conference: {
    enabled: true,
    max_participants: 5
  }
});

// Each participant connects to the same SIP URI
// sip:${conferenceSession.id}@sip.kallglot.com

Failover

Configure failover for high availability:
provider: {
  type: 'sip',
  endpoints: [
    { uri: 'sip.kallglot.com', priority: 1 },
    { uri: 'sip-eu.kallglot.com', priority: 2 },
    { uri: 'sip-ap.kallglot.com', priority: 3 }
  ],
  failover: {
    enabled: true,
    timeout: 3000  // ms to wait before trying next endpoint
  }
}

Troubleshooting

Registration Issues

# Test SIP connectivity
sipsak -s sip:test@sip.kallglot.com -v

# Check firewall allows SIP traffic
nc -zv sip.kallglot.com 5061

No Audio

  1. Check NAT configuration - ensure RTP ports are open
  2. Verify SRTP settings match on both sides
  3. Check codec negotiation in SIP logs

Call Quality Issues

  1. Monitor jitter and packet loss
  2. Check network latency to Kallglot
  3. Consider using regional endpoints

Debugging

Enable SIP debugging:
const session = await createKallglotSession({
  mode: 'bidirectional_translation',
  provider: {
    type: 'sip',
    debug: {
      sip_trace: true,
      pcap_capture: true  // Enterprise only
    }
  }
});

Best Practices

Always encrypt signaling (TLS) and media (SRTP) for production deployments.
Configure your PBX with failover to handle Kallglot outages gracefully.
Set up monitoring for RTP quality metrics (MOS, jitter, packet loss).
Create sessions before calls are established to reduce setup latency.