📄 sip_incall_state.hxx.~2~
字号:
//====================================================================// // Copyright (C) 2006-2007, Frank.Ning// // Filename: sip_incall_state.hxx// Author: Frank.Ning <zegong.ning@dinglicom.com>// Description: // // $Id:$// //====================================================================#ifndef __SIP_INCALL_STATE_HXX__#define __SIP_INCALL_STATE_HXX__static const char* const sip_incall_state_hxx_version = "$Id:$";#include "state.hxx"struct sip_incall_state : public fsm::state<sip_incall_state, FetionInviteStateList, bool>{ bool on_process( shared_ptr<event> evt ) { shared_ptr<sip_event> sip_evt; sip_evt.reset( evt ); if( sip_evt ) { shared_ptr<sip_cmd> cmd; cmd.reset( sip_evt->get_msg( ) ); if( cmd ) return on_process( cmd ); shared_ptr<sip_status> status; status.reset( sip_evt->get_msg( ) ); if( status ) return on_process( status ); } shared_ptr<keyborad_event> kevt ; kevt.reset( evt ); if( kevt ) return on_process( kevt ); return false ; } bool on_process( shared_ptr<sip_cmd> cmd ) { ua_callctl& ua = ua_callctl::instance( ); shared_ptr<sip_callid> callid; callid.reset( cmd->get_hdr( HDR_CALLID ) ); shared_ptr<ua_agent> agent = ua.find_agent( callid->get_callid( ) ); if( !agent ) return false ; agent->set_last_sip_cmd_msg( cmd ); if( cmd->get_method( ) == "A" || cmd->get_method( ) == "ACK" ) { if( agent->uas( ) ) ua.get_output_channel( )->add( cmd ); } if( cmd->get_method( ) == "C" || cmd->get_method( ) == "CANCEL" ) { shared_ptr<sip_status> status = agent->build_ok_msg( cmd ); agent->set_last_sip_status_msg( status ); ua.get_output_channel( )->add( status ); switch_to<sip_cancel_state>( ); } return true ; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -