📄 sip_idel_state.hxx.~2~
字号:
//====================================================================// // 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -