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

📄 sip_idel_state.hxx

📁 模拟移动客户端软件飞信登录的状态机器定义代码。
💻 HXX
字号:
//====================================================================//                // Copyright (C) 2006-2008,  Frank.Ning//                // Filename:      sip_idel_state.hxx// Author:        Frank.Ning <zegong.ning@dinglicom.com>// Description:   //                // $Id:$//                //====================================================================#ifndef __SIP_IDEL_STATE_HXX__#define __SIP_IDEL_STATE_HXX__#include "state.hxx"static const char* const sip_idel_state_hxx_version =   "$Id:$";struct sip_idel_state : public fsm::state<sip_idel_state, FetionStateList, bool>{      bool on_process( shared_ptr<sip_cmd> cmd , ua_agent* parent )      {         ua_callctl& ua = ua_callctl::instance( );         parent->set_last_sip_cmd_msg( cmd );                  string method = cmd->get_method( );         if( method != "I" ||             method != "INVITE" )            return false ;                  shared_ptr<sip_status> status = parent->build_ring_msg( cmd );         parent->set_last_status_msg( status );         ua.get_output_channel( )->add( shared_ptr<sip_event>( status ) );         switch_to<sip_ring_state>( );                  return true ;               }      bool on_process( shared_ptr<sip_status> status , ua_agent* parent )      {         // there is no status to process         // ua_callctl::instance( ).set_last_sip_status( status );         return false ;      }      bool on_process( shared_ptr<keyboard_msg> msg, ua_agent* parent )      {         ua_callctl& ua = ua_callctl::instance( );         if( msg->get_cmd( ) != "INVITE" )            return false ;                  string fetion_id = msg->get_fid( );         if( fetion_id.empty( ) )            return false ;                  shared_ptr<sip_cmd> invite = ua.build_invite_msg( fetion_id, parent );         parent->set_last_sip_cmd_msg( invite );         ua.get_output_channel( shared_ptr<sip_event>( invite ) );         switch_to<sip_invite_state>( );         return true ;      }      };#endif   

⌨️ 快捷键说明

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