SWILIB API (ELKA)    
Loading...
Searching...
No Matches
Telephony

Detailed Description

SMS, calls, USSD and others.

Usage: #include <swilib.h> or #include <swilib/telephony.h>

Data Structures

struct  GBS_USSD_MSG
 USSD reply GSB message. More...
 
struct  RAMNET
 Cellular network state (http://e71.ru/publ/4-1-0-34). More...
 
struct  PDU
 SMS PDU. More...
 
struct  StructUSSDStr
 USSD request. More...
 
struct  StructUSSD
 USSD request (???). More...
 
struct  SMS_POS_INDEX_DATA
 SMS position index. More...
 
struct  INDEX_ID_DATA
 SMS index data. More...
 
struct  SMS_DATA_LIST
 Container of the SMS data. More...
 
struct  SMS_DATA_LLIST
 Linked-List of SMS (Openwave). More...
 
struct  SMS_DATA_ROOT
 Root of the SMS list (Openwave). More...
 
struct  EAM_DATA
 EMS Admin data. More...
 
struct  RAM_EMS_ADMIN
 EMS Admin. More...
 

Typedefs

typedef struct RAMNET RAMNET
 
typedef struct PDU PDU
 
typedef struct StructUSSDStr StructUSSDStr
 
typedef struct StructUSSD StructUSSD
 
typedef struct GBS_USSD_MSG GBS_USSD_MSG
 
typedef struct SMS_POS_INDEX_DATA SMS_POS_INDEX_DATA
 
typedef struct INDEX_ID_DATA INDEX_ID_DATA
 
typedef struct SMS_DATA_LIST SMS_DATA_LIST
 
typedef struct SMS_DATA_LLIST SMS_DATA_LLIST
 
typedef struct SMS_DATA_ROOT SMS_DATA_ROOT
 
typedef struct EAM_DATA EAM_DATA
 
typedef struct RAM_EMS_ADMIN RAM_EMS_ADMIN
 

Functions

int MakeVoiceCall (const char *number, int unk1, int unk2)
 Call the number.
 
int GetSMSState (void)
 Get SMS status.
 
int HasNewSMS (void)
 Check for new SMS.
 
int HasFlashSMS (void)
 Check for a pending flash message (flash SMS, USSD reply or network text) that ReadFlashSMS shows.
 
char * RamMissedSMS ()
 Pointer to the for missed SMS count.
 
char * RamMissedMessage ()
 Pointer to the for missed messages count.
 
int GetMissedCallsCount (void)
 Check for missed calls.
 
char * RamMissedCalls ()
 Pointer to the for missed calls count.
 
int IsCalling (void)
 Checking for an active call.
 
int GetDurationFromCurrentCall (void)
 Get current call diration.
 
int isDecryption (void)
 Check if current call in decryption state.
 
int IsIncognitoCall (int call_id)
 Check if the call has a number.
 
int IsDirectCallActive (void)
 Checking for an active direct call.
 
char * RamCallState ()
 State of the current call.
 
int GetTypeOfCall (int type)
 Get type of the current call.
 
int ShowCallList (int list, int zero)
 Open calls list phone UI.
 
void EndCall (void)
 Cancel current call.
 
void EndCallBusy (int param1, int param2)
 Cancel current call with BUSY status.
 
uint16_t * RamLastCallNum ()
 Number of the last call in call slot 1, as UTF-16 characters.
 
char * RAM_IMSI (void)
 Get IMSI of the SIM card.
 
char * RamServiceProviderName (void)
 Get cellurar operator name.
 
RAMNET * RamNet ()
 Current cellular network state.
 
int * RamNetOnline ()
 Network online flag.
 
int GetNetAccessMode ()
 Get current network access mode.
 
int GetRoamingState ()
 Get network roaming status.
 
uint16_t * GetCI ()
 Get current network cell identification.
 
char * Get_CC_NC ()
 Get cell network MCC & MNC.
 
char GetProvider (WSHDR *name, int unk)
 Get name of the current cellurar provider.
 
int GetSubprovider (WSHDR *name)
 Get name of the current cellurar sub-provider.
 
char GetTypeUSSD ()
 Get type of the current USSD request.
 
uint32_t SetUSSD (const StructUSSDStr *req)
 Set current USSD request.
 
void SendAutoUSSDack (void)
 Send auto-ACK for the current USSD.
 
void freeUSSD ()
 Free current USSD request.
 
int SendSMS (WSHDR *text, const char *number, int cepid, int msg, int flag)
 Send SMS.
 
PDU * IncommingPDU (void)
 Get PDU from the received SMS message (in MSG_SMS_RX event).
 
int DeleteSMS (int index, short *del_cnt)
 Remove SMS from memory (Openwave).
 
int SetSmsStatus (int index, int status)
 Update SMS status (Openwave).
 
SMS_DATA_ROOT * SmsDataRoot ()
 Get root of the SMS list (Openwave).
 
int GetSmsPosIndex (SMS_POS_INDEX_DATA *buf, int data_id)
 Get SMS position index (SMS_POS_INDEX_DATA) by data ID.
 
RAM_EMS_ADMIN * RAM_EMS_Admin ()
 Get pointer to the EMS Admin data.
 
int GSMTXT_Decode (WSHDR *result, void *pkt, int len, int encoding_type, malloc_func_t malloc_fn, mfree_func_t mfree_fn)
 Decode GSM-encoded text.
 
void FreeGSMTXTpkt (void *pkt)
 Free USSD response packet.
 
void ReadNewSMS (void)
 Open new received SMS in SMS UI.
 
int ReadFlashSMS (int ack)
 Open new received flash SMS in SMS UI.
 
void GetAllEmail ()
 Starts "opwvmsg:RGetAllEmail" in Openwave.
 

Data Structure Documentation

◆ GBS_USSD_MSG

struct GBS_USSD_MSG

◆ RAMNET

struct RAMNET

◆ PDU

struct PDU

◆ StructUSSDStr

struct StructUSSDStr

◆ StructUSSD

struct StructUSSD

◆ SMS_POS_INDEX_DATA

struct SMS_POS_INDEX_DATA

◆ INDEX_ID_DATA

struct INDEX_ID_DATA

◆ SMS_DATA_LIST

struct SMS_DATA_LIST

◆ SMS_DATA_LLIST

struct SMS_DATA_LLIST

◆ SMS_DATA_ROOT

struct SMS_DATA_ROOT

◆ EAM_DATA

struct EAM_DATA

◆ RAM_EMS_ADMIN

struct RAM_EMS_ADMIN

Typedef Documentation

◆ RAMNET

typedef struct RAMNET RAMNET

Definition at line 18 of file telephony.h.

◆ PDU

typedef struct PDU PDU

Definition at line 19 of file telephony.h.

◆ StructUSSDStr

typedef struct StructUSSDStr StructUSSDStr

Definition at line 20 of file telephony.h.

◆ StructUSSD

typedef struct StructUSSD StructUSSD

Definition at line 21 of file telephony.h.

◆ GBS_USSD_MSG

typedef struct GBS_USSD_MSG GBS_USSD_MSG

Definition at line 22 of file telephony.h.

◆ SMS_POS_INDEX_DATA

typedef struct SMS_POS_INDEX_DATA SMS_POS_INDEX_DATA

Definition at line 23 of file telephony.h.

◆ INDEX_ID_DATA

typedef struct INDEX_ID_DATA INDEX_ID_DATA

Definition at line 24 of file telephony.h.

◆ SMS_DATA_LIST

typedef struct SMS_DATA_LIST SMS_DATA_LIST

Definition at line 25 of file telephony.h.

◆ SMS_DATA_LLIST

typedef struct SMS_DATA_LLIST SMS_DATA_LLIST

Definition at line 26 of file telephony.h.

◆ SMS_DATA_ROOT

typedef struct SMS_DATA_ROOT SMS_DATA_ROOT

Definition at line 27 of file telephony.h.

◆ EAM_DATA

typedef struct EAM_DATA EAM_DATA

Definition at line 28 of file telephony.h.

◆ RAM_EMS_ADMIN

typedef struct RAM_EMS_ADMIN RAM_EMS_ADMIN

Definition at line 29 of file telephony.h.

Function Documentation

◆ MakeVoiceCall()

int MakeVoiceCall ( const char * number,
int unk1,
int unk2 )

Call the number.

Parameters
numberphone number
unk1unknown, set to 0x10
unk2unknown, set to 0x20C0
Returns
0 or error

◆ GetSMSState()

int GetSMSState ( void )

Get SMS status.

Returns
1 - send, 2 - recv, 3 - both
Available on platforms:
NSG, ELKA

◆ HasNewSMS()

int HasNewSMS ( void )

Check for new SMS.

Returns
1: when there has new SMS
0: no new SMS
Available on platforms:
X75, SG

◆ HasFlashSMS()

int HasFlashSMS ( void )

Check for a pending flash message (flash SMS, USSD reply or network text) that ReadFlashSMS shows.

Returns
1 if a message is pending, 0 otherwise

◆ RamMissedSMS()

char * RamMissedSMS ( )

Pointer to the for missed SMS count.

Returns
pointer to the count
int missed_sms = *RamMissedSMS();
char * RamMissedSMS()
Pointer to the for missed SMS count.
Available on platforms:
X75, SG

◆ RamMissedMessage()

char * RamMissedMessage ( )

Pointer to the for missed messages count.

Returns
pointer to the count
int missed_sms = *RamMissedMessage();
char * RamMissedMessage()
Pointer to the for missed messages count.

◆ GetMissedCallsCount()

int GetMissedCallsCount ( void )

Check for missed calls.

Returns
count of the missed calls

◆ RamMissedCalls()

char * RamMissedCalls ( )

Pointer to the for missed calls count.

Returns
pointer to the count
int missed_calls = *RamMissedCalls();
char * RamMissedCalls()
Pointer to the for missed calls count.

◆ IsCalling()

int IsCalling ( void )

Checking for an active call.

Returns
count of active calls

◆ GetDurationFromCurrentCall()

int GetDurationFromCurrentCall ( void )

Get current call diration.

Returns
seconds

◆ isDecryption()

int isDecryption ( void )

Check if current call in decryption state.

Returns
1 or 0

◆ IsIncognitoCall()

int IsIncognitoCall ( int call_id)

Check if the call has a number.

Parameters
call_idcall ID (1..7), other values cause a fatal error
Returns
nonzero (pointer to the internal number record) if the call has a number, 0 if it has none

◆ IsDirectCallActive()

int IsDirectCallActive ( void )

Checking for an active direct call.

Returns
1 or 0

◆ RamCallState()

char * RamCallState ( )

State of the current call.

Returns
unknown

◆ GetTypeOfCall()

int GetTypeOfCall ( int type)

Get type of the current call.

Parameters
typeunknown, set to 1
Returns
0 - none, 2 - outgoing, 3 - incoming

◆ ShowCallList()

int ShowCallList ( int list,
int zero )

Open calls list phone UI.

Parameters
listtype of the list
zerounknown, set to 0
Returns
CSM ID of opened UI

◆ EndCall()

void EndCall ( void )

Cancel current call.

◆ EndCallBusy()

void EndCallBusy ( int param1,
int param2 )

Cancel current call with BUSY status.

Parameters
param1unknown
param2unknown

◆ RamLastCallNum()

uint16_t * RamLastCallNum ( )

Number of the last call in call slot 1, as UTF-16 characters.

Returns
pointer to the first character; the length is at index -1
Note
Kept until the next call that gets slot 1.

◆ RAM_IMSI()

char * RAM_IMSI ( void )

Get IMSI of the SIM card.

Returns
pointer to the 9-bytes of IMSI

◆ RamServiceProviderName()

char * RamServiceProviderName ( void )

Get cellurar operator name.

Returns
FF-terminated C-string

◆ RamNet()

RAMNET * RamNet ( )

Current cellular network state.

Returns
pointer to the network state

◆ RamNetOnline()

int * RamNetOnline ( )

Network online flag.

Returns
pointer to the flag: 1 if the network is online, 0 otherwise

◆ GetNetAccessMode()

int GetNetAccessMode ( )

Get current network access mode.

Returns
mdoe

◆ GetRoamingState()

int GetRoamingState ( )

Get network roaming status.

Returns
roaming status

◆ GetCI()

uint16_t * GetCI ( )

Get current network cell identification.

Returns
pointer to the CI.
uint16_t CI = *GetCI();
uint16_t * GetCI()
Get current network cell identification.

◆ Get_CC_NC()

char * Get_CC_NC ( )

Get cell network MCC & MNC.

Returns
pointer to the char[5] array with BCD representation of MCC + MNC

◆ GetProvider()

char GetProvider ( WSHDR * name,
int unk )

Get name of the current cellurar provider.

Parameters
[out]namename of the provider
unkset to 0
Returns
1: success, 0: error

◆ GetSubprovider()

int GetSubprovider ( WSHDR * name)

Get name of the current cellurar sub-provider.

Parameters
[out]namename of the sub-provider
Returns
1: success, 0: error

◆ GetTypeUSSD()

char GetTypeUSSD ( )

Get type of the current USSD request.

Returns
unknown

◆ SetUSSD()

uint32_t SetUSSD ( const StructUSSDStr * req)

Set current USSD request.

Parameters
reqpointer to the USSD request
Returns
1 on success, 0 on error

◆ SendAutoUSSDack()

void SendAutoUSSDack ( void )

Send auto-ACK for the current USSD.

◆ freeUSSD()

void freeUSSD ( )

Free current USSD request.

◆ SendSMS()

int SendSMS ( WSHDR * text,
const char * number,
int cepid,
int msg,
int flag )

Send SMS.

Parameters
texttext of the SMS
numberreceiver number
cepidset to MMI_CEPID
msgset to MSG_SMS_TX
flagunknown, set to 6
Returns
non-zero on success

◆ IncommingPDU()

PDU * IncommingPDU ( void )

Get PDU from the received SMS message (in MSG_SMS_RX event).

Returns
pointer to the PDU

◆ DeleteSMS()

int DeleteSMS ( int index,
short * del_cnt )

Remove SMS from memory (Openwave).

Parameters
indexindex of the SMS
[out]del_cntnumber of deleted segments
Returns
0x3E8 on success

◆ SetSmsStatus()

int SetSmsStatus ( int index,
int status )

Update SMS status (Openwave).

Parameters
indexindex of the SMS
statusnew SMS status (1: read, 3: unread)
Returns
0x3E8 on success

◆ SmsDataRoot()

SMS_DATA_ROOT * SmsDataRoot ( )

Get root of the SMS list (Openwave).

Returns
pointer to SMS_DATA_ROOT

◆ GetSmsPosIndex()

int GetSmsPosIndex ( SMS_POS_INDEX_DATA * buf,
int data_id )

Get SMS position index (SMS_POS_INDEX_DATA) by data ID.

Returns
1: success, 0: error

◆ RAM_EMS_Admin()

RAM_EMS_ADMIN * RAM_EMS_Admin ( )

Get pointer to the EMS Admin data.

Returns
pointer to RAM_EMS_ADMIN

◆ GSMTXT_Decode()

int GSMTXT_Decode ( WSHDR * result,
void * pkt,
int len,
int encoding_type,
malloc_func_t malloc_fn,
mfree_func_t mfree_fn )

Decode GSM-encoded text.

Parameters
[out]resultresult of the decoding
pktinput GSM-encoded data
lenlength of the input
encoding_typetype of the encoding
malloc_fnresult of malloc_adr()
mfree_fnresult of mfree_adr()
Returns
1: success, 0: error

◆ FreeGSMTXTpkt()

void FreeGSMTXTpkt ( void * pkt)

Free USSD response packet.

◆ ReadNewSMS()

void ReadNewSMS ( void )

Open new received SMS in SMS UI.

Available on platforms:
X75, SG

◆ ReadFlashSMS()

int ReadFlashSMS ( int ack)

Open new received flash SMS in SMS UI.

Parameters
acknonzero: acknowledge the flash SMS when the UI is closed
Returns
CSM ID or 0 if there is no flash SMS

◆ GetAllEmail()

void GetAllEmail ( )

Starts "opwvmsg:RGetAllEmail" in Openwave.