Kannel: Open Source WAP and SMS gateway  svn-r5335
smsc_sema.h File Reference
#include "gwlib/gwlib.h"
#include "smsc.h"
#include "smsc_p.h"

Go to the source code of this file.

Data Structures

struct  msg_hash
 
struct  sema_msg
 
struct  sema_msglist
 
struct  sm_statusreport_result
 
struct  sm_statusreport_invoke
 
struct  sm_submit_result
 
struct  sm_submit_invoke
 
struct  sm_deliver_result
 
struct  sm_deliver_invoke
 

Macros

#define SM_RESULT_SUCCESS   0
 
#define SM_RESULT_FAIL_ARGS   1
 
#define SM_RESLUT_FAIL_SMSC_DB   2
 
#define SM_RESULT_FAIL_SMSC_BUSY   3
 
#define SM_RESULT_FAIL_SM_NOTFOUND   4
 
#define SM_RESULT_FAIL_SM_DUPLICATE   5
 
#define SME_RESULT_SUCCESS   0
 
#define SME_RESULT_INVALIDDATA   1
 
#define SME_RESULT_DBFULL   2
 
#define SME_RESULT_SMEBUSY   3
 
#define SME_RESULT_NOTUSED   4
 
#define SME_RESULT_DUPLICATESM   5
 
#define SME_RESULT_DESTUNAVAILABLE   6
 
#define SME_RESULT_CALLBARREDUSER   7
 
#define SME_RESULT_TRANSMISSION   21
 
#define SME_RESULT_FACILITYNOTSUPPORT   22
 
#define SME_RESULT_ERRORINSME   23
 
#define SME_RESULT_UNKNOWNSUBSCRIBER   24
 
#define SME_RESULT_CALLBARREDOPERATOR   25
 
#define SME_RESULT_CUGVIOLATION   26
 
#define SME_RESULT_NETWORKFAIL   120
 
#define ENCODE_IA5   15
 
#define ENCODE_GSM   0
 
#define LINE_ENCODE_IA5   1
 
#define LINE_ENCODE_HEX   2
 
#define LINE_ENCODE_BIN   3
 
#define X28_COMMAND_MODE   0
 
#define X28_MT_DATA_MODE   1
 
#define X28_MO_DATA_MODE   2
 
#define INTERNAL_DISCONNECT_TIMEVAL   3
 
#define INTERNAL_READFD_TIMEVAL   1
 
#define INTERNAL_CONNECT_TIMEVAL   5
 
#define INTERNAL_SESSION_MT_TIMEVAL   20
 
#define SESSION_MT_RECEIVE_ERR   0
 
#define SESSION_MT_RECEIVE_TIMEOUT   1
 
#define SESSION_MT_RECEIVE_SUCCESS   2
 

Typedefs

typedef struct msg_hash msg_hash
 
typedef struct sema_msg sema_msg
 
typedef struct sema_msglist sema_msglist
 
typedef struct sm_statusreport_result sm_statusreport_result
 
typedef struct sm_statusreport_invoke sm_statusreport_invoke
 
typedef struct sm_submit_result sm_submit_result
 
typedef struct sm_submit_invoke sm_submit_invoke
 
typedef struct sm_deliver_result sm_deliver_result
 
typedef struct sm_deliver_invoke sm_deliver_invoke
 

Functions

static int sema_submit_result (SMSCenter *, sema_msg *, int)
 
static int X28_open_data_link (char *)
 
static int X28_reopen_data_link (int, char *)
 
static int X28_close_send_link (int)
 
static int X28_open_send_link (int, char *)
 
static int X28_data_read (int, char *)
 
static int X28_data_send (int, char *, int)
 
static int X28_msg_pop (char *, char *)
 
static int sema_msg_session_mt (SMSCenter *, sema_msg *)
 
static int sema_msg_session_mo (SMSCenter *, char *)
 
static sema_msgsema_msg_new (void)
 
static int sema_msg_free (sema_msg *msg)
 
static sema_msglistsema_msglist_new (void)
 
static void sema_msglist_free (sema_msglist *)
 
static int sema_msglist_push (sema_msglist *, sema_msg *)
 
static int sema_msglist_pop (sema_msglist *, sema_msg **)
 
static int sema_decode_msg (sema_msg **, char *)
 
static int sema_encode_msg (sema_msg *, char *)
 
static int line_append_hex_IA5 (Octstr *, unsigned char *, int)
 
static int line_scan_IA5_hex (char *, int, unsigned char *)
 
static int line_scan_hex_GSM7 (unsigned char *, int, int, unsigned char *)
 
static int internal_char_IA5_to_hex (char *, unsigned char *)
 
static int internal_char_hex_to_IA5 (unsigned char, unsigned char *)
 
static unsigned char internal_char_hex_to_gsm (unsigned char from)
 
static int unpack_continous_byte (unsigned char, int *, int *, int *)
 
static unsigned char pack_continous_byte (int, int, int)
 
static void increment_counter (void)
 

Macro Definition Documentation

◆ ENCODE_GSM

#define ENCODE_GSM   0

Definition at line 88 of file smsc_sema.h.

Referenced by sema_decode_msg().

◆ ENCODE_IA5

#define ENCODE_IA5   15

Definition at line 87 of file smsc_sema.h.

Referenced by sema_decode_msg().

◆ INTERNAL_CONNECT_TIMEVAL

#define INTERNAL_CONNECT_TIMEVAL   5

Definition at line 102 of file smsc_sema.h.

Referenced by X28_open_send_link().

◆ INTERNAL_DISCONNECT_TIMEVAL

#define INTERNAL_DISCONNECT_TIMEVAL   3

Definition at line 100 of file smsc_sema.h.

Referenced by X28_close_send_link().

◆ INTERNAL_READFD_TIMEVAL

#define INTERNAL_READFD_TIMEVAL   1

Definition at line 101 of file smsc_sema.h.

◆ INTERNAL_SESSION_MT_TIMEVAL

#define INTERNAL_SESSION_MT_TIMEVAL   20

Definition at line 103 of file smsc_sema.h.

Referenced by sema_msg_session_mt().

◆ LINE_ENCODE_BIN

#define LINE_ENCODE_BIN   3

Definition at line 94 of file smsc_sema.h.

Referenced by unpack_continous_byte().

◆ LINE_ENCODE_HEX

#define LINE_ENCODE_HEX   2

Definition at line 93 of file smsc_sema.h.

Referenced by unpack_continous_byte().

◆ LINE_ENCODE_IA5

#define LINE_ENCODE_IA5   1

Definition at line 92 of file smsc_sema.h.

Referenced by sema_submit_msg(), and unpack_continous_byte().

◆ SESSION_MT_RECEIVE_ERR

#define SESSION_MT_RECEIVE_ERR   0

Definition at line 105 of file smsc_sema.h.

Referenced by sema_msg_session_mt(), and sema_submit_msg().

◆ SESSION_MT_RECEIVE_SUCCESS

#define SESSION_MT_RECEIVE_SUCCESS   2

Definition at line 107 of file smsc_sema.h.

Referenced by sema_msg_session_mt(), and sema_submit_msg().

◆ SESSION_MT_RECEIVE_TIMEOUT

#define SESSION_MT_RECEIVE_TIMEOUT   1

Definition at line 106 of file smsc_sema.h.

Referenced by sema_msg_session_mt(), and sema_submit_msg().

◆ SM_RESLUT_FAIL_SMSC_DB

#define SM_RESLUT_FAIL_SMSC_DB   2

Definition at line 66 of file smsc_sema.h.

◆ SM_RESULT_FAIL_ARGS

#define SM_RESULT_FAIL_ARGS   1

Definition at line 65 of file smsc_sema.h.

◆ SM_RESULT_FAIL_SM_DUPLICATE

#define SM_RESULT_FAIL_SM_DUPLICATE   5

Definition at line 69 of file smsc_sema.h.

◆ SM_RESULT_FAIL_SM_NOTFOUND

#define SM_RESULT_FAIL_SM_NOTFOUND   4

Definition at line 68 of file smsc_sema.h.

◆ SM_RESULT_FAIL_SMSC_BUSY

#define SM_RESULT_FAIL_SMSC_BUSY   3

Definition at line 67 of file smsc_sema.h.

◆ SM_RESULT_SUCCESS

#define SM_RESULT_SUCCESS   0

Definition at line 64 of file smsc_sema.h.

Referenced by sema_decode_msg().

◆ SME_RESULT_CALLBARREDOPERATOR

#define SME_RESULT_CALLBARREDOPERATOR   25

Definition at line 83 of file smsc_sema.h.

◆ SME_RESULT_CALLBARREDUSER

#define SME_RESULT_CALLBARREDUSER   7

Definition at line 78 of file smsc_sema.h.

◆ SME_RESULT_CUGVIOLATION

#define SME_RESULT_CUGVIOLATION   26

Definition at line 84 of file smsc_sema.h.

◆ SME_RESULT_DBFULL

#define SME_RESULT_DBFULL   2

Definition at line 73 of file smsc_sema.h.

◆ SME_RESULT_DESTUNAVAILABLE

#define SME_RESULT_DESTUNAVAILABLE   6

Definition at line 77 of file smsc_sema.h.

◆ SME_RESULT_DUPLICATESM

#define SME_RESULT_DUPLICATESM   5

Definition at line 76 of file smsc_sema.h.

◆ SME_RESULT_ERRORINSME

#define SME_RESULT_ERRORINSME   23

Definition at line 81 of file smsc_sema.h.

◆ SME_RESULT_FACILITYNOTSUPPORT

#define SME_RESULT_FACILITYNOTSUPPORT   22

Definition at line 80 of file smsc_sema.h.

◆ SME_RESULT_INVALIDDATA

#define SME_RESULT_INVALIDDATA   1

Definition at line 72 of file smsc_sema.h.

◆ SME_RESULT_NETWORKFAIL

#define SME_RESULT_NETWORKFAIL   120

Definition at line 85 of file smsc_sema.h.

◆ SME_RESULT_NOTUSED

#define SME_RESULT_NOTUSED   4

Definition at line 75 of file smsc_sema.h.

◆ SME_RESULT_SMEBUSY

#define SME_RESULT_SMEBUSY   3

Definition at line 74 of file smsc_sema.h.

◆ SME_RESULT_SUCCESS

#define SME_RESULT_SUCCESS   0

Definition at line 71 of file smsc_sema.h.

◆ SME_RESULT_TRANSMISSION

#define SME_RESULT_TRANSMISSION   21

Definition at line 79 of file smsc_sema.h.

◆ SME_RESULT_UNKNOWNSUBSCRIBER

#define SME_RESULT_UNKNOWNSUBSCRIBER   24

Definition at line 82 of file smsc_sema.h.

◆ X28_COMMAND_MODE

#define X28_COMMAND_MODE   0

Definition at line 96 of file smsc_sema.h.

Referenced by sema_msg_session_mo(), X28_close_send_link(), and X28_msg_pop().

◆ X28_MO_DATA_MODE

#define X28_MO_DATA_MODE   2

Definition at line 98 of file smsc_sema.h.

Referenced by X28_msg_pop().

◆ X28_MT_DATA_MODE

#define X28_MT_DATA_MODE   1

Definition at line 97 of file smsc_sema.h.

Referenced by sema_msg_session_mt(), and X28_open_send_link().

Typedef Documentation

◆ msg_hash

typedef struct msg_hash msg_hash

◆ sema_msg

typedef struct sema_msg sema_msg

◆ sema_msglist

typedef struct sema_msglist sema_msglist

◆ sm_deliver_invoke

◆ sm_deliver_result

◆ sm_statusreport_invoke

◆ sm_statusreport_result

◆ sm_submit_invoke

◆ sm_submit_result

Function Documentation

◆ increment_counter()

static void increment_counter ( void  )
static

◆ internal_char_hex_to_gsm()

static unsigned char internal_char_hex_to_gsm ( unsigned char  from)
static

◆ internal_char_hex_to_IA5()

static int internal_char_hex_to_IA5 ( unsigned  char,
unsigned char *   
)
static

◆ internal_char_IA5_to_hex()

static int internal_char_IA5_to_hex ( char *  ,
unsigned char *   
)
static

◆ line_append_hex_IA5()

static int line_append_hex_IA5 ( Octstr ,
unsigned char *  ,
int   
)
static

◆ line_scan_hex_GSM7()

static int line_scan_hex_GSM7 ( unsigned char *  ,
int  ,
int  ,
unsigned char *   
)
static

◆ line_scan_IA5_hex()

static int line_scan_IA5_hex ( char *  ,
int  ,
unsigned char *   
)
static

◆ pack_continous_byte()

static unsigned char pack_continous_byte ( int  ,
int  ,
int   
)
static

◆ sema_decode_msg()

static int sema_decode_msg ( sema_msg **  ,
char *   
)
static

◆ sema_encode_msg()

static int sema_encode_msg ( sema_msg ,
char *   
)
static

◆ sema_msg_free()

static int sema_msg_free ( sema_msg msg)
static

◆ sema_msg_new()

static sema_msg* sema_msg_new ( void  )
static

◆ sema_msg_session_mo()

static int sema_msg_session_mo ( SMSCenter ,
char *   
)
static

◆ sema_msg_session_mt()

static int sema_msg_session_mt ( SMSCenter ,
sema_msg  
)
static

◆ sema_msglist_free()

static void sema_msglist_free ( sema_msglist )
static

◆ sema_msglist_new()

static sema_msglist* sema_msglist_new ( void  )
static

◆ sema_msglist_pop()

static int sema_msglist_pop ( sema_msglist ,
sema_msg **   
)
static

◆ sema_msglist_push()

static int sema_msglist_push ( sema_msglist ,
sema_msg  
)
static

◆ sema_submit_result()

static int sema_submit_result ( SMSCenter ,
sema_msg ,
int   
)
static

◆ unpack_continous_byte()

static int unpack_continous_byte ( unsigned  char,
int *  ,
int *  ,
int *   
)
static

◆ X28_close_send_link()

static int X28_close_send_link ( int  )
static

◆ X28_data_read()

static int X28_data_read ( int  ,
char *   
)
static

◆ X28_data_send()

static int X28_data_send ( int  ,
char *  ,
int   
)
static

◆ X28_msg_pop()

static int X28_msg_pop ( char *  ,
char *   
)
static

◆ X28_open_data_link()

static int X28_open_data_link ( char *  )
static

◆ X28_open_send_link()

static int X28_open_send_link ( int  ,
char *   
)
static

◆ X28_reopen_data_link()

static int X28_reopen_data_link ( int  ,
char *   
)
static
See file LICENSE for details about the license agreement for using, modifying, copying or deriving work from this software.