Skip to main content

Call Disconnect Causes & Error Codes Reference

This document details all SIP disconnect status codes, their mapped PitelCallCause enum values, and standard English messages delivered by the Pitel VoIP SDK.


πŸ“Š Disconnect Cause Mapping Table​

The SDK automatically maps low-level SIP response status codes (ITU-T Q.850 & RFC 3261) into normalized PitelCallCause values:

SIP Status CodeCause Enum (PitelCallCause)Standard Message (Format: MΓ£ lα»—i - MΓ΄ tαΊ£ lα»—i)Description / Suggested Action
486, 600USER_BUSY486 - User is currently busy.The destination party is on another call or rejected the call with busy status.
480NO_USER_RESPONSE480 - Destination is temporarily unavailable or did not answer.The callee extension/phone did not pick up before the timeout or is currently unregistered.
404UNALLOCATED_NUMBER404 - The dialed phone number does not exist.The dialed number or extension does not exist on the PBX server. Check the number and retry.
401, 402, 403, 407, 603, 608CALL_REJECTED<Code> - Call was rejected or account lacks outbound calling permission.PBX rejected the call due to ACL, extension outbound call permission limits, or invalid authorization.
484INVALID_NUMBER_FORMAT484 - Invalid phone number format.Incomplete or malformed destination phone number format.
488, 606INCOMPATIBLE_DESTINATION<Code> - Incompatible destination.Media codec negotiation failure or unsupported media format between caller and PBX/callee.
408, 504RECOVERY_ON_TIMER_EXPIRE<Code> - Request timed out waiting for PBX response.Network timeout waiting for SIP INVITE transaction response from PBX/gateway.
485, 604NO_ROUTE_DESTINATION<Code> - No route to destination.PBX has no valid trunk/route configured for the dialed destination prefix.
502NETWORK_OUT_OF_ORDER502 - Network or gateway is out of order.Upstream telecommunication gateway or carrier network is down.
400, 481, 500, 503NORMAL_TEMPORARY_FAILURE<Code> - Temporary PBX server or network failure.PBX server overloaded, internal server error, or temporary gateway failure.
487ORIGINATOR_CANCELCall cancelled.The caller (originator) hung up / cancelled the call before it was answered.
200, 2xxNORMAL_CLEARINGNone (null)Normal call termination after successful conversation.

πŸ’» Handling Disconnect Events in React Native​

When a call ends or fails, the SDK dispatches an onCallStateChanged event with state: 'DISCONNECTED' and an onCallDisconnected event.

1. Using the Built-in Helper getPitelCallErrorMessage​

The SDK exports getPitelCallErrorMessage(event) to automatically convert disconnect events into standardized English messages:

import {
PitelVoipClient,
PitelCallEvent,
getPitelCallErrorMessage,
} from 'react-native-pitel-voip-v2';
import { ToastAndroid, Alert, Platform } from 'react-native';

const client = PitelVoipClient.instance;

const unsubscribe = client.addEventListener((event: PitelCallEvent) => {
if (event.type === 'onCallStateChanged' && event.state === 'DISCONNECTED') {
// Automatically returns "<StatusCode> - <Message>" (e.g. "480 - Destination is temporarily unavailable or did not answer.")
const errorMessage = getPitelCallErrorMessage(event);

if (errorMessage) {
if (Platform.OS === 'android') {
ToastAndroid.show(errorMessage, ToastAndroid.LONG);
} else {
Alert.alert('Call Ended', errorMessage);
}
}
}
});

2. Accessing Raw Event Fields​

If you want to implement custom logic or localization:

client.addEventListener((event: PitelCallEvent) => {
if (event.type === 'onCallStateChanged' && event.state === 'DISCONNECTED') {
const { statusCode, reason, cause } = event;

console.log('SIP Status Code:', statusCode); // e.g. 480, 486, 404
console.log('SIP Reason:', reason); // e.g. "Temporarily Unavailable"
console.log('Normalized Cause:', cause); // e.g. "NO_USER_RESPONSE"

switch (cause) {
case 'USER_BUSY':
// Custom Busy UI
break;
case 'NO_USER_RESPONSE':
// Custom Unreachable UI
break;
case 'UNALLOCATED_NUMBER':
// Number not found UI
break;
default:
break;
}
}
});

πŸ”” Native Android Auto-Toast Behavior​

On Android, when a call disconnects with an error status code (statusCode >= 400), the Native SDK automatically displays an Android System Toast on the ApplicationContext:

  • Format: <StatusCode> - <Description>
  • Example: 480 - Destination is temporarily unavailable or did not answer.
  • Guaranteed visibility: Because it is attached to the application context, it appears reliably even during Activity closing or transition back to the main app.