sip_idel_state.hxx.~2~
来自「模拟移动客户端软件飞信登录的状态机器定义代码。」· ~2~ 代码 · 共 94 行
~2~
94 行
//====================================================================// // Copyright (C) 2006-2007, 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<event> evt ) { shared_ptr<sip_event> sip_evt; sip_evt.reset( evt ); if( !sip_evt ) return false ; shared_ptr<sip_msg> msg; msg.reset( sip_evt->get_msg( ) ); if( !msg ) return true ; shared_ptr<sip_cmd> cmd; cmd.reset( msg ); if( cmd ) return on_process( cmd ); shared_ptr<sip_status> status ; status.reset( msg ); if( status ) return on_process( status ); return false ; } bool on_process( shared_ptr<sip_cmd> cmd ) { ua_callctl& ua = ua_callctl::instance( ); ua.set_last_sip_cmd( cmd ); ua.get_sip_channel( )->add( cmd ); string method = cmd->get_method( ); switch( method ) { case "R": case "REGISTER": switch_to<sip_register_state>( ); break ; case "I": case "INVITE": switch_to<sip_invite_state>( ); break; default: // no support method break ; } return true ; } bool on_process( shared_ptr<sip_status> status ) { // there is no status to process ua_callctl::instance( ).set_last_sip_status( status ); return true ; }};#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?