📄 mgi.h
字号:
* with the requested options. * * When more data is indicated using the MG_MORE_DATA flag, it indicates that * subsequent MG_ACTION_REQ primitives contain more data for the associated * pattern. The data is encoded according to the media format of the * requesting stream. * * When the requested duration is zero, the action will continue until its * normal termination, or until subsequently aborted. * * Actions on terminations which are currently connected in a communications * session will be mixed with the media received from the communications * session and any other actions which are currently being performed on the * termination. * * Actions on terminations which are currently disconnected from a * communications session will be be mixed with the media from other actions * on the termination point. * * Some actions can only be performed on disconnected termination points * (e.g., MG_ACTION_LOOPBACK, MG_ACTION_TEST_SILENT). * * Some actions replace all other actions on the termination point (e.g., * MG_ACTION_LOOPBACK, MG_ACTION_TEST_SILENT). * * Some actions performed on a termination point will be performed on * individual channels that make up the termination point (e.g. * MG_ACTION_LOOPBACK). */typedef struct MG_action_req { mg_ulong mg_primitive; /* always MG_ACTION_REQ */ mg_ulong mg_action; /* requested action */ mg_ulong mg_se_id; /* session id */ mg_ulong mg_tp_id; /* termination id to perform action */ mg_ulong mg_duration; /* duration in milliseconds */ mg_ulong mg_flags; /* option flags */} MG_action_req_t;#define MG_ACTION_FIRST 1#define MG_ACTION_SEND_PATTERN 1 /* send the provided pattern */#define MG_ACTION_REPEAT_PATTERN 2 /* repeat the provided pattern */#define MG_ACTION_LOOPBACK 3 /* apply loopback */#define MG_ACTION_TEST_CONT 4 /* apply continuity test tone */#define MG_ACTION_TEST_MILLIWATT 5 /* apply milliwatt */#define MG_ACTION_TEST_SILENT 6 /* apply silent termination */#define MG_ACTION_TEST_BALANCED 7 /* apply ballanced termination */#define MG_ACTION_US_RINGBACK 8 /* apply US ringback */#define MG_ACTION_US_BUSY 9 /* apply US busy */#define MG_ACTION_US_REORDER 10 /* apply US reorder */#define MG_ACTION_US_PERM_SIGNAL 11 /* apply US receiver of hook */#define MG_ACTION_US_BONG 12 /* apply US bong tone */#define MG_ACTION_EU_RINGBACK 13 /* apply EU ringback */#define MG_ACTION_EU_BUSY 14 /* apply EU busy */#define MG_ACTION_EU_REORDER 15 /* apply EU reorder */#define MG_ACTION_EU_PERM_SIGNAL 16 /* apply EU receiver of hook */#define MG_ACTION_EU_BONG 17 /* apply EU bong tone */#define MG_ACTION_MF_0 20 /* apply MF 0 */#define MG_ACTION_MF_1 21 /* apply MF 1 */#define MG_ACTION_MF_2 22 /* apply MF 2 */#define MG_ACTION_MF_3 23 /* apply MF 3 */#define MG_ACTION_MF_4 24 /* apply MF 4 */#define MG_ACTION_MF_5 25 /* apply MF 5 */#define MG_ACTION_MF_6 26 /* apply MF 6 */#define MG_ACTION_MF_7 27 /* apply MF 7 */#define MG_ACTION_MF_8 28 /* apply MF 8 */#define MG_ACTION_MF_9 29 /* apply MF 9 */#define MG_ACTION_MF_A 30 /* apply MF A */#define MG_ACTION_MF_B 31 /* apply MF B */#define MG_ACTION_MF_C 32 /* apply MF C */#define MG_ACTION_MF_D 33 /* apply MF D */#define MG_ACTION_MF_E 34 /* apply MF E */#define MG_ACTION_MF_F 35 /* apply MF F */#define MG_ACTION_WAIT 36 /* wait for specifie duration */#define MG_ACTION_LAST 36#define MG_MORE_DATA 0x01/* * MG_ACTION_CON, M_PROTO w/ 0 or more M_DATA * ------------------------------------------------------------------------- * Confirms that the requested action has begun. MG_ACTION_REQ which have * the MG_MORE_DATA flag set will not be confirmed until the last * MG_ACTION_REQ has been issued by the MG user. The end of restricted * duration actions will be indicated with MG_ACTION_IND. */typedef struct MG_action_con { mg_ulong mg_primitive; /* always MG_ACTION_CON */ mg_ulong mg_action; /* confirmed action */ mg_ulong mg_se_id; /* session id */ mg_ulong mg_tp_id; /* termination id for action confirmed */ mg_ulong mg_action_id; /* action identifier */} MG_action_con_t;/* * MG_ACTION_IND, M_PROTO * ------------------------------------------------------------------------- * Indicates that the action identified by the indicated action identifier * has completed. */typedef struct MG_action_ind { mg_ulong mg_primitive; /* always MG_ACTION_CON */ mg_ulong mg_action; /* completed action */ mg_ulong mg_se_id; /* session id */ mg_ulong mg_tp_id; /* termination id for action completed */ mg_ulong mg_action_id; /* action identifier */} MG_event_ind_t;/* * MG_ABORT_REQ, M_PROTO * ------------------------------------------------------------------------- * Requests that the specified action be aborted. This primitive is * confirmed with the MG_OK_ACK primiitve. If the action identifier is * MG_ACTION_PREVIOUS, this primitive requests that the previously initiated * (unconfirmed) action be aborted. If the action identifier is zero, this * primitive requests that all actions on the specified termination point be * aborted. */typedef struct MG_abort_req { mg_ulong mg_primitive; /* always MG_ABORT_REQ */ mg_ulong mg_se_id; /* session id */ mg_ulong mg_tp_id; /* termination id for action to abort */ mg_ulong mg_action_id; /* identifier of action to abort */} MG_abort_req_t;#define MG_ACTION_PREVIOUS (-1UL)/* * MG_CONN_REQ * ------------------------------------------------------------------------- * Request that the requested termination point be connected into the * communications session in the directions indicated by mg_conn_flags, with * the digital padding specified and the optional topology description. * * If the optional topology description is not included, it is assumed that * the termination point is requested to be connected to all other * participants in the communications session in the directions requested. * * If the optional topology description is included, it contains the list of * other termination points in the session to which the the specified * termination point is to be connected in the directions requested. */typedef struct MG_conn_req { mg_ulong mg_primitive; /* always MG_CONN_REQ */ mg_ulong mg_se_id; /* session id */ mg_ulong mg_tp_id; /* termination point */ mg_ulong mg_conn_flags; /* connection flags */ mg_ulong mg_padding; /* digital padding */ mg_ulong mg_topology_length; /* length of topology to connect */ mg_ulong mg_topology_offset; /* offset of topology to connect */} MG_conn_req_t;/* connect flags */#define MGF_IC_DIR 0x01#define MGF_OG_DIR 0x02#define MGF_BOTH_DIR (MGF_IC_DIR|MGF_OG_DIR)/* * MG_CONN_CON * ------------------------------------------------------------------------- * Confirms that the requested connection primitive has been successfully * completed. */typedef struct MG_conn_con { mg_ulong mg_primitive; /* always MG_CONN_CON */ mg_ulong mg_se_id; /* session id */ mg_ulong mg_tp_id; /* connecting channel id */} MG_conn_con_t;/* * MG_DATA_REQ, M_PROTO w/ M_DATA, prefferably just M_DATA. * ------------------------------------------------------------------------- * Sends channel data to the session from the requesting MG stream. */typedef struct MG_data_req { mg_ulong mg_primitive; /* always MG_DATA_REQ */ mg_ulong mg_flags; /* data flags */ mg_ulong mg_mx_slot; /* multiplex slot number */} MG_data_req_t;/* * MG_DATA_IND, M_PROTO w/ M_DATA, prefferably just M_DATA. * ------------------------------------------------------------------------- * Receives channel data from the session on the MG stream. */typedef struct MG_data_ind { mg_ulong mg_primitive; /* always MG_DATA_IND */ mg_ulong mg_flags; /* data flags */ mg_ulong mg_mx_slot; /* multiplex slot number */} MG_data_ind_t;/* * MG_DISCON_REQ * ------------------------------------------------------------------------- * Requests that the termination point be disconnected from the cmmunications * session in the directions indicated by mg_conn_flags, and the optional * topology description. * * If the optional topology description is not specified, it is assumed that * the termination point is to be disconnected from all other participants in * the communications session for the directions requested. * * If the optional topology description is specified, it contains the list of * other termination points in the session from which the specified * termination point is to be disconnected in the directions requested. */typedef struct MG_discon_req { mg_ulong mg_primitive; /* always MG_DISCON_REQ */ mg_ulong mg_se_id; /* session id */ mg_ulong mg_tp_id; /* termination point */ mg_ulong mg_conn_flags; /* connection flags */ mg_ulong mg_topology_length; /* length of topology to disconnect */ mg_ulong mg_topology_offset; /* offset of topology to disconnect */} MG_discon_req_t;/* * MG_DISCON_IND * ------------------------------------------------------------------------- * Indicates that the termination point has been autonomously disconnected * from the indicated communications session in the directions indicated by * mg_conn_flags and with the optional topology description. * * If the optional topology description is not indicated, it is assumed that * the termination point has been autonomously disconnected from all other * participants in the communications session for the directions indicated. */typedef struct MG_discon_ind { mg_ulong mg_primitive; /* always MG_DISCON_IND */ mg_ulong mg_se_id; /* session id */ mg_ulong mg_tp_id; /* disconnecting termination id */ mg_ulong mg_conn_flags; /* directions disconnected */ mg_ulong mg_cause; /* cause of disconnect */} MG_discon_ind_t;/* * MG_DISCON_CON * ------------------------------------------------------------------------- * Confirms that the requested disconnection primitive has been successfully * completed. */typedef struct MG_discon_con { mg_ulong mg_primitive; /* always MG_DISCON_CON */ mg_ulong mg_se_id; /* session id */ mg_ulong mg_tp_id; /* disconnecting termination id */} MG_discon_con_t;/* * MG_LEAVE_REQ * ------------------------------------------------------------------------- * Requests that the specified termination point (mg_tp_id non-zero) or all * termination points (mg_tp_id zero) leave the specified communication * session. Once all termination points leave a communications session, the * communication session is destroyed. */typedef struct MG_leave_req { mg_ulong mg_primitive; /* always MG_LEAVE_REQ */ mg_ulong mg_se_id; /* session id */ mg_ulong mg_tp_id; /* leaving termination id */} MG_leave_req_t;/* * MG_LEAVE_IND * ------------------------------------------------------------------------- * Indicates that the termination point has autonomously left the * communications session. */typedef struct MG_leave_ind { mg_ulong mg_primitive; /* always MG_LEAVE_IND */ mg_ulong mg_se_id; /* session id */ mg_ulong mg_tp_id; /* leaving termination id */ mg_ulong mg_cause; /* reason for leaving */} MG_leave_ind_t;/* * MG_LEAVE_CON * ------------------------------------------------------------------------- * Confirms that the termination point has left the session. The termination * point identifier is released. */typedef struct MG_leave_con { mg_ulong mg_primitive; /* always MG_LEAVE_CON */ mg_ulong mg_se_id; /* session id */ mg_ulong mg_tp_id; /* left termination id */} MG_leave_con_t;/* * MG_OK_ACK * ------------------------------------------------------------------------- */typedef struct MG_ok_ack { mg_ulong mg_primitive; /* always MG_OK_ACK */ mg_ulong mg_correct_prim; /* correct primitive */} MG_ok_ack_t;/* * MG_ERROR_ACK * ------------------------------------------------------------------------- */typedef struct MG_error_ack { mg_ulong mg_primitive; /* always MG_INFO_REQ */ mg_ulong mg_error_primitive; /* primitive in error */ mg_ulong mg_error_type; /* MG interface error type */ mg_ulong mg_unix_error; /* UNIX error */} MG_error_ack_t;#define MGSYSERR 0 /* UNIX system error */#define MGOUTSTATE 1 /* Interface out of state */#define MGBADPRIM 2 /* Bad primitive */#define MGNOTSUPP 3 /* Primitive not supported */#define MGBADID 4 /* Bad identifier */#define MGBADOPTTYPE 5 /* Bad options structure type */#define MGBADOPT 6 /* Bad option format or content */#define MGBADFLAG 7 /* Bad flag */#define MGIDBUSY 8 /* Object busy */#define MGBADACT 9 /* Bad action *//* * MG_NOTIFY_REQ * ------------------------------------------------------------------------- */typedef struct MG_notify_req { mg_ulong mg_primitive; /* always MG_NOTIFY_REQ */ mg_ulong mg_events; /* events to notify */} MG_notify_req_t;/* * MG_NOTIFY_IND * ------------------------------------------------------------------------- */typedef struct MG_notify_ind { mg_ulong mg_primitive; /* always MG_NOTIFY_IND */ mg_ulong mg_event; /* event */ mg_ulong mg_se_id; /* session id */ mg_ulong mg_tp_id; /* termination id */ mg_ulong mg_ch_id; /* channel id */ mg_ulong mg_diag_length; /* diagnostic length */ mg_ulong mg_diag_offset; /* diagnostic offset */} MG_notify_ind_t;#endif /* __SS7_MG_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -