KontrolX Admin

SIP Client Connection Guide

Reference for third-party SIP clients connecting via digest authentication. Share this with integrators that need to register against KontrolX.
Document
Rendered from docs/sip-client-authenticated-connection.md. Edits to that file update this page automatically.

KontrolX SIP — Authenticated Client Connection Guide

Version: 1.0 Protocol: SIP/UDP with digest auth (MD5) Audience: External SIP operators, integrators, softphones


1. Overview

This connection mode lets you reach the KontrolX service from any public IP using a SIP username/password pair. Unlike IP-whitelist integration, you do not need a static IP — the credentials we provide are enough.

Typical use cases:

  • Desktop or mobile softphones (Linphone, Zoiper, MicroSIP, etc.)
  • Integrations with systems like CallShaper, dialing platforms, dialers
  • B2B trunks where the client cannot guarantee a fixed IP

2. Connection Parameters

ParameterValue
SIP Server / Domainsip.kx21.com
SIP Port5060
TransportUDP (preferred) or TCP
Authentication Realmsip.kx21.com (leave blank if your client allows — it is autodiscovered from the 401)
Auth MethodDigest MD5 (RFC 2617)
Outbound Proxysip.kx21.com:5060
Supported CodecsG.711 µ-law (PCMU), G.711 a-law (PCMA)
DTMFRFC 2833
RTP Port Range20000–20999 UDP
TLS / SRTPNot supported (yet)

Important: sip.kx21.com resolves via DNS to the server's public IP. If your client or firewall requires an IP rather than a hostname, contact support to obtain it. The server advertises the realm in the WWW-Authenticate header; modern softphones derive it automatically, so we recommend leaving the "Authentication realm" field blank in your client if available.


3. Credentials

KontrolX provides you with:

FieldExampleDescription
usernameacmeclientUnique identifier for your account
password••••••••••••SIP password (keep confidential)

The credentials identify your account in order to:

  • Authorize call setup
  • Attribute usage (billing, reporting)
  • Determine the outbound destination (see §5)

Do not share credentials across multiple devices in parallel. If you need to connect several endpoints simultaneously, request one user per endpoint.


4. Step-by-step Configuration

4.1 Generic configuration (any softphone)

SIP Server / Domain  : sip.kx21.com
Port                 : 5060
Username / User ID   : <your_username>
Authentication name  : <your_username>   (same value)
Password             : <your_password>
Transport            : UDP
Outbound Proxy       : sip.kx21.com:5060   (optional)
Register expires     : 300 seconds (recommended)

4.2 Zoiper (Desktop/Mobile)

  1. Settings → Accounts → Add Account → SIP
  2. Fill in:
    • Username: your username
    • Password: your password
    • Domain: sip.kx21.com
  3. Advanced → Network:
    • Transport: UDP
    • Use STUN: No
    • Register on startup: Yes
  4. Advanced → Audio Codecs: enable only PCMU and PCMA. Disable Opus, G.722, GSM.

4.3 Linphone (Desktop/Mobile)

  1. Preferences → Accounts → +
  2. SIP Identity: sip:<your_username>@sip.kx21.com
  3. SIP Proxy address: sip:sip.kx21.com:5060;transport=udp
  4. Username: <your_username> · Password: <your_password>
  5. Outbound proxy: check Use proxy as outbound
  6. Audio codecs: enable PCMU and PCMA only.

4.4 MicroSIP (Windows)

  1. Account → Add Account
  2. SIP Server: sip.kx21.com
  3. SIP Proxy: sip.kx21.com:5060
  4. Username / Domain: <your_username> / sip.kx21.com
  5. Login / Password: <your_username> / <your_password>
  6. Transport: UDP

5. Placing Outbound Calls

Once registered, dial any number in E.164 format (without the leading +):

17752180264
525512345678
8005551212

The final destination is determined server-side based on the default route associated with your user. The number you dial is used as the destination digits that KontrolX hands off to the outbound carrier. Coordinate with KontrolX which destinations are allowed for your account.


6. Verification / Testing

6.1 Confirm registration

After configuring the account, the softphone should show "Registered" (green). Internally you will see:

→ REGISTER sip:sip.kx21.com SIP/2.0
← 401 Unauthorized            (challenge)
→ REGISTER ... Authorization: Digest username="..."
← 200 OK                       (registered)

6.2 Confirm a test call

Dial a test number (check with KontrolX which one to use):

→ INVITE sip:17752180264@sip.kx21.com SIP/2.0
← 401 Unauthorized
→ INVITE ... Authorization: Digest ...
← 100 Trying → 180 Ringing → 200 OK

If you hear bidirectional audio, the integration is complete.


7. Network Requirements (Firewall)

Your firewall must allow:

DirectionProtocolRemote portLocal port
Outbound → sip.kx21.comUDP5060Ephemeral
Inbound ← sip.kx21.comUDPEphemeral20000–20999 (RTP)
Outbound → sip.kx21.comUDP20000–20999 (RTP)Ephemeral

If your firewall only accepts literal IPs, resolve sip.kx21.com and open against that IP. Resolution is stable; KontrolX will notify in advance if it changes.

If you are behind symmetric NAT, configure STUN in the softphone (stun.l.google.com:19302 works as a generic). KontrolX does not provide a TURN server.


8. Server Behavior — Important Details

  • The server does NOT maintain persistent registration bindings. It returns 200 OK to REGISTER to enable the softphone's dial button, but every INVITE is re-authenticated with a fresh nonce. This means:
    • You cannot receive inbound calls on your SIP user (origination only)
    • Lowering Register expires below 60s does nothing — the server does not call back
  • Every call re-validates credentials. If you rotate the password in KontrolX, the next call fails with 403 Bad credentials without needing a prior re-registration.
  • Only these SIP methods are accepted: REGISTER, OPTIONS, INVITE, ACK, BYE, CANCEL. Anything else returns 405 Method Not Allowed.
  • Codecs other than G.711 are rejected during SDP negotiation.

9. Common Error Codes

CodeMeaningHow to resolve
401 UnauthorizedMissing Authorization header (normal on first attempt)The softphone should resend with credentials
403 Unknown userThe username does not exist or is suspendedVerify with KontrolX
403 Bad credentialsWrong password or misconfigured realmConfirm password and that the SIP domain is sip.kx21.com
405 Method Not AllowedUnsupported SIP methodReview the client's dialplan
408 Request TimeoutServer did not receive your packetCheck firewall / NAT
503 Service UnavailableKontrolX backend is downContact support

10. Support Information

If you need assistance, have the following ready:

  • Your SIP username
  • Call-ID of the failed SIP attempt (visible in the softphone log)
  • Approximate timestamp of the call (UTC)
  • Public IP you connected from
  • Optional pcap capture (Wireshark with filter sip || rtp)

Contact: [fill in support email / channel]


Appendix A — Difference vs IP-based connection (B2B trunk)

AspectIP trunk (see sip-trunk-interconnection.md)Authenticated client (this doc)
IdentificationBy source IP (whitelist)By username/password digest
Static IP requiredYesNo
Auth on every INVITENoYes
Use caseCarriers, corporate PBX with static IPSoftphones, cloud dialers, SaaS integrations