📄 sessioncontrol.h
字号:
#ifndef SESSIONCONTROL_H_INCLUDED#define SESSIONCONTROL_H_INCLUDED#include <qobject.h>#include <qstring.h>#include <sys/types.h>#include "../dissipate2/udpmessagesocket.h"// all those video codecs we support#define H261D "H261"#define H261N "31"#define H263D "H263"#define H263N "34"#define H263PD "H263-1998"#define H263PN "103"// all those audio codecs we support#define PCMUD "PCMU"#define PCMUN "0"#define PCMAD "PCMA"#define PCMAN "8" #define GSMD "GSM"#define GSMN "3" #define ILBCD "ILBC"#define ILBCN "97"#define SPEEXD "SPEEX"#define SPEEXN "98"//Nuber of supportedaudio codecs#define NAUDIO 5//Nuber of supportedaudio codecs#define NVIDEO 3#define useudpL4 1#define usertpL4 2class DspAudio;class SipCall;class SipCallMember;//The list of audio codecs, used for the DSP Classesenum codecType { codecUnknown, codecULAW, codecALAW, codecGSM, codecILBC_20, codecILBC_30, codecSpeex };/*** @short Permanent Data storage** This Class holds all the Phone's permanent data* It offers Methods for reading and manipulating those data* For per Call use, the data are copied to SipCall at Call Begin* The permanent data are stored at two places* the database-file /home/$Home/.qt/kphonesirc file* this Class* They are read into this Class whenever the database-file is changed* whenever the KPhoneSI is started and whenever a call is startet.*/class SessionControl : public QObject{ Q_OBJECTpublic: SessionControl( const char *name ); ~SessionControl( void ); enum audiomodeType { isOSS, isALSA };typedef enum audiomodeType audioModeT;///The Resourcesvoid setAudioSys(audioModeT am) { audioMode=am; }audioModeT getAudioSys (void) { return audioMode; }bool isAudioRW(void) { return audioRW;}void setAudioRW(bool rw) { audioRW=rw; }/****/ void useOSS( void );/****/ void setOSSFilename( const QString &devname );/****/ void setALSAFilename( const QString &devname );/****/ void setOSSFilename2( const QString &devname );/****/ void setRinging( int rtbSel ){rtbsel= rtbSel;}/****/ int getRinging(void){return rtbsel;}/****/ void setRingtonefile( const QString &name );/****/ void setRingtoneapp( const QString &name );/****/ void setRingtonedevice( const QString &name );/****/ void setRingtoneP( const QString &name ); /****/ const QString &getRingtonefile( void ) const { return ringtonefile; }/****/ const QString &getRingtoneapp( void ) const { return ringtoneapp; }/***/ const QString &getRingtonedevice( void ) const { return ringtonedevice; }/****/ const QString &getRingtoneP( void ) const { return ringtonep; }/****/ const QString &getOSSFilename( void ) const { return ossfilename; }/****/ const QString &getOSSFilename2( void ) const { return ossfilename2; }/****/ const QString &getALSAFilename( void ) const { return alsafilename; }/****/ void setVideoSW( const QString &sw );/****/ const QString &getVideoSW( void ) const { return videoSW; }/****/ void setVideoDEV( const QString &sw );/****/ const QString &getVideoDEV( void ) const { return videoDEV; }/***retrieve the vectorId */ const QString &getVectorId1( int i ) const { return vectorId[i]; } /*** store the vectorId */ void setVectorId( int i,const QString &sw );/***store the Path to the application */ void setExtSW( int i, const QString &sw );/***retrieve the Path to the application for SessionType 1*/ const QString &getExtSW1( int i) const { return extSW[i]; }/*** store the cmdline of the application */ void setExtPR( int i, const QString &pr );/***retrieve the cmdline of the application for SessionType 1 */ const QString &getExtPR( int i ) const { return extPR[i]; }/***store the icon-name of the application */ void setExtIco( int i, const QString &sw );/*** Read vectorId to solicit session types*/ const QString theVectorId(int i); /*** Read the path to the application*/ const QString forkSW(int i); /*** Read the parameters of the application*/ const QString forkSP(int i); /*** read the total number of prefered Audio Codecs*/ int getTotalNumberOfPrefAudioCodecs(void) {return totalNumberOfPrefAudioCodecs;}/*** read the total number of prefered Video Codecs*/ int getTotalNumberOfPrefVideoCodecs(void) {return totalNumberOfPrefVideoCodecs;}/*** set the RTP-Payload sample in ms*/ void setPayload ( int newPayload ) { payload = newPayload; }/*** get the RTP-Payload sample in ms*/ int getPayload (void) {return payload;}/****/ void setSymMediaMode( bool yesno ) { symMedia = yesno; }/****/ QString getVidPrefCodec (int i) { return vidPrefCodec[i] ; }/****/ void setVidPrefCodec (int i, const QString &vcodec);/****/ void setVidPrefCodecNum (int i, const QString &codecnum);/****/ QString getVidPrefCodecNum (int i) { return vidPrefCodecNum[i] ; } QString getNZVidPrefCodecNum (int i);/****/ void setPrefCodec (int i, const QString &codec);/****/ QString getPrefCodec (int i) { return prefCodec[i] ; }/****/ void setPrefCodecNum (int i, const QString &codecnum);/****/ QString getPrefCodecNum (int i) { return prefCodecNum[i] ; } QString getNZPrefCodecNum (int i);/****/ QString getCodecName (int i) { return vCodecName[i] ; }/****/ QString getCodecNum (int i) { return vCodecNum[i] ; }/****/ QString getACodecName (int i) { return aCodecName[i] ; }/****/ QString getACodecNum (int i) { return aCodecNum[i] ; }/****/ void initCodecVideo(int pcodec,int scodec,int tcodec);/****/ void initCodecAudio(int pcodec,int scodec,int tcodec,int qcodec, int fcodec);/****/ void setVidPermFlags(void);/****/ void setBodyMask( QString body ) { bodyMask = body; }/****/ QString getBodyMask( void ) { return bodyMask; }/****/ int checkCodec( SipCallMember *member );/*Stun Server*/ void setStunSrv( QString newStunSrv ); QString getStunSrv( void ) { return stunSrv;} bool isStun(void) { return useStun; } void setStun(bool st) { useStun=st; }/*** the forwarded to URI for CFNA*/ const QString &getCallForwardNAUri( void ) { return forwardNAuri; }/*** number of rings after which CFNA is activated*/ const QString &getCallForwardNAcnt( void ) { return forwardNAcnt; }/*** number of rings after which AA is activated*/ const QString &getAuacnt( void ) { return Auacnt; }/*** the forwarded to URI for CFNA*/ void setCallForwardNAUri( const QString &u ) { forwardNAuri=u;}/*** number of rings after which CFNA is activated*/ void setCallForwardNAcnt( const QString &u ) { forwardNAcnt=u;}/*** number of rings after which AA is activated*/ void setAuacnt( const QString &au ) { Auacnt=au;}/***The Sessiontype i may be support terminating MPO handling*/ bool isMPOAllowed(int i);/*** The Sessiontype i may be set on Hold*/ bool isHoldAllowed(int i);/*** The SessionType i may perform Call Transfer*/ bool isTransferAllowed(int i);/*** This session Type i reqests to be active only.*/ bool activeOnly(int i);/*** The Sessiontype i may be set on Hold*/ void setHoldAllowed(int i,bool val) {allowHold[i] = val;}/*** The Sessiontype i may be support terminating MPO handling*/ void setMPOAllowed(int i,bool val) {allowMPO[i] = val;}/*** The SessionType i may perform Call Transfer*/ void setTransferAllowed(int i,bool val) {allowTransfer[i] = val;}/*** This session Type reqests to be active only.*/ void setActiveOnly(int i,bool val) { onlyActive[i] = val;}/*** Read the flags bool allowHold[i],bool allowTransfer[i]* and bool onlyActive[i] from Resourcefile into memory.*/ void setPermFlags(int i);/*** interrogates if someone monopolizes the active state*/ bool getOccupyActive (void) {return occupyActive;}/*** announces the someone is active and allows no one else with onlyActive* Flag set to become active.*/ void setOccupyActive (bool oa); /*** set / reset allowance for remote start*/void allowRemoteStart(int lt, bool allow) {AllowRemoteStart[lt]= allow; }/*** is remote start allowed for this CallType*/bool isRemoteStartAllowed (int lt) {return AllowRemoteStart[lt]; }/****/ void setUseL4 ( int i,int uL4) { useL4v[i] = uL4; }/****/ int useL4 (int i){return useL4v[i];}/****/ bool getSymMediaMode(void) { return symMedia; }/****/ bool getCFNA(void) {return docfna; }/****/ void setCFNA( bool cfna) { docfna = cfna; }/****/ bool getRem(void) {return dorem; }/****/ void setRem( bool rem) { dorem = rem; }/****/ bool getAua(void) {return doaua; }/****/ void setAua( bool aua) { doaua = aua; }/*** REFER Notification Supervision timer*/ void setNotiExpires( int noti) { notiExpires = noti; }/*** time gap between outpulsing of two DTMF sequences*/ void setDTMFWait( int dt) { dtmfWait = dt; }/*** REFER Notification Supervision timer*/ int getNotiExpires( void) { return notiExpires; }/*** time gap between outpulsing of two DTMF sequences*/ int getDTMFWait( void) { return dtmfWait; } void setPorts(QString mmin,QString mmax,QString amin,QString amax); int getMinMediaPort(void) { return minMediaPort; } int getMaxMediaPort(void) { return maxMediaPort; } int getMinApplPort(void) { return minApplPort; } int getMaxApplPort(void) { return maxApplPort; } void setILBC(bool setI) { haveILBC=setI;} bool getILBC(void) { return haveILBC;} void setOnlyActive (void); void setDefaultProxy(QString userdefaultproxy) { defProxy=userdefaultproxy; } QString getDefaultProxy(void) { return defProxy; }/** get srtp mode*/ int getSrtpMode(void) { return srtpmode;}/** set srtp mode*/ void setSrtpMode (int m) { srtpmode = m; }private: bool haveILBC; bool audioRW; bool docfna; bool dorem; bool doaua; bool allowHold[20]; bool allowMPO[20]; bool allowTransfer[20]; bool onlyActive[20]; bool occupyActive; int useL4v[20]; bool AllowRemoteStart[20]; bool useoss; bool useStun; bool symMedia; int notiExpires; int dtmfWait; int extSem; int payload; int audio_fd; int rtpCodecNum; int totalNumberOfPrefAudioCodecs; int totalNumberOfPrefVideoCodecs; DspAudio *input; DspAudio *output; pid_t pidVideo; pid_t pidExt; audioModeT audioMode; QString pFix; QString stunSrv; QString Auacnt; QString forwardNAcnt; QString forwardNAuri; QString ossfilename; QString ossfilename2; QString alsafilename; QString videoSW; QString videoDEV; QString extSW[4]; QString extSWI; QString extIco[4]; QString extIcoI; QString extPR[4]; QString extPRI; QString vectorIdI; QString vectorId[4]; QString vectorId1; QString vectorId2; QString vectorId3; QString vectorId4; QString extContact; QString extHomePort; QString bodyMask; QString ringtonefile; QString ringtonedevice; QString ringtonep; QString ringtoneapp; int minMediaPort; int maxMediaPort; int minApplPort; int maxApplPort; int rtbsel; QString vidPrefCodec[NVIDEO]; QString vidPrefCodecNum[NVIDEO]; QString vCodecName[NVIDEO+1]; QString vCodecNum[NVIDEO+1]; QString prefCodec[NAUDIO]; QString prefCodecNum[NAUDIO]; QString aCodecName[NAUDIO]; QString aCodecNum[NAUDIO]; QString defProxy; int srtpmode; int debug;};#endif // SESSIONCONTROL_H_INCLUDED
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -