| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- /*************************************************************************
- 【文件名】 DevResSpanCh.h
- 【功能模块和目的】 数字中继通道类头文件
- 【开发者及日期】 郑石诺 2015/03/18
- 【版本】 V1.0.0
- 【版权信息】 Copyright (C)2015 河南华谊网络科技有限公司
- 【更改记录】
- *************************************************************************/
- #pragma once
- #include "ChannelResource.h"
- #include "OneLeg.h"
- #include "IMixerHost.h"
- #include "Mixer.h"
- class CVoipChannel;
- /*************************************************************************
- 【类名】 CDevResSpanCh
- 【功能】
- 【接口说明】 数字中继通道类
- 【开发者及日期】 郑石诺 2015/03/18
- 【版本】 V1.0.0
- 【版权信息】 Copyright (C)2015 河南华谊网络科技有限公司
- 【更改记录】
- *************************************************************************/
- class CSpanChannel : public CChannelResource, public COneLeg, public IMixerHost
- {
- public:
- CSpanChannel(DEV_RES_CH_TYPE ChannelNo, DEV_RES_NO_TYPE SpanNo, DEV_RES_NO_TYPE NodeNo, DEV_RES_NO_TYPE BoardNo);
- virtual ~CSpanChannel(void);
- ////////////////////////////////////////////////////////////////////////////////
- //继承自CChannelResource
- bool open(void);
- void close(void);
- bool isFree(void) const { return (m_State == GCST_NULL && !m_IsBlocked); }
- int type(void) const { return SC_DTI; }
- LPCTSTR getStateStr(void) const;
- void onDevEvent(METAEVENT* pMetaEvent);
- ////////////////////////////////////////////////////////////////////////////////
- //继承自COneLeg
- bool offhook(bool IgnoreSession, LPCTSTR CallerNum = NULL) { return false;} // 内线摘机
- bool dropCall(bool IsPassive = false); // 挂机
- bool makeCall(LPCTSTR Callee, LPCTSTR Caller, int AccountId); // 启动线路拨号
- bool answer(void); // 应答呼叫
- bool playSound(PlayVoiceContent* pContent); // 放音收号
- bool playTone(int Type); // 播放信号音
- bool playStop(void); // 停止放音
- bool startRecord(RecordContent* pContent); // 开始录音
- bool stopRecord(void); // 停止录音
- bool monitor(COneLeg* pTalker, bool IsStop); // 监听
- bool allowMonitor(COneLeg* pMonitorParty) ; // 接受监听
- bool cancelMonitor(COneLeg* pMonitorParty); // 取消监听
- void freeResBinded(void) {} // 释放绑定资源
- bool reply(void);
- bool progress(void) { return true; }
- bool accept(void);
- void onFaxEnd(bool IsSuccess, LPCTSTR Reason);
- CChannelResource* routeChannel(void) { return this; }
- CChannelResource* resourceAttribute(void) { return this; }
- ////////////////////////////////////////////////////////////////////////////////
- //继承自IMixerHost
- int node(void) const { return nodeNo(); }
- int mixHandle(void) const { return m_Handle; }
- int mixType(void) const { return SC_DTI_MIX; }
- int normalType(void) const { return SC_DTI; }
- void onPlayEnd(LPCTSTR lpDtmf);
- void onRecEnd(UINT TaskId);
- void onToneEnd(int ToneTp);
- private:
- void __freeBindingChan(void);
- bool __clearCall(int Cause = GC_NORMAL_CLEARING);
-
- // 系统事件处理接口
- void __onOffered(METAEVENT* pMetaEvent);
- void __onAccept(void);
- void __onAlerting(METAEVENT* pMetaEvent);
- void __onAnswered(void);
- void __onConnected(void);
- void __onProgressing(void);
- void __onTaskFail(void);
- void __onCallFinished(void);
- void __onCallDisconnected(METAEVENT* pMetaEvent);
- private:
- DEV_RES_HANDLE m_GcHandle;
- DEV_RES_CALL_ID m_CallId;
- bool m_IsBlocked;
- CMixer m_Mixer;
- };
|