[ English | 简体中文 ]
Telephony Supplementary Services (SS) API
Supplementary Services (SS) are value-added call capabilities defined by 3GPP cellular standards, including Call Barring, Call Forwarding, Calling Line Identification Restriction/Presentation (CLIR/CLIP), Call Waiting, USSD, etc.
Header file: #include <tapi_ss.h>
openvela Implementation Notes
- Call Barring:
tapi_ss_*_call_barring*series controls the number range for outgoing/incoming calls - Call Forwarding:
tapi_ss_*_call_forwarding*series configures unconditional/busy/no-reply/unreachable forwarding - CLIR/CLIP: Calling line identification display and restriction via
calling_line_restrictionandcalling_line_presentation_infointerfaces - USSD:
tapi_ss_send_ussdsends*#xxxx#commands,tapi_ss_cancel_ussdcancels the session - FDN: Fixed Dialing Number switch via
tapi_ss_enable_fdn/tapi_ss_query_fdn - SIM identification: All interfaces include
slot_id - Asynchronous callback: All operations use
tapi_async_function
Call Barring
tapi_ss_request_call_barring
int tapi_ss_request_call_barring(tapi_context context, int slot_id, int event_id,
char* fac, char* pin2,
tapi_async_function p_handle);
Request a specific type of call barring (by FAC code).
Parameters:
contextTelephony context handle.slot_idSIM card slot ID.event_idEvent ID.facCall barring FAC code (e.g.,"OI","IR", etc.).pin2SIM card PIN2 code.p_handleAsynchronous callback function.
Returns:
Returns 0 on success, or a negative error code on failure.
tapi_ss_set_call_barring_option
int tapi_ss_set_call_barring_option(tapi_context context, int slot_id, int event_id,
char* facility, char* pin2,
tapi_async_function p_handle);
Set call barring options.
Parameters:
contextTelephony context handle.slot_idSIM card slot ID.event_idEvent ID.facilityBarring type string.pin2SIM card PIN2 code.p_handleAsynchronous callback function.
Returns:
Returns 0 on success, or a negative error code on failure.
tapi_ss_get_call_barring_option
int tapi_ss_get_call_barring_option(tapi_context context, int slot_id,
const char* service_type, char** out);
Query the current call barring configuration.
Parameters:
contextTelephony context handle.slot_idSIM card slot ID.service_typeService type string.outOutput parameter, returns the configuration string.
Returns:
Returns 0 on success, or a negative error code on failure.
tapi_ss_change_call_barring_password
int tapi_ss_change_call_barring_password(tapi_context context, int slot_id, int event_id,
char* old_pin, char* new_pin,
tapi_async_function p_handle);
Change the call barring service password.
Parameters:
contextTelephony context handle.slot_idSIM card slot ID.event_idEvent ID.old_pinOld password.new_pinNew password.p_handleAsynchronous callback function.
Returns:
Returns 0 on success, or a negative error code on failure.
tapi_ss_disable_all_call_barrings
int tapi_ss_disable_all_call_barrings(tapi_context context, int slot_id, int event_id,
char* passwd, tapi_async_function p_handle);
Disable all call barrings.
Parameters:
contextTelephony context handle.slot_idSIM card slot ID.event_idEvent ID.passwdService password.p_handleAsynchronous callback function.
Returns:
Returns 0 on success, or a negative error code on failure.
tapi_ss_disable_all_incoming
int tapi_ss_disable_all_incoming(tapi_context context, int slot_id,
int event_id, char* passwd,
tapi_async_function p_handle);
Disable all incoming call barrings.
Parameters:
contextTelephony context handle.slot_idSIM card slot ID.event_idEvent ID.passwdService password.p_handleAsynchronous callback function.
Returns:
Returns 0 on success, or a negative error code on failure.
tapi_ss_disable_all_outgoing
int tapi_ss_disable_all_outgoing(tapi_context context, int slot_id,
int event_id, char* passwd,
tapi_async_function p_handle);
Disable all outgoing call barrings.
Parameters:
contextTelephony context handle.slot_idSIM card slot ID.event_idEvent ID.passwdService password.p_handleAsynchronous callback function.
Returns:
Returns 0 on success, or a negative error code on failure.
Call Forwarding
tapi_ss_query_call_forwarding_option
int tapi_ss_query_call_forwarding_option(tapi_context context, int slot_id, int event_id,
int cf_reason, tapi_async_function p_handle);
Query call forwarding configuration.
Parameters:
contextTelephony context handle.slot_idSIM card slot ID.event_idEvent ID.cf_reasonForwarding type (unconditional/busy/no-reply/unreachable, seetapi_call_forward_option).p_handleAsynchronous callback function, returnstapi_call_forwarding_infoon callback.
Returns:
Returns 0 on success, or a negative error code on failure.
tapi_ss_set_call_forwarding_option
int tapi_ss_set_call_forwarding_option(tapi_context context, int slot_id, int event_id,
tapi_call_forwarding_info* info,
tapi_async_function p_handle);
Set call forwarding configuration.
Parameters:
contextTelephony context handle.slot_idSIM card slot ID.event_idEvent ID.infoCall forwarding configuration structure.p_handleAsynchronous callback function.
Returns:
Returns 0 on success, or a negative error code on failure.
USSD Session
tapi_ss_initiate_service
int tapi_ss_initiate_service(tapi_context context, int slot_id, int event_id,
char* command, tapi_async_function p_handle);
Initiate an SS service command (USSD/SS string format, e.g., *#06#).
Parameters:
contextTelephony context handle.slot_idSIM card slot ID.event_idEvent ID.commandCommand string.p_handleAsynchronous callback function, returnstapi_ss_initiate_infoon callback.
Returns:
Returns 0 on success, or a negative error code on failure.
tapi_get_ussd_state
int tapi_get_ussd_state(tapi_context context, int slot_id, char** out);
Query the current USSD session state.
Parameters:
contextTelephony context handle.slot_idSIM card slot ID.outOutput parameter, returns the state string (e.g.,"idle","user-response").
Returns:
Returns 0 on success, or a negative error code on failure.
tapi_ss_send_ussd
int tapi_ss_send_ussd(tapi_context context, int slot_id, int event_id, char* reply,
tapi_async_function p_handle);
Send a USSD reply message.
Parameters:
contextTelephony context handle.slot_idSIM card slot ID.event_idEvent ID.replyReply string.p_handleAsynchronous callback function.
Returns:
Returns 0 on success, or a negative error code on failure.
tapi_ss_cancel_ussd
int tapi_ss_cancel_ussd(tapi_context context, int slot_id, int event_id,
tapi_async_function p_handle);
Cancel the current USSD session.
Parameters:
contextTelephony context handle.slot_idSIM card slot ID.event_idEvent ID.p_handleAsynchronous callback function.
Returns:
Returns 0 on success, or a negative error code on failure.
Call Waiting
tapi_ss_set_call_waiting
int tapi_ss_set_call_waiting(tapi_context context, int slot_id, int event_id, bool enable,
tapi_async_function p_handle);
Enable or disable call waiting.
Parameters:
contextTelephony context handle.slot_idSIM card slot ID.event_idEvent ID.enabletrueto enable,falseto disable.p_handleAsynchronous callback function.
Returns:
Returns 0 on success, or a negative error code on failure.
tapi_ss_get_call_waiting
int tapi_ss_get_call_waiting(tapi_context context, int slot_id, int event_id,
tapi_async_function p_handle);
Query the call waiting switch state.
Parameters:
contextTelephony context handle.slot_idSIM card slot ID.event_idEvent ID.p_handleAsynchronous callback function, returns the current state on callback.
Returns:
Returns 0 on success, or a negative error code on failure.
CLIR / CLIP (Calling Line Identification)
tapi_ss_get_calling_line_presentation_info
int tapi_ss_get_calling_line_presentation_info(tapi_context context, int slot_id,
int event_id, tapi_async_function p_handle);
Query the Calling Line Identification Presentation (CLIP) state.
Parameters:
contextTelephony context handle.slot_idSIM card slot ID.event_idEvent ID.p_handleAsynchronous callback function.
Returns:
Returns 0 on success, or a negative error code on failure.
tapi_ss_set_calling_line_restriction
int tapi_ss_set_calling_line_restriction(tapi_context context, int slot_id, int event_id,
tapi_clir_status status,
tapi_async_function p_handle);
Set the Calling Line Identification Restriction (CLIR) state.
Parameters:
contextTelephony context handle.slot_idSIM card slot ID.event_idEvent ID.statusCLIR status enum value (CLIR_DEFAULT/CLIR_INVOCATION/CLIR_SUPPRESSION).p_handleAsynchronous callback function.
Returns:
Returns 0 on success, or a negative error code on failure.
tapi_ss_get_calling_line_restriction_info
int tapi_ss_get_calling_line_restriction_info(tapi_context context, int slot_id,
int event_id, tapi_async_function p_handle);
Query the Calling Line Identification Restriction (CLIR) state.
Parameters:
contextTelephony context handle.slot_idSIM card slot ID.event_idEvent ID.p_handleAsynchronous callback function.
Returns:
Returns 0 on success, or a negative error code on failure.
FDN (Fixed Dialing Number) Switch
tapi_ss_enable_fdn
int tapi_ss_enable_fdn(tapi_context context, int slot_id, int event_id,
bool enable, char* pin2, tapi_async_function p_handle);
Enable or disable FDN mode (requires PIN2).
Parameters:
contextTelephony context handle.slot_idSIM card slot ID.event_idEvent ID.enabletrueto enable FDN,falseto disable.pin2SIM card PIN2 code.p_handleAsynchronous callback function.
Returns:
Returns 0 on success, or a negative error code on failure.
tapi_ss_query_fdn
int tapi_ss_query_fdn(tapi_context context, int slot_id, int event_id,
tapi_async_function p_handle);
Query the FDN switch state.
Parameters:
contextTelephony context handle.slot_idSIM card slot ID.event_idEvent ID.p_handleAsynchronous callback function.
Returns:
Returns 0 on success, or a negative error code on failure.
Event Subscription
tapi_ss_register
int tapi_ss_register(tapi_context context, int slot_id, tapi_indication_msg msg,
void* user_obj, tapi_async_function p_handle);
Register an SS event callback.
Parameters:
contextTelephony context handle.slot_idSIM card slot ID.msgEvent type to monitor.user_objUser data.p_handleAsynchronous callback function.
Returns:
Returns the watch ID on success, or a negative error code on failure.
tapi_ss_unregister
int tapi_ss_unregister(tapi_context context, int watch_id);
Unregister an SS event subscription.
Parameters:
contextTelephony context handle.watch_idWatch ID returned during subscription.
Returns:
Returns 0 on success, or a negative error code on failure.