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 Code | Cause Enum (PitelCallCause) | Standard Message (Format: MΓ£ lα»i - MΓ΄ tαΊ£ lα»i) | Description / Suggested Action |
|---|---|---|---|
486, 600 | USER_BUSY | 486 - User is currently busy. | The destination party is on another call or rejected the call with busy status. |
480 | NO_USER_RESPONSE | 480 - Destination is temporarily unavailable or did not answer. | The callee extension/phone did not pick up before the timeout or is currently unregistered. |
404 | UNALLOCATED_NUMBER | 404 - 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, 608 | CALL_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. |
484 | INVALID_NUMBER_FORMAT | 484 - Invalid phone number format. | Incomplete or malformed destination phone number format. |
488, 606 | INCOMPATIBLE_DESTINATION | <Code> - Incompatible destination. | Media codec negotiation failure or unsupported media format between caller and PBX/callee. |
408, 504 | RECOVERY_ON_TIMER_EXPIRE | <Code> - Request timed out waiting for PBX response. | Network timeout waiting for SIP INVITE transaction response from PBX/gateway. |
485, 604 | NO_ROUTE_DESTINATION | <Code> - No route to destination. | PBX has no valid trunk/route configured for the dialed destination prefix. |
502 | NETWORK_OUT_OF_ORDER | 502 - Network or gateway is out of order. | Upstream telecommunication gateway or carrier network is down. |
400, 481, 500, 503 | NORMAL_TEMPORARY_FAILURE | <Code> - Temporary PBX server or network failure. | PBX server overloaded, internal server error, or temporary gateway failure. |
487 | ORIGINATOR_CANCEL | Call cancelled. | The caller (originator) hung up / cancelled the call before it was answered. |
200, 2xx | NORMAL_CLEARING | None (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.