提交 1d5f9f9f authored 作者: Mathieu Rene's avatar Mathieu Rene

fix conflict

...@@ -7,7 +7,9 @@ applications/mod_hash ...@@ -7,7 +7,9 @@ applications/mod_hash
applications/mod_spandsp applications/mod_spandsp
dialplans/mod_dialplan_xml dialplans/mod_dialplan_xml
endpoints/mod_sofia endpoints/mod_sofia
#endpoints/mod_media_gateway
../../libs/freetdm/mod_freetdm ../../libs/freetdm/mod_freetdm
xml_int/mod_xml_cdr xml_int/mod_xml_cdr
event_handlers/mod_event_socket event_handlers/mod_event_socket
codecs/mod_sangoma_codec codecs/mod_sangoma_codec
event_handlers/mod_radius_cdr
...@@ -7,6 +7,6 @@ ifeq ($(ARCH),x86_64) ...@@ -7,6 +7,6 @@ ifeq ($(ARCH),x86_64)
endif endif
BASE=../../../.. BASE=../../../..
LOCAL_OBJS=media_gateway.o media_gateway_stack.o media_gateway_xml.o media_gateway_cli.o media_gateway_stack_alarms.o LOCAL_OBJS=media_gateway.o media_gateway_stack.o media_gateway_xml.o media_gateway_cli.o media_gateway_stack_alarms.o media_gateway_cmd_handler.o media_gateway_utils.o media_gateway_packages.o
LOCAL_LDFLAGS=-lsng_mg LOCAL_LDFLAGS=-lsng_mg
include $(BASE)/build/modmake.rules include $(BASE)/build/modmake.rules
/*
* Copyright (c) 2012, Sangoma Technologies
* Mathieu Rene <mrene@avgs.ca>
* All rights reserved.
*
* <Insert license here>
*/
#include "mod_media_gateway.h"
#include "media_gateway_stack.h"
MgPackage_t mg_pkg_list [] =
{
{ /* INDEX : 0 */
MGT_PKG_GENERIC, /* Package Id 1 : Generic package */
1, /* Version 1 */
"g", /* Package name */
},
{ /* INDEX : 1 */
MGT_PKG_ROOT,
2, /* Version 1 */
"root", /* Package name */
},
{ /* INDEX : 2 */
MGT_PKG_TONEDET, /*4*/
1, /* Version 1 */
"tonedet", /* Package name */
},
{ /* INDEX : 3 */
MGT_PKG_DTMFDET, /*6*/
1, /* Version 1 */
"dd", /* Package name */
},
{ /* INDEX : 4 */
MGT_PKG_NETWORK, /*11*/
1, /* Version 1 */
"nt", /* Package name */
},
{ /* INDEX : 5 */
MGT_PKG_RTP, /*12*/
1, /* Version 1 */
"rtp", /* Package name */
},
{ /* INDEX : 6 */
MGT_PKG_TDM_CKT, /*13*/
1, /* Version 1 */
"tdmc", /* Package name */
},
{ /* INDEX : 7 */
MGT_PKG_QTY_ALT, /*55*/
1, /* Version 1 */
"qac", /* Package name */
},
{ /* INDEX : 8 */
MGT_PKG_EN_ALERT, /*59*/
2, /* Version 2 */
"alert", /* Package name */
},
{ /* INDEX : 9 */
MGT_PKG_AN_DISP, /*60*/
2, /* Version 1 */
"andisp", /* Package name */
},
{ /* INDEX : 10 */
MGT_PKG_INACTTIMER, /*69*/
1, /* Version 1 */
"it", /* Package name */
},
{ /* INDEX : 11 */
MGT_PKG_STIMAL, /* 147 */
1, /* Version 1 */
"stimal ", /* Package name */
},
{ /* INDEX : 12 */
MGT_PKG_CALLPROGGEN, /* 7 */
1, /* Version 1 */
"cg", /* Package name */
},
{ /* INDEX : 13 */
MGT_PKG_GENERIC_ANNC, /* 29 */
1, /* Version 1 */
"an", /* Package name */
},
{ /* INDEX : 14 */
MGT_PKG_XD_CALPG_TNGN, /* 36 */
1, /* Version 1 */
"xcg", /* Package name */
},
{ /* INDEX : 15 */
MGT_PKG_BSC_SRV_TN, /* 37 */
1, /* Version 1 */
"srvtn", /* Package name */
},
{ /* INDEX : 16 */
MGT_PKG_ETSI_NR,
1, /* Version 1 */
"etsi_nr", /* Package name */
},
/* Add more packages */
};
/***************************************************************************************/
switch_status_t mg_build_pkg_desc(MgMgcoPkgsDesc* pkg)
{
uint16_t i = 0x00;
uint16_t num_of_pkgs = sizeof(mg_pkg_list)/sizeof(MgPackage_t);
printf("mg_build_pkg_desc: num_of_pkgs[%d]\n",num_of_pkgs);
for (i = 0; i < num_of_pkgs; i++) {
if (mgUtlGrowList((void ***)&pkg->items,
sizeof(MgMgcoPkgsItem), &pkg->num, NULLP) != ROK) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,"Package descriptor Grow List failed\n");
return SWITCH_STATUS_FALSE;
}
pkg->items[pkg->num.val - 1 ]->pres.pres = PRSNT_NODEF;
pkg->items[pkg->num.val - 1 ]->name.type.pres = PRSNT_NODEF;
pkg->items[pkg->num.val - 1 ]->name.type.val = MGT_GEN_TYPE_KNOWN;
pkg->items[pkg->num.val - 1 ]->name.u.val.pres = PRSNT_NODEF;
pkg->items[pkg->num.val - 1 ]->name.u.val.val = mg_pkg_list[i].package_id;
pkg->items[pkg->num.val - 1 ]->ver.pres = PRSNT_NODEF;
pkg->items[pkg->num.val - 1 ]->ver.val = mg_pkg_list[i].version;
printf("mg_build_pkg_desc: Inserted pkg_id[%d] with version[%d] into pkg list index[%d]\n",mg_pkg_list[i].package_id,mg_pkg_list[i].version,i);
}
return SWITCH_STATUS_SUCCESS;
}
/***************************************************************************************/
...@@ -49,29 +49,55 @@ typedef struct _mgStr ...@@ -49,29 +49,55 @@ typedef struct _mgStr
U8 val[128]; U8 val[128];
} MgStr; } MgStr;
#define MAX_PACKAGE_NAME 128
typedef struct _mgPackage
{
uint8_t package_id;
uint16_t version;
uint8_t name[MAX_PACKAGE_NAME+1];
}MgPackage_t;
extern MgPackage_t mg_pkg_list[];
#define MG_TXN_INVALID 0 #define MG_TXN_INVALID 0
#define mg_zero(_buf, _size) {cmMemset((U8 *)(_buf), 0, _size);} #define MG_ZERO(_buf, _size) {cmMemset((U8 *)(_buf), 0, _size);}
/* Set pres field */ /* Set pres field */
#define mg_util_set_pres(_pres) \ #define MG_SET_PRES(_pres) \
(_pres) = PRSNT_NODEF; (_pres) = PRSNT_NODEF;
/* Set token value */ /* Set token value */
#define mg_util_set_val_pres(tkn,_val) \ #define MG_SET_VAL_PRES(tkn,_val) \
mg_util_set_pres((tkn).pres); \ MG_SET_PRES((tkn).pres); \
(tkn).val = _val; (tkn).val = _val;
#define mg_mem_copy(_dst, _src, _len) \ #define MG_MEM_COPY(_dst, _src, _len) \
cmMemcpy((U8*) (_dst), (const U8*) (_src), _len) cmMemcpy((U8*) (_dst), (const U8*) (_src), _len)
#define mg_get_mem(_memPtr, _size, _allocPtr, ret) \
{ \ #define MG_INIT_TOKEN_VALUE(_tkn, _val) \
(*ret) = cmGetMem((Ptr *)(_memPtr),(_size) ,(Ptr *)&(_allocPtr)); \ { \
(_tkn)->pres = PRSNT_NODEF; \
(_tkn)->val = (_val); \
} }
#define MG_GETMEM(_ptr,_len,_memCp,_ret) \
{ \
ret = cmGetMem((_memCp), (_len), (Ptr *)&(_ptr)); \
if( ret == ROK) \
cmMemset((U8 *)(_ptr), (U8)0, (PTR)(_len)); \
}
#define MG_INIT_TKNSTR(_tkn, _val, _len) \
{ \
(_tkn)->pres = PRSNT_NODEF; \
(_tkn)->len = (U8)(_len); \
cmMemcpy((U8 *)(_tkn)->val, (CONSTANT U8 *)(_val), (_len)); \
}
void handle_sng_log(uint8_t level, char *fmt, ...); void handle_sng_log(uint8_t level, char *fmt, ...);
void handle_mgco_sta_ind(Pst *pst, SuId suId, MgMgtSta* msg); void handle_mgco_sta_ind(Pst *pst, SuId suId, MgMgtSta* msg);
...@@ -91,6 +117,29 @@ switch_status_t sng_mgco_init(sng_mg_event_interface_t* event); ...@@ -91,6 +117,29 @@ switch_status_t sng_mgco_init(sng_mg_event_interface_t* event);
switch_status_t sng_mgco_stack_shutdown(void); switch_status_t sng_mgco_stack_shutdown(void);
int sng_mgco_mg_get_status(int elemId, MgMngmt* cfm, megaco_profile_t* mg_cfg, mg_peer_profile_t* mg_peer); int sng_mgco_mg_get_status(int elemId, MgMngmt* cfm, megaco_profile_t* mg_cfg, mg_peer_profile_t* mg_peer);
switch_status_t mg_send_end_of_axn(SuId suId, MgMgcoTransId* transId, MgMgcoContextId* ctxtId, TknU32* peerId);
void mgco_print_sdp(CmSdpInfoSet *sdp);
void mg_util_set_ctxt_string ( MgStr *errTxt, MgMgcoContextId *ctxtId);
switch_status_t handle_mg_add_cmd(MgMgcoAmmReq *addReq);
switch_status_t mg_stack_free_mem(MgMgcoMsg* msg);
switch_status_t mg_stack_free_mem(MgMgcoMsg* msg);
switch_status_t mg_stack_alloc_mem( Ptr* _memPtr, Size _memSize );
switch_status_t mg_send_add_rsp(SuId suId, MgMgcoCommand *req);
S16 mg_fill_mgco_termid ( MgMgcoTermId *termId, CONSTANT U8 *str, CmMemListCp *memCp);
void mg_util_set_txn_string(MgStr *errTxt, U32 *txnId);
switch_status_t mg_build_mgco_err_request(MgMgcoInd **errcmd,U32 trans_id, MgMgcoContextId *ctxt_id, U32 err, MgStr *errTxt);
switch_status_t mg_send_audit_rsp(SuId suId, MgMgcoCommand *req);
switch_status_t handle_mg_audit_cmd(SuId suId, MgMgcoCommand *auditReq);
switch_status_t mg_send_modify_rsp(SuId suId, MgMgcoCommand *req);
switch_status_t mg_send_subtract_rsp(SuId suId, MgMgcoCommand *req);
void mg_util_set_term_string ( MgStr *errTxt, MgMgcoTermId *termId);
MgMgcoTermIdLst *mg_get_term_id_list(MgMgcoCommand *cmd);
switch_status_t handle_pkg_audit( SuId suId, MgMgcoCommand *auditReq);
switch_status_t mg_build_pkg_desc(MgMgcoPkgsDesc* pkg);
/****************************************************************************************************************/ /****************************************************************************************************************/
/* MG Stack defines */ /* MG Stack defines */
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
static switch_xml_config_item_t *get_instructions(megaco_profile_t *profile) ; static switch_xml_config_item_t *get_instructions(megaco_profile_t *profile) ;
static switch_xml_config_item_t *get_peer_instructions(mg_peer_profile_t *profile) ; static switch_xml_config_item_t *get_peer_instructions(mg_peer_profile_t *profile) ;
static int mg_sap_id; static int mg_sap_id;
static switch_status_t modify_mid(char* mid); static switch_status_t modify_mid(char** pmid);
/****************************************************************************************************************************/ /****************************************************************************************************************************/
switch_status_t config_profile(megaco_profile_t *profile, switch_bool_t reload) switch_status_t config_profile(megaco_profile_t *profile, switch_bool_t reload)
...@@ -59,10 +59,11 @@ switch_status_t config_profile(megaco_profile_t *profile, switch_bool_t reload) ...@@ -59,10 +59,11 @@ switch_status_t config_profile(megaco_profile_t *profile, switch_bool_t reload)
profile->total_peers++; profile->total_peers++;
} }
if(SWITCH_STATUS_FALSE == (status = modify_mid(profile->mid))){ if(SWITCH_STATUS_FALSE == (status = modify_mid(&profile->mid))){
goto done; goto done;
} }
profile->idx = ++mg_sap_id; profile->idx = ++mg_sap_id;
/* we should break from here , profile name should be unique */ /* we should break from here , profile name should be unique */
...@@ -100,7 +101,7 @@ switch_status_t config_profile(megaco_profile_t *profile, switch_bool_t reload) ...@@ -100,7 +101,7 @@ switch_status_t config_profile(megaco_profile_t *profile, switch_bool_t reload)
goto done; goto done;
} }
if(SWITCH_STATUS_FALSE == (status = modify_mid(peer_profile->mid))){ if(SWITCH_STATUS_FALSE == (status = modify_mid(&peer_profile->mid))){
goto done; goto done;
} }
...@@ -215,55 +216,57 @@ static switch_xml_config_item_t *get_instructions(megaco_profile_t *profile) { ...@@ -215,55 +216,57 @@ static switch_xml_config_item_t *get_instructions(megaco_profile_t *profile) {
/****************************************************************************************************************************/ /****************************************************************************************************************************/
static switch_status_t modify_mid(char* mid) static switch_status_t modify_mid(char** pmid)
{ {
char* dup = NULL; char* mid = *pmid;
char* dup;
char* val[10]; char* val[10];
int count; int count;
switch_status_t status = SWITCH_STATUS_FALSE;
switch_assert(mid); switch_assert(mid);
dup = strdup(mid);
/* If MID type is IP then add mid into [] brackets , /* If MID type is IP then add mid into [] brackets ,
* If MID type is domain then add mid into <> brackets * * If MID type is domain then add mid into <> brackets *
*/ */
dup = strdup(mid);
count = switch_split(dup, '.', val); count = switch_split(dup, '.', val);
if(!count) { if(!count) {
/* Input string is not separated by '.', check if its separated by '-' as format could be xxx-xx-xxx/xxx-xx-xx-xxx */ /* Input string is not separated by '.', check if its separated by '-' as format could be xxx-xx-xxx/xxx-xx-xx-xxx */
free(dup);
dup = strdup(mid);
if(0 == (count = switch_split(dup, '-', val))){ if(0 == (count = switch_split(dup, '-', val))){
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid input MID string[%s]\n",mid); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid input MID string[%s]\n",mid);
return SWITCH_STATUS_FALSE; goto done;
} }
} }
if(('<' == val[0][0]) || ('[' == val[0][0])){ if(('<' == val[0][0]) || ('[' == val[0][0])){
free(dup); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "MID = %s is already prefixed with proper brackets \n",mid);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "MID[%s] is already prefixed with proper brackets \n",mid); status = SWITCH_STATUS_SUCCESS;
return SWITCH_STATUS_SUCCESS; goto done;
} }
/*first check could be if count is 3 means domain name as generally we have xxx-xx-xxx/xxx.xx.xxx domain */ /*first check could be if count is 3 means domain name as generally we have xxx-xx-xxx/xxx.xx.xxx domain */
if(3 == count){ if(3 == count){
/* domain-type, add value into <> */ /* domain-type, add value into <> */
free(dup); *pmid = switch_mprintf("<%s>", mid);
dup = strdup(mid); free(mid);
sprintf(mid,"<%s>",dup); mid = *pmid;
}else if(4 == count){ }else if(4 == count){
/* IP address in xxx.xxx.xxx.xxx format */ /* IP address in xxx.xxx.xxx.xxx format */
free(dup); *pmid = switch_mprintf("[%s]", mid);
dup = strdup(mid); free(mid);
sprintf(mid,"[%s]",dup); mid = *pmid;
}else { }else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid input MID string[%s]\n",mid); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid input MID string[%s]\n",mid);
free(dup); goto done;
return SWITCH_STATUS_FALSE;
} }
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Added proper brackets to MID = %s \n",mid);
free(dup); status = SWITCH_STATUS_SUCCESS;
return SWITCH_STATUS_SUCCESS;
done:
return status;
} }
...@@ -18,6 +18,7 @@ static sng_mg_event_interface_t sng_event; ...@@ -18,6 +18,7 @@ static sng_mg_event_interface_t sng_event;
SWITCH_MODULE_LOAD_FUNCTION(mod_media_gateway_load); SWITCH_MODULE_LOAD_FUNCTION(mod_media_gateway_load);
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_media_gateway_shutdown); SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_media_gateway_shutdown);
SWITCH_MODULE_DEFINITION(mod_media_gateway, mod_media_gateway_load, mod_media_gateway_shutdown, NULL); SWITCH_MODULE_DEFINITION(mod_media_gateway, mod_media_gateway_load, mod_media_gateway_shutdown, NULL);
switch_status_t handle_mg_add_cmd(SuId suId, MgMgcoCommand *req, MgMgcoAmmReq *addReq); switch_status_t handle_mg_add_cmd(SuId suId, MgMgcoCommand *req, MgMgcoAmmReq *addReq);
switch_status_t mg_stack_free_mem(MgMgcoMsg* msg); switch_status_t mg_stack_free_mem(MgMgcoMsg* msg);
switch_status_t mg_stack_free_mem(MgMgcoMsg* msg); switch_status_t mg_stack_free_mem(MgMgcoMsg* msg);
...@@ -287,8 +288,6 @@ static switch_status_t mgco_parse_local_sdp(mg_termination_t *term, CmSdpInfoSet ...@@ -287,8 +288,6 @@ static switch_status_t mgco_parse_local_sdp(mg_termination_t *term, CmSdpInfoSet
} }
} }
/*****************************************************************************************************************************/
void handle_mgco_txn_ind(Pst *pst, SuId suId, MgMgcoMsg* msg) void handle_mgco_txn_ind(Pst *pst, SuId suId, MgMgcoMsg* msg)
{ {
size_t txnIter; size_t txnIter;
...@@ -307,7 +306,7 @@ void handle_mgco_txn_ind(Pst *pst, SuId suId, MgMgcoMsg* msg) ...@@ -307,7 +306,7 @@ void handle_mgco_txn_ind(Pst *pst, SuId suId, MgMgcoMsg* msg)
case MGT_TXNREQ: case MGT_TXNREQ:
{ {
MgMgcoTxnReq* txnReq; MgMgcoTxnReq* txnReq;
MgMgcoTransId transId; /* XXX */ /*MgMgcoTransId transId; *//* XXX */
int axnIter; int axnIter;
txnReq = &(msg->body.u.tl.txns[txnIter]->u.req); txnReq = &(msg->body.u.tl.txns[txnIter]->u.req);
...@@ -332,14 +331,13 @@ void handle_mgco_txn_ind(Pst *pst, SuId suId, MgMgcoMsg* msg) ...@@ -332,14 +331,13 @@ void handle_mgco_txn_ind(Pst *pst, SuId suId, MgMgcoMsg* msg)
MgMgcoCommand mgCmd; MgMgcoCommand mgCmd;
memset(&mgCmd, 0, sizeof(mgCmd)); memset(&mgCmd, 0, sizeof(mgCmd));
mgCmd.peerId = msg->lcl.id; mgCmd.peerId = msg->lcl.id;
mgCmd.transId = transId;
mgCmd.u.mgCmdInd[0] = cmdReq; mgCmd.u.mgCmdInd[0] = cmdReq;
/* XXX Handle choose context before this */ /* XXX Handle choose context before this */
mgCmd.contextId = ctxId; mgCmd.contextId = ctxId;
mgCmd.transId = transId; /*mgCmd.transId = transId;*/
mgCmd.cmdStatus.pres = PRSNT_NODEF; mgCmd.cmdStatus.pres = PRSNT_NODEF;
...@@ -478,31 +476,30 @@ void handle_mgco_txn_ind(Pst *pst, SuId suId, MgMgcoMsg* msg) ...@@ -478,31 +476,30 @@ void handle_mgco_txn_ind(Pst *pst, SuId suId, MgMgcoMsg* msg)
/*****************************************************************************************************************************/ /*****************************************************************************************************************************/
void handle_mgco_cmd_ind(Pst *pst, SuId suId, MgMgcoCommand* cmd) void handle_mgco_cmd_ind(Pst *pst, SuId suId, MgMgcoCommand* cmd)
{ {
uint32_t txn_id = 0x00; U32 txn_id = 0x00;
MgMgcoInd *mgErr; MgMgcoInd *mgErr;
MgStr errTxt; MgStr errTxt;
MgMgcoContextId ctxtId; MgMgcoContextId ctxtId;
MgMgcoTermIdLst* termLst;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "%s: Received Command Type[%s] \n", __PRETTY_FUNCTION__, PRNT_MG_CMD_TYPE(cmd->cmdType.val)); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "%s: Received Command Type[%s] \n", __PRETTY_FUNCTION__, PRNT_MG_CMD_TYPE(cmd->cmdType.val));
/* validate Transaction Id */ /* validate Transaction Id */
if (NOTPRSNT != cmd->transId.pres) if (NOTPRSNT != cmd->transId.pres){
txn_id = cmd->transId.val; txn_id = cmd->transId.val;
else } else {
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "%s: Transaction Id not present, rejecting\n", __PRETTY_FUNCTION__); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "%s: Transaction Id not present, rejecting\n", __PRETTY_FUNCTION__);
/*-- Send Error to MG Stack --*/ /*-- Send Error to MG Stack --*/
mg_zero(&ctxtId, sizeof(MgMgcoContextId)); MG_ZERO(&ctxtId, sizeof(MgMgcoContextId));
ctxtId.type.pres = NOTPRSNT; ctxtId.type.pres = NOTPRSNT;
ctxtId.val.pres = NOTPRSNT; ctxtId.val.pres = NOTPRSNT;
mg_util_set_txn_string(&errTxt, &txn_id); mg_util_set_txn_string(&errTxt, &txn_id);
if (SWITCH_STATUS_FALSE == mg_build_mgco_err_request(&mgErr, txn_id, &ctxtId, if (SWITCH_STATUS_SUCCESS == mg_build_mgco_err_request(&mgErr, txn_id, &ctxtId,
MGT_MGCO_RSP_CODE_INVLD_IDENTIFIER, &errTxt)) MGT_MGCO_RSP_CODE_INVLD_IDENTIFIER, &errTxt)) {
{
sng_mgco_send_err(suId, mgErr); sng_mgco_send_err(suId, mgErr);
} }
...@@ -511,7 +508,16 @@ void handle_mgco_cmd_ind(Pst *pst, SuId suId, MgMgcoCommand* cmd) ...@@ -511,7 +508,16 @@ void handle_mgco_cmd_ind(Pst *pst, SuId suId, MgMgcoCommand* cmd)
return ; return ;
} }
mgAccEvntPrntMgMgcoCommand(cmd, stdout); /* Get the termination Id list from the command(Note: GCP_2_1 has termination list , else it will be termination Id) */
termLst = mg_get_term_id_list(cmd);
if ((NULL == termLst) || (NOTPRSNT == termLst->num.pres)) {
/* termination-id not present , error */
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Termination-Id Not received..rejecting command \n");
mg_free_cmd(cmd);
return ;
}
/*mgAccEvntPrntMgMgcoCommand(cmd, stdout);*/
switch(cmd->cmdType.val) switch(cmd->cmdType.val)
{ {
...@@ -531,6 +537,7 @@ void handle_mgco_cmd_ind(Pst *pst, SuId suId, MgMgcoCommand* cmd) ...@@ -531,6 +537,7 @@ void handle_mgco_cmd_ind(Pst *pst, SuId suId, MgMgcoCommand* cmd)
case MGT_MODIFY: case MGT_MODIFY:
{ {
/*MgMgcoAmmReq *addReq = &cmdReq->cmd.u.mod;*/ /*MgMgcoAmmReq *addReq = &cmdReq->cmd.u.mod;*/
mg_send_modify_rsp(suId, cmd);
break; break;
} }
case MGT_MOVE: case MGT_MOVE:
...@@ -542,11 +549,33 @@ void handle_mgco_cmd_ind(Pst *pst, SuId suId, MgMgcoCommand* cmd) ...@@ -542,11 +549,33 @@ void handle_mgco_cmd_ind(Pst *pst, SuId suId, MgMgcoCommand* cmd)
case MGT_SUB: case MGT_SUB:
{ {
/*MgMgcoSubAudReq *addReq = &cmdReq->cmd.u.sub;*/ /*MgMgcoSubAudReq *addReq = &cmdReq->cmd.u.sub;*/
mg_send_subtract_rsp(suId, cmd);
break;
} }
case MGT_SVCCHG: case MGT_SVCCHG:
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Service-Change Method Not Yet Supported\n");
break;
}
case MGT_NTFY: case MGT_NTFY:
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "NOTIFY Method Not Yet Supported\n");
break;
}
case MGT_AUDITCAP: case MGT_AUDITCAP:
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Audit-Capability Method Not Yet Supported\n");
break;
}
case MGT_AUDITVAL: case MGT_AUDITVAL:
{
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Received Audit-Value Method \n");
handle_mg_audit_cmd(suId, cmd);
/*need to call this for other types of audit..
* ideally from the request apis we should send response..keeping now here just to send dummy responses*/
mg_send_audit_rsp(suId, cmd);
break;
}
break; break;
} }
...@@ -605,6 +634,7 @@ void handle_mgco_audit_cfm(Pst *pst, SuId suId, MgMgtAudit* audit, Reason reason ...@@ -605,6 +634,7 @@ void handle_mgco_audit_cfm(Pst *pst, SuId suId, MgMgtAudit* audit, Reason reason
/*****************************************************************************************************************************/ /*****************************************************************************************************************************/
/* /*
* *
* Fun: mg_get_term_id_list * Fun: mg_get_term_id_list
...@@ -1069,7 +1099,6 @@ void mg_util_set_txn_string(MgStr *errTxt, U32 *txnId) ...@@ -1069,7 +1099,6 @@ void mg_util_set_txn_string(MgStr *errTxt, U32 *txnId)
/*****************************************************************************************************************************/ /*****************************************************************************************************************************/
/* For Emacs: /* For Emacs:
* Local Variables: * Local Variables:
* mode:c * mode:c
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论