?? inet_line_msg.c
字號:
/****************************************************************************
**
** Copyright (c) 2003, UTStarcom, Inc.
** All Rights Reserved.
**
**
****************************************************************************/
#include "inet_comm.h"
#include "inet_msg.h"
#include "inet_msg_str.h"
#include "inet_timer.h"
#include "inet_declare.h"
/* **********************************************************************
to tel/sip, stask is always INET_CSC_TASK_ID;
to CSC, stask is always INET_INET_TASK_ID
********************************************************************** */
/************************************************************************
Function: inet_send_line_result_to_csc
Description:
Input: action: 0: success 1: failure
msg:
Output: None
Return: None
Others: None
Histrory: 2006-08-30,yuste,Created
*************************************************************************/
int inet_send_line_result_to_csc(INT8U action, INT8U tch, INT8U lineid)
{
UBYTE** shdl;
struct INET_MSG* rptr;
struct INET_TELSIP_LINE_RESULT_t *line_result_msg;
shdl = GetMem(sizeof(struct INET_TELSIP_LINE_RESULT_t) + INET_MSG_HEAD_LEN);
rptr = (struct INET_MSG*)*shdl;
line_result_msg = (struct INET_TELSIP_LINE_RESULT_t*) (*shdl + INET_MSG_HEAD_LEN);
rptr->stsk = INET_INET_TASK_ID;
rptr->rtsk = INET_CSC_TASK_ID;
rptr->msgid = TEL_LINE_RESULT;
rptr->len = 0x04;
line_result_msg->lineid = lineid;
line_result_msg->action = action;
line_result_msg->tch = tch;
line_result_msg->cause = 0x0;
inet_msg_dump((INT8U*) (* shdl));
SndMsg(rptr->rtsk, shdl);
return(0);
}
/************************************************************************
Function: inet_send_line_rsp_to_csc
Description:
Input: action: 0: accept 1: failure
msg:
Output: None
Return: None
Others: None
Histrory: 2006-08-06,yuste,Created
*************************************************************************/
int inet_send_line_rsp_to_csc(INT8U action, INT8U tch, INT8U lineid)
{
UBYTE** shdl;
struct INET_MSG* rptr;
struct INET_TEL_LINE_RSP_t *line_rsp_msg;
shdl = GetMem(sizeof(struct INET_TEL_LINE_RSP_t) + INET_MSG_HEAD_LEN);
rptr = (struct INET_MSG*)*shdl;
line_rsp_msg = (struct INET_TEL_LINE_RSP_t*) (*shdl + INET_MSG_HEAD_LEN);
rptr->stsk = INET_INET_TASK_ID;
rptr->rtsk = INET_CSC_TASK_ID;
rptr->msgid = TEL_LINE_RSP;
rptr->len = 3;
line_rsp_msg->lineid = lineid;
line_rsp_msg->action = action;
line_rsp_msg->tch = tch;
inet_msg_dump((INT8U*) (* shdl));
SndMsg(rptr->rtsk, shdl);
return(0);
}
/************************************************************************
Function: inet_send_line_hold_rel_to_csc
Description:
Input:
msg:
Output: None
Return: None
Others: None
Histrory: 2006-11-03,yuste,Created
*************************************************************************/
int inet_send_line_hold_rel_to_csc(INT8U tch, INT8U lineid)
{
UBYTE** shdl;
struct INET_MSG* rptr;
struct INET_TOCSC_LINE_HOLD_REL_t *line_hold_rel_msg;
shdl = GetMem(sizeof(struct INET_TOCSC_LINE_HOLD_REL_t) + INET_MSG_HEAD_LEN);
rptr = (struct INET_MSG*)*shdl;
line_hold_rel_msg = (struct INET_TOCSC_LINE_HOLD_REL_t*) (*shdl + INET_MSG_HEAD_LEN);
rptr->stsk = INET_INET_TASK_ID;
rptr->rtsk = INET_CSC_TASK_ID;
rptr->msgid = TEL_LINE_HOLD_REL;
rptr->len = 2;
line_hold_rel_msg->lineid = lineid;
line_hold_rel_msg->tch = tch;
inet_msg_dump((INT8U*) (* shdl));
SndMsg(rptr->rtsk, shdl);
return(0);
}
/************************************************************************
Function: inet_send_line_hold_rsp_to_csc
Description:
Input: action: 0: accept 1: failure
msg:
Output: None
Return: None
Others: None
Histrory: 2006-11-03,yuste,Created
*************************************************************************/
int inet_send_line_hold_rsp_to_csc(INT8U action, INT8U tch, INT8U lineid, INT8U hold_type)
{
UBYTE** shdl;
struct INET_MSG* rptr;
struct INET_TOCSC_LINE_HOLD_RSP_t *line_hold_rsp_msg;
shdl = GetMem(sizeof(struct INET_TOCSC_LINE_HOLD_RSP_t) + INET_MSG_HEAD_LEN);
rptr = (struct INET_MSG*)*shdl;
line_hold_rsp_msg = (struct INET_TOCSC_LINE_HOLD_RSP_t*) (*shdl + INET_MSG_HEAD_LEN);
rptr->stsk = INET_INET_TASK_ID;
rptr->rtsk = INET_CSC_TASK_ID;
rptr->msgid = TEL_LINE_HOLD_RSP;
rptr->len = 4;
line_hold_rsp_msg->lineid = lineid;
line_hold_rsp_msg->action = action;
line_hold_rsp_msg->tch = tch;
line_hold_rsp_msg->hold_type = hold_type;
inet_msg_dump((INT8U*) (* shdl));
SndMsg(rptr->rtsk, shdl);
return(0);
}
/************************************************************************
Function: inet_send_call_transfer_req_to_tel
Description:
Input:
Output: None
Return: None
Others: None
Histrory: 2006-11-03,yuste,Created
*************************************************************************/
int inet_send_call_transfer_req_to_tel(INT8U action, INT8U lineid)
{
UBYTE** shdl;
struct INET_MSG* sptr;
struct INET_TOTEL_CALL_TRANS_REQ_t *target_msg;
shdl = GetMem(sizeof(struct INET_TOTEL_CALL_TRANS_REQ_t) + INET_MSG_HEAD_LEN);
sptr = (struct INET_MSG*)*shdl;
target_msg = (struct INET_TOTEL_CALL_TRANS_REQ_t*) (*shdl + INET_MSG_HEAD_LEN);
sptr->stsk = INET_CSC_TASK_ID;
sptr->rtsk = INET_TEL_TASK_ID;
sptr->msgid = CSC_LINE_TRANS_REQ;
sptr->len = 0x2;
target_msg->action = action;
target_msg->lineid = lineid;
inet_msg_dump((INT8U*) (* shdl));
SndMsg(sptr->rtsk,shdl);
return OK;
}
/************************************************************************
Function: inet_send_line_hold_to_telsip
Description:
Input:
Output: None
Return: None
Others: None
Histrory: 2006-11-03,yuste,Created
*************************************************************************/
int inet_send_line_hold_req_to_telsip(INT8U action, INT8U tch, INT8U lineid)
{
UBYTE** shdl;
struct INET_MSG* sptr;
struct INET_TOTEL_LINE_HOLD_REQ_t *target_msg;
shdl = GetMem(sizeof(struct INET_TOTEL_LINE_HOLD_REQ_t) + INET_MSG_HEAD_LEN);
sptr = (struct INET_MSG*)*shdl;
target_msg = (struct INET_TOTEL_LINE_HOLD_REQ_t*) (*shdl + INET_MSG_HEAD_LEN);
sptr->stsk = INET_CSC_TASK_ID;
if( (lineid & 0x01) == 0x01 ){ /* line */
sptr->rtsk = INET_TEL_TASK_ID;
}
else{ /* sip */
sptr->stsk = INET_INET_TASK_ID;
sptr->rtsk = INET_SIP_TASK_ID;
}
sptr->msgid = CSC_LINE_HOLD_REQ;
sptr->len = 0x3;
target_msg->action = action;
target_msg->lineid = lineid;
target_msg->tch = tch;
inet_msg_dump((INT8U*) (* shdl));
SndMsg(sptr->rtsk,shdl);
return OK;
}
/************************************************************************
Function: inet_send_page_rsp_to_telsip
Description:
Input:
Output: None
Return: None
Others: None
Histrory: 2006-08-23,yuste,Created
*************************************************************************/
int inet_send_page_rsp_to_telsip(INT8U action, INT8U tch, INT8U lineid)
{
UBYTE** shdl;
struct INET_MSG* sptr;
struct INET_CSC_PAGE_RSP_t *target_msg;
shdl = GetMem(sizeof(struct INET_CSC_PAGE_RSP_t) + INET_MSG_HEAD_LEN);
sptr = (struct INET_MSG*)*shdl;
target_msg = (struct INET_CSC_PAGE_RSP_t*) (*shdl + INET_MSG_HEAD_LEN);
sptr->stsk = INET_CSC_TASK_ID;
if( ( (lineid & 0x01) == 0x01 ) || ( (lineid & 0x80) == 0x80 ) ){ /* line or hs. */
sptr->rtsk = INET_TEL_TASK_ID;
}
else{ /* sip */
sptr->stsk = INET_INET_TASK_ID;
sptr->rtsk = INET_SIP_TASK_ID;
}
sptr->msgid = INET_SIP_PAGE_RSP;
sptr->len = 0x4;
target_msg->action = action;
target_msg->lineid = lineid;
target_msg->tch = tch;
target_msg->cause = 0x0;
inet_msg_dump((INT8U*) (* shdl));
SndMsg(sptr->rtsk,shdl);
return OK;
return(0);
}
/************************************************************************
Function: inet_send_line_pre_req
Description: only send to self ibox's line pre request.
Input:
Output: None
Return: None
Others: None
Histrory: 2006-08-06,yuste,Created
*************************************************************************/
int inet_send_line_pre_req(struct INET_TOTELSIP_LINE_REQ_t* struct_src_msg)
{
UBYTE** shdl;
INT8U line_id;
INT8U action;
struct INET_MSG* sptr;
struct INET_TOTELSIP_LINE_REQ_t *struct_tgt_msg;
shdl = GetMem(INET_DTMF_REQUEST_LEN);
sptr = (struct INET_MSG*)*shdl;
struct_tgt_msg = (struct INET_TOTELSIP_LINE_REQ_t*) (*shdl + INET_MSG_HEAD_LEN);
line_id = struct_src_msg->lineid;
action = struct_src_msg->action;
sptr->stsk = INET_CSC_TASK_ID;
if( (line_id & 0x10) == 0x10 ){ /* to SIP */
sptr->stsk = INET_INET_TASK_ID;
sptr->rtsk = INET_SIP_TASK_ID;
}
else{
sptr->rtsk = INET_TEL_TASK_ID;
}
sptr->msgid = CSC_LINE_REQ;
sptr->len = 6;
if(action != 0x06) /* ps take line communication directly */
struct_tgt_msg->action = 0x0;
else
struct_tgt_msg->lineid = action;
struct_tgt_msg->lineid = line_id;
struct_tgt_msg->tch = struct_src_msg->tch;
struct_tgt_msg->netext = struct_src_msg->netext;
struct_tgt_msg->call_type = struct_src_msg->call_type;
struct_tgt_msg->dtmf_num[0] = 0x0;
/* dump current message */
inet_syslog(LOG_INFO,"\n\r[INET] line(%d) line pre req sent.", line_id);
inet_msg_dump((INT8U*) (* shdl));
/* send message to tel/sip module */
SndMsg(sptr->rtsk,shdl);
return OK;
}
/************************************************************************
Function: inet_send_dtmf_req
Description: only send to self ibox's tel or sip.
Input: action, line_id,
msg: source msg who start the pid.
Output: None
Return: None
Others: None
Histrory: 2006-08-06,yuste,Created
*************************************************************************/
int inet_send_dtmf_req(struct INET_TOTELSIP_LINE_REQ_t* struct_src_msg)
{
UBYTE** shdl;
INT8U line_id;
INT8U action;
INT8U dtmf_len;
struct INET_MSG* sptr;
struct INET_TOTELSIP_LINE_REQ_t *struct_tgt_msg;
shdl = GetMem(INET_DTMF_REQUEST_LEN);
sptr = (struct INET_MSG*)*shdl;
struct_tgt_msg = (struct INET_TOTELSIP_LINE_REQ_t*) (*shdl + INET_MSG_HEAD_LEN);
line_id = struct_src_msg->lineid;
action = struct_src_msg->action;
sptr->stsk = INET_CSC_TASK_ID;
if( (line_id & 0x10) == 0x10 ){ /* to SIP */
sptr->stsk = INET_INET_TASK_ID;
sptr->rtsk = INET_SIP_TASK_ID;
}
else{
sptr->rtsk = INET_TEL_TASK_ID;
}
sptr->msgid = CSC_LINE_REQ;
sptr->len = 6;
struct_tgt_msg->lineid = line_id;
struct_tgt_msg->action = action;
struct_tgt_msg->tch = struct_src_msg->tch;
struct_tgt_msg->netext = struct_src_msg->netext;
struct_tgt_msg->call_type = struct_src_msg->call_type;
/* request a new line or ps call hs */
if((action == 0x0) || (action == 0x02))
{
struct_tgt_msg->dtmf_num[0] = 0x0;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -