⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mmicall.c

📁 GSM手机设计软件代码
💻 C
📖 第 1 页 / 共 5 页
字号:
          case CM_SPLIT_MULTIPARTY:
            TRACE_EVENT("call CM_SPLIT_MULTIPARTY received");
            call_data.singleCall = comm->call_number;
            call_data.calls.mode = CallPrivateCall;
          break;
          case CM_HOLD_MULTIPARTY:
            TRACE_EVENT("call CM_HOLD_MULTIPARTY received");
            call_data.calls.mode = CallConference;
          break;
          case CM_RETRIEVE_MULTIPARTY:
            TRACE_EVENT("call CM_RETRIEVE_MULTIPARTY received");
            call_data.calls.mode = CallConference;
          break;
          case CM_SWAP:
            TRACE_EVENT("call CM_SWAP received");
          break;
          case CM_SWAP_MULTIPARTY:
            TRACE_EVENT("call CM_SWAP MULTIPARTYreceived");
            if (call_data.calls.mode == CallSingleMultiparty)
              call_data.calls.mode = CallMultipartySingle;
            else
              call_data.calls.mode = CallSingleMultiparty;
          break;
          case CM_ETC:
            TRACE_EVENT("call CM_ETC received");
            i=0;
            while (i<call_data.calls.numCalls)
            {
              if (call_data.calls.status[i].call_number!=singleCall)
              {
                if (!removeCall(call_data.calls.status[i].call_number))
                i++;
              }
              else
                i++;
            }
          break;
          case CM_DTMF_AUTO:
          break;
          default:
          break;
                }
        rebuildCalls();
				
				if (call_data.win_waiting)
				{
					SEND_EVENT(call_data.win_waiting,DIALOG_DESTROY,0,0);
					call_data.win_waiting = 0;
					TRACE_EVENT("destroy call win h");
				}
				if (call_data.win_calling)
				{
					SEND_EVENT(call_data.win_calling,DIALOG_DESTROY,0,0);
					call_data.win_calling = 0;
					TRACE_EVENT("destroy call win i");
				}
				
            }
			if (call_data.accessEnd)
			{
             callSetMode(ViewConnect);
            }
			
	/* indicates if a command has failed e.g. ECT MC 12/04/02*/
	if (comm->result == NotPresent)
	{	bookShowInformation(call_data.win, TxtFailed,'\0',  NULL);
		if (call_data.win_waiting) /*If we're waiting for current command*/
			{	/*Get rid of waiting window*/
				SEND_EVENT(call_data.win_waiting,DIALOG_DESTROY,0,0);
				call_data.win_waiting = 0;
				TRACE_FUNCTION("destroy call win h");
			}


	}
      break;
    case E_CM_DTMF:
      if (call_data.sendingDTMF)
      {
          call_data.charSent++;
          sendDTMFString();
      }
    break;
    case E_CM_REDIAL:
      TRACE_EVENT("E_CM_REDIAL");
          pRedial = (T_MFW_CM_REDIAL*)para;
      if(pRedial == NULL)
      {
      }
      switch(pRedial->redial_mode)
      {

      case CM_REDIAL_BLACKLIST:
          TRACE_EVENT("CM_REDIAL_BLACKLIST");
				TRACE_EVENT("the blacklist is now full");
				/*
					GSM 2.07
					when the blacklist is full the MT 
					shall prohibit further automatic call 
					attempts to any one number until 
					the blacklist is manually cleared at the MT

					The blacklist is cleared after switch off/on ?!
				*/
			break;
			case CM_REDIAL_NO_SERVICE:
					TRACE_EVENT("CM_REDIAL_NO_SERVICE");
				break;
			case CM_REDIAL_OUTGOING:
					TRACE_EVENT("CM_REDIAL_OUTGOING");
			case CM_REDIAL_INCOMING:
					TRACE_EVENT("CM_REDIAL_INCOMING");
			case CM_REDIAL_ABORTED:
					TRACE_EVENT("CM_REDIAL_ABORTED");
			case CM_REDIAL_BLACKLISTED :
					TRACE_EVENT("CM_REDIAL_BLACKLISTED");

					if (call_data.win_redial)
					{
						SEND_EVENT(call_data.win_redial,DIALOG_DESTROY,0,0);
						call_data.win_redial = 0;
						TRACE_EVENT("destroy redial win ");
					}	

				break;
			case CM_REDIAL_SUCCESS:
					TRACE_EVENT("CM_REDIAL_SUCCESS");
					
					if (call_data.win_redial)
					{
						SEND_EVENT(call_data.win_redial,DIALOG_DESTROY,0,0);
						call_data.win_redial = 0;
						TRACE_EVENT("destroy redial win ");
					}
					rebuildCalls();
				break;

			case CM_REDIAL_STARTED:
					TRACE_EVENT("CM_REDIAL_STARTED");
					/*  */

					

					
					if (call_data.win_calling)
					{
						SEND_EVENT(call_data.win_calling,DIALOG_DESTROY,0,0);
						call_data.win_calling = 0;
						TRACE_EVENT("destroy call call_win");
					}

					if (pRedial->left_attempts EQ 0 )		// Not yet started redial attempts
					{
						/* start the 1st repeat attempt */
						cm_autoredial_start();
					}
					callSetMode(ViewAutoRedial);

			break;

			case CM_REDIAL_STOP:

					TRACE_EVENT("E_CM_REDIAL_STOP");
					
					if (call_data.win_redial)
					{
						SEND_EVENT(call_data.win_redial,DIALOG_DESTROY,0,0);
            call_data.win_redial = 0;
          }
          rebuildCalls();
        break;
        case CM_REDIAL_ATTEMPT:
          TRACE_EVENT("E_CM_REDIAL ATTEMPT");

        break;
            default:
        break;
          }
        break;
    case E_CM_MO_RES:
    {
      T_MFW_PHB_ENTRY phb_entry;
      T_MFW_CM_STATUS outgoing_call_data;
      T_MFW_CM_AOC_INFO   aoc_info;
      char * v_Number = NULL;
      memset(&outgoing_call_data, 0, sizeof(T_MFW_CM_STATUS));
      cid = (SHORT*)para;

      // this is used for the "last charge"
      cm_get_aoc_value(CM_AOC_ACM, &aoc_info);

      acm_last_call = aoc_info.acm;

      TRACE_EVENT ("E_CM_MO_RES");
      
      TRACE_EVENT_P1("Call Id %d",*cid);

      /* If we have no active call window, create one */
      if (!call_data.win)
      {
        call_create(0);
      }
      
      if (call_data.calls.numCalls == 0)
      {
        SEND_EVENT(call_data.win,CALL_INIT,0,0);
      }

      /* end any locally generated tones, this is for late assignment
       * and should be managed within ACI
       */
      if (LocalRing)
      {
      }

    /* SPR#1983 - SH - Notify WAP if a data call is set up */
    
#ifdef MMI_WAP_ENABLED
	{
	    T_MFW_CM_CALL_STAT	stat;
	    UBYTE		ton;
	    UBYTE		mode;

		cm_search_callStat(*cid, &stat, &ton, &mode);
		
	    if (mode == DATA_CALL)
	    {
		  AUI_wap_call_connect(*cid);
		}
	}
#endif

        /* set the outcall ID */
        call_data.outCall = *cid;
        call_data.call_direction = OUTGOING;
        
        /* fill the call status information from the call table in MFW/ACI */
        getCallStatus(*cid, &outgoing_call_data);

        /* set local pointer to number from call table */
        v_Number = (char*)(outgoing_call_data.number);
        
        TRACE_EVENT_P1("(char*)outgoing_call_data.number: %s", outgoing_call_data.number);
        
        /* Check whether the dialled number appears in the phonebook and set the
         * status information if it does
         */
        if (cm_check_emergency((UBYTE*)v_Number) == TRUE)
        {
            call_data.emergencyCall = TRUE;
        }

        /* SPR#1700 - DS - If call is a SAT call and the SIM has supplied an alpha identifier then
         * do not overwrite with name/number. Label already setup for SAT calls in function call().
         */
         if (call_SATCall == TRUE)
         {
            //Ensure calling string is NULL terminated
            call_data.phbNameNumber[sizeof(call_data.phbNameNumber)-1] = 0;
         }   
#ifdef NO_ASCIIZ
        else if ((bookFindNameInSDNPhonebook(v_Number, &phb_entry) == 1) && (phb_entry.name.len != 0) )
        {
            memcpy(call_data.phbNameNumber, (char*)phb_entry.name.data, sizeof(call_data.phbNameNumber)-1);
            call_data.phbNameNumber[sizeof(call_data.phbNameNumber)-1] = 0;
        }
        else if(bookFindNameInPhonebook(v_Number, &phb_entry) == 1 && (phb_entry.name.len != 0) )
        {
            memcpy(call_data.phbNameNumber, (char*)phb_entry.name.data, sizeof(call_data.phbNameNumber)-1);
            call_data.phbNameNumber[sizeof(call_data.phbNameNumber)-1] = 0;
        }
#else
        else if ( (bookFindNameInSDNPhonebook(v_Number, &phb_entry) == 1) && (phb_entry.name[0] != 0) )
        {
            memcpy(call_data.phbNameNumber, (char*)phb_entry.name, sizeof(call_data.phbNameNumber)-1);
            call_data.phbNameNumber[sizeof(call_data.phbNameNumber)-1] = 0;
        }
        else if(bookFindNameInPhonebook(v_Number, &phb_entry) == 1 && (phb_entry.name[0] != 0) )
        {
            memcpy(call_data.phbNameNumber, (char*)phb_entry.name, sizeof(call_data.phbNameNumber)-1);
            call_data.phbNameNumber[sizeof(call_data.phbNameNumber)-1] = 0;
        }
#endif
        else
        {
            memcpy(call_data.phbNameNumber,v_Number, sizeof(call_data.phbNameNumber)-1);
            /*MC, SPR 1257, merge from 3.3.3*/
            /* Marcus: Issue 987: 18/09/2002: Ensured call_data.phbNameNumber null terminated */
            call_data.phbNameNumber[sizeof(call_data.phbNameNumber)-1] = 0;
            /*MC end*/
            if ( (outgoing_call_data.ton == MFW_TON_INTERNATIONAL) && (
                outgoing_call_data.number[0] != '+') )
            {
                TRACE_EVENT("International Call Required!");
                // API - 826 - Create a buffer and a plus to the start of the buffer then add the out going number
                strcpy(InterNat_Plus, "+");
                strcat(InterNat_Plus, call_data.phbNameNumber);
                
                memcpy(call_data.phbNameNumber, (char*)InterNat_Plus, sizeof(call_data.phbNameNumber)+1);   
            }
        }

        if (call_SATCall == TRUE)
        {
            TRACE_EVENT ("SAT_CALL_DIALOG");
            // Marcus: Issue 1057: 21/01/2003: Removed: call_SATCall = FALSE;
            
            /* create the outgoing call dialog */
            call_calling_show(MMI_OUTGOING_CALL_DIALOG_SAT);
            
        }
        else
        {        
            TRACE_EVENT ("NORMAL_CALL_DIALOG");
            
            /* create the outgoing call dialog */
            call_calling_show(MMI_OUTGOING_CALL_DIALOG_NORMAL);
        }
	}
       break;
    case E_CM_TIMER_EVERY_SECOND:
      TRACE_EVENT("EVERY_SECOND");
      refreshCallTimer();
      cm_get_aoc_value(CM_AOC_CCM,&call_data.aocInfo);

	  TRACE_EVENT_P1("winIsFocussed(call_data.win) %d",winIsFocussed(call_data.win));

	  /* SPR#1602 - SH - Uncomment check to see if window is focussed */
	  if ( call_data.calls.mode == CallSingle && winIsFocussed(call_data.win) )
        winShow(call_data.win);
        
    break;
    case E_CM_CPI:
      cmCpi = (T_MFW_CM_CPI*)para;
	  if (cmCpi->type == CPI_MSG_Alert) 
      {
          if (!cmCpi->inband)
          {
			/* Testcase 26.8.x - generated internal alert */
		    audio_PlaySoundID(AUDIO_BUZZER, TONES_CW, 0, AUDIO_PLAY_INFINITE);
	        LocalRing = TRUE;
          }
          else if (LocalRing)
          { 
            audio_StopSoundbyID(AUDIO_BUZZER,TONES_CW);
            LocalRing = FALSE;
          } 

      }
      else if ((cmCpi->type == CPI_MSG_Disc) && (!cmCpi->inband))
      {
        audio_SetMute(AUDIO_SPEAKER, AUDIO_MUTING_ON);
      }
    break;
    /*MC SPR 1392, call deflection status*/
	case E_CM_CALL_DEFLECT_STATUS:
	{	BOOL* result = para;
		T_DISPLAY_DATA display_info;
	
	
		if (*result == TRUE)/*If call deflection was successful*/
		{	
			dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtCallDeflection, TxtDone, COLOUR_STATUS);
			dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)NULL, THREE_SECS, KEY_LEFT );	
		}
		else/*if call deflection failed*/
		{	
			dlg_initDisplayData_TextId( &display_info, TxtNull, TxtNull, TxtCallDeflection, TxtFailed, COLOUR_STATUS);
			dlg_initDisplayData_events( &display_info, (T_VOID_FUNC)NULL, THREE_SECS, KEY_LEFT );	
		}	
		/*Show dialog*/
		info_dialog(idle_get_window(), &display_info);
		/*destroy the call deflection windows and the call windows if no active call*/
		deflect_destroy(TRUE);

	}
	break;
    /* Marcus: CCBS: 14/11/2002: Start */
    case E_CM_CCBS:
        TRACE_EVENT("E_CM_CCBS");
        call_cm_ccbs_event((T_MFW_CM_CCBS_INFO *) para);
        break;
    /* Marcus: CCBS: 14/11/2002: End */
        
    /* SPR#1352 - SH - TTY */
#ifdef MMI_TTY_ENABLED
    case E_CM_CTYI:
      cmCTYI  = (T_MFW_CM_CTYI*)para;
      switch (cmCTYI->neg)
      {
      	case CTYI_REJECT:
      		TRACE_EVENT("CTYI REJECT");
      		/* TTY rejected, switch it off */
      		
  			call_tty_set(CALL_TTY_OFF);
   			call_tty_statuswin();
      		break;
      	case CTYI_GRANT:
      		TRACE_EVENT("CTYI GRANT");
      		/* If user has set "always on", then set that status.
      		 * Otherwise, we're just switching on TTY for the next
      		 * call */
      		 
  			if (FFS_flashData.ttyAlwaysOn)
  				call_tty_set(CALL_TTY_ALWAYSON);
  			else
  				call_tty_set(CALL_TTY_ONNEXTCALL);
  				
  			call_tty_statuswin();
      		break;
      }
      break;
#endif
    /* end SH */

        default:
    return 0;
    }
    return 1;
}



/*******************************************************************************

 $Function:     callWaitingAnswerKeyEvent

 $Description:

 $Returns:    1, processed, 0 ignored

 $Arguments:  event and parameter

*******************************************************************************/

static int callWaitingAnswerKeyEvent (MfwEvt e, MfwKbd *k)
{
  TRACE_FUNCTION("callWaitingAnswerKeyEvent");
  switch (k->code)
  {

    case KCD_LEFT:
      cm_command_abort(call_data.current_command);
    break;
    default:
    break;
  }
  return 1;
}





⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -