📄 pscallhelper.c
字号:
//mdi_audio_set_speech_mode(KAL_TRUE);
MakePsReverseSpeechStatusAux(speechOn, type);
}
else
{
//mdi_audio_set_speech_mode(KAL_FALSE);
MakePsReverseSpeechStatusAux(speechOn, type);
if (mmi_bt_is_aud2hf() == MMI_TRUE || mmi_bt_is_incall_aud_swap2bt() == MMI_TRUE)
{
mmi_bt_turn_on_speech_req(MMI_FALSE);
}
}
mmi_bt_set_answer_by_ag_flag(MMI_FALSE);
#elif defined(__MMI_BT_SUPPORT__) && !defined(__MMI_BT_PROFILE__)
/* Turn on/off BT speech channel */
if (KAL_TRUE == speechOn)
{
if (mmi_bt_is_aud2hf() == MMI_TRUE)
{
mmi_bt_turn_on_speech_req(KAL_TRUE);
}
//mdi_audio_set_speech_mode(KAL_TRUE);
MakePsReverseSpeechStatusAux(speechOn, type);
}
else
{
//mdi_audio_set_speech_mode(KAL_FALSE);
MakePsReverseSpeechStatusAux(speechOn, type);
if (mmi_bt_is_aud2hf() == MMI_TRUE || mmi_bt_is_incall_aud_swap2bt() == MMI_TRUE)
{
mmi_bt_turn_on_speech_req(MMI_FALSE);
}
}
#else
MakePsReverseSpeechStatusAux(speechOn, type);
//mdi_audio_set_speech_mode(speechOn);
#endif
/* Start background sound effect after speech on */
#if defined(__MMI_BG_SOUND_EFFECT__)
if (KAL_TRUE == speechOn)
{
mmi_bgsnd_util_switch_speech(MMI_TRUE);
}
#endif /* defined(__MMI_BG_SOUND_EFFECT__) */
#ifdef __MMI_SOUND_RECORDER__
if(KAL_TRUE == speechOn)
{
mmi_sndrec_auto_record_switch(MMI_TRUE);
}
#endif /* __MMI_SOUND_RECORDER__ */
}
/*****************************************************************************
* FUNCTION
* MakePsStartVoiceRecord
* DESCRIPTION
* Sends start voice record request to Protocol stack
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void MakePsStartVoiceRecord(void)
{
#ifdef MMI_ON_HARDWARE_P
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
#ifdef __MMI_SOUND_RECORDER__
U8 file_name[60];
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
mmi_sndrec_get_new_file_name((UI_string_type) file_name);
mdi_audio_start_record((void*)file_name, MDI_FORMAT_GSM_EFR, NULL, (mdi_callback) StartVoiceRecordReqSucess);
return;
#endif /* __MMI_SOUND_RECORDER__ */
#ifdef __MMI_VOICE_MEMO__
{
MYQUEUE Message;
MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_MakePsStartVoiceRecord));
Message.oslSrcId = MOD_MMI;
Message.oslDestId = MOD_L4C;
Message.oslMsgId = PRT_START_VOICERECORD_REQ;
Message.oslPeerBuffPtr = NULL;
Message.oslDataPtr = NULL;
SetProtocolEventHandler(StartVoiceRecordReqSucess, PRT_START_VOICERECORD_RSP);
SetProtocolEventHandler(VoiceRecordFinishHandler, PRT_VOICERECORD_FINISH_IND);
OslMsgSendExtQueue(&Message);
}
#endif /* __MMI_VOICE_MEMO__ */
#endif /* MMI_ON_HARDWARE_P */
}
/*****************************************************************************
* FUNCTION
* MakePsStopVoiceRecord
* DESCRIPTION
* Sends stop voice record request to Protocol stack
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void MakePsStopVoiceRecord(void)
{
#ifdef MMI_ON_HARDWARE_P
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
#ifdef __MMI_SOUND_RECORDER__
mdi_audio_stop_record();
return;
#endif /* __MMI_SOUND_RECORDER__ */
#ifdef __MMI_VOICE_MEMO__
{
MYQUEUE Message;
MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_MakePsStopVoiceRecord));
Message.oslSrcId = MOD_MMI;
Message.oslDestId = MOD_L4C;
Message.oslMsgId = PRT_STOP_VOICERECORD_REQ;
Message.oslPeerBuffPtr = NULL;
Message.oslDataPtr = NULL;
/* SetProtocolEventHandler (StopVoiceRecordReqSucess,
PRT_STOP_VOICERECORD_RSP); */
SetProtocolEventHandler(NULL, PRT_VOICERECORD_FINISH_IND);
OslMsgSendExtQueue(&Message);
}
#endif /* __MMI_VOICE_MEMO__ */
#endif /* MMI_ON_HARDWARE_P */
}
/*****************************************************************************
* FUNCTION
* StartVoiceRecordReqSucess
* DESCRIPTION
* gets the response of Start Voice Record
*
* We are assuming that the protocol stack sends the Sucess response for the Conference request
* without any structure.
* PARAMETERS
* MsgStruct [?]
* This(?) [IN] Contains Null)
* RETURNS
* void
*****************************************************************************/
void StartVoiceRecordReqSucess(void *MsgStruct)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
S32 result;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_StartVoiceRecordReqSucess));
result = (S32) MsgStruct;
#ifdef __MMI_SOUND_RECORDER__
if (result == MDI_AUDIO_SUCCESS)
{
SetVoiceRecordingFlag(TRUE);
ShowStatusIcon(STATUS_ICON_VOICE_RECORD);
UpdateStatusIcons();
}
else if (result == MDI_AUDIO_TERMINATED)
{
/* do nothing */
}
else if (result == MDI_AUDIO_DISC_FULL)
{
VoiceRecordFinishHandler(NULL);
DisplayPopup(
(U8*) GetString((U16) mmi_sndrec_get_res_string((U8) result)),
IMG_GLOBAL_UNFINISHED,
0,
2000,
ERROR_TONE_IN_CALL);
}
else
{
DisplayPopup(
(U8*) GetString((U16) mmi_sndrec_get_res_string((U8) result)),
IMG_GLOBAL_UNFINISHED,
0,
2000,
ERROR_TONE_IN_CALL);
}
return;
#else /* __MMI_SOUND_RECORDER__ */
{
mmi_vm_record_rsp_struct *rsp = (mmi_vm_record_rsp_struct*) MsgStruct;
if (rsp->result)
{
SetVoiceRecordingFlag(TRUE);
ShowStatusIcon(STATUS_ICON_VOICE_RECORD);
UpdateStatusIcons();
}
}
#endif /* __MMI_SOUND_RECORDER__ */
}
/*****************************************************************************
* FUNCTION
* VoiceRecordFinishHandler
* DESCRIPTION
* gets the indication of Voice Record has completed
*
* We are assuming that the protocol stack sends the Sucess response for the Conference request
* without any structure.
* PARAMETERS
* MsgStruct [?]
* This(?) [IN] Contains Null)
* RETURNS
* void
*****************************************************************************/
void VoiceRecordFinishHandler(void *MsgStruct)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
SetVoiceRecordingFlag(FALSE);
HideStatusIcon(STATUS_ICON_VOICE_RECORD);
UpdateStatusIcons();
}
/*****************************************************************************
* FUNCTION
* DeriveAndSetCallFeatures
* DESCRIPTION
* Function derives call features such as CUG, CLIP etc.
* PARAMETERS
* info [?]
* Response(?) [IN] Structure from CHLD
* RETURNS
* pBOOL
*****************************************************************************/
pBOOL DeriveAndSetCallFeatures(void *info)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
MMI_PARSE_STR_RSP *rsp;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
rsp = (MMI_PARSE_STR_RSP*) info;
SetCCFlag(TRUE);
//chepi for time being.. dependent on pluto
//if(L4C_OK==rsp->result.flag)
if (1 == rsp->result.flag)
{
MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_DeriveAndSetCallFeatures, rsp->info.opcode));
if (CC_OPERATION == rsp->info.opcode || SS_OPERATION == rsp->info.opcode || SIM_OPERATION == rsp->info.opcode)
{
if (CC_OPERATION != rsp->info.opcode)
{
SetCCFlag(FALSE);
}
return TRUE;
}
}
SetCCFlag(FALSE);
return FALSE;
}
/*****************************************************************************
* FUNCTION
* DeriveOutgoingCallIdRsp
* DESCRIPTION
* Derives call ID for Outgoing call
* PARAMETERS
* info [?]
* cause [?]
* Call(?) [OUT] ID
* RETURNS
* U8
*****************************************************************************/
S16 DeriveOutgoingCallIdRsp(void *info, U16 *cause)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
MMI_DIAL_IND *rsp;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
rsp = (MMI_DIAL_IND*) info;
if (rsp->result.flag == L4C_OK)
{
MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_DeriveOutgoingCallIdRsp1, rsp->call_id));
return rsp->call_id;
}
else
{
MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_DeriveOutgoingCallIdRsp2));
*cause = rsp->result.cause;
#if defined (JATAAYU_SUPPORT) && defined (WAP_SUPPORT)
mmi_jdd_tapi_make_call_result(mmi_jdd_tapi_get_makecall_error_code(*cause));
#endif
return -1;
}
}
/*****************************************************************************
* FUNCTION
* DeriveCallHandle
* DESCRIPTION
* Derives call ID for End call
* PARAMETERS
* info [?]
* Call(?) [OUT] ID
* RETURNS
* U8
*****************************************************************************/
CM_CALL_HANDLE DeriveCallHandle(void *info)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
return (CM_CALL_HANDLE) ((MMI_RELEASE_IND*) info)->call_id;
}
/*****************************************************************************
* FUNCTION
* DeriveCallInfo
* DESCRIPTION
* Makes mapping between L4 strucutre to our strucutre
* PARAMETERS
* info [?]
* incmg [?]
* RETURNS
* void
*****************************************************************************/
void DeriveCallInfo(void *info, IncomingCall *incmg)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*---
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -