kcallwidget.h
来自「KphoneSI (kpsi) is a SIP (Session Initia」· C头文件 代码 · 共 456 行
H
456 行
#ifndef KCALLWIDGET_H_INCLUDED#define KCALLWIDGET_H_INCLUDED#include <qdialog.h>#include <qptrdict.h>#include <qevent.h>#include <qcombobox.h>#include <time.h>#include "../dissipate2/sipuri.h"#include "../dissipate2/sdpbuild.h"#include "../dissipate2/sipmessage.h"#include "../dissipate2/sipcall.h"#include "kphonebook.h"#include "kreferdialog.h"#include "kinstantmessagewidget.h"#include "dspearly.h"class QLabel;class QLineEdit;class KComboBox;class QPushButton;class QTextEdit;class SipUser;class SipCall;class SipClient;class SipCallMember;class SipTransaction;class SessionControl;class IncomingCall;class SipMessage;class KSipAuthentication;class KPhoneView;class CallAudio;/*** @short the graphic representation of the call** The graphic representation of the call.* The class sets up the user interface to a running call and* is also responsible for the call control logic. * Functions as start and accept INVITE messages, Codec checks* the start of the payload session and call release are handeled here. * The method callMemberStatusUpdated connects this class with SipCall and SipCallMember.* KCallWidget is the startpoint for originating calls.*/class KCallWidget : public QDialog{ Q_OBJECTpublic: KCallWidget( KSipAuthentication *auth, SessionControl *sessioncontrol, SipCall *initcall, CallAudio *au, QWidget *parent = 0, KPhoneView *Vater=0, KCallWidget * trfrom = 0, int wNr=0, const char *name = 0 ); ~KCallWidget( void ); SipCall *getCall(); /** * Prepare a new Call,activate Buttons, fill informal Text*/ void switchCall( SipCall *newcall ); /** * The remote Party*/ void setRemote( QString newremote ); /** * Someone pressed the dial button*/ void clickDial( void ); /** * Hangup Button pressed*/ void clickHangup( void ); /** * mark callwidget for deletion*/ void setHide( void ); /** * is callwidget marked for deletion*/ bool isHided( void ) const { return hided; } SipCall * getSipCall(void) const { return call;} SipCallMember * getSipCallMember(void) const {return member;} /** * manipulate myCS (holds the actual call state)*/ QString getCS (void) { return myCS; } /** * manipulate myCS (holds the actual call state)*/ // void setCS (QString in) { myCS=in; } void setCS (QString in);/** * manipulate myLT (holds the load type)*/ QString getLT (void) { return myLT; } /** * manipulate myLT (holds the load type)*/ void setLT (QString in); /** * manipulate myAS (holds the actual audio state and codec)*/ QString getAS (void) { return myAS; } /** * manipulate myAS (holds the actual audio state and codec)*/ void setAS (QString in);/** * manipulate myCon (holds the actual partner URI)*/ QString getCon (void) { return myCon;} /** * manipulate myCon (holds the actual partner URI)*/ void setCon (QString in) { myCon=in; } int myNumber; QString refnoti; public slots: /** * */ void pleaseDial( const SipUri &dialuri ); /** * hangup the call*/ void hangupCall( void ); /** * Control for the Call Hold feature* Depending on the Call Hold Flag the call is either put on* hold or retrieved*/ void holdCall( void );/*** show the Refer Dialog to ask for the new terminating leg*/ void showReferDialog( void );/*** show the Transfer Dialog to ask for the new terminating leg*/ void showTransferDialog( void );/*** show the Dialog to ask for the new terminating leg*/ void showDialog( void ); /*** show the Transfer Dialog to ask for the new terminating leg (short CT) void showShTransferDialog( void );*//*** toggle between audio and audio+video*/ void renegCodec (void);signals: /** * trigger REFER receptot to send state Notification to REFER source*/ void sigTrNotify( QString cause); void callDeleted( void ); /** * send signal to KPhoneView, to redirect a call */ void redirectCall( const SipUri &calluri, const QString &subject, int ct, KCallWidget *, int wNr ); /** * send signal to KPhoneView, used at the moment to create/change Call Info in the Active Call List*/ void informPhoneView( int info, int wNr);private slots: /** * determins the call type, Starts the outgoing call*/ void dialClicked( void ); /** * sets the remote start flag and calls dialClicked*/ void rdialClicked( void ); void audioOutputDead( void );/*** stops the ring timer and starts the call timer*/ void acceptCall( void );/*** used by holdCall*/ void doHold( void); /** * used by holdCall*/ void doRetrieve(void);/*** detrmines and starts the activity after SipCall/SipCallMember changed the CallState*/ void callMemberStatusUpdated( void ); /** * ask the user to accept a CF, and start it*/ void handleRedirect( void );/*** ask the user to accept a Refer, and start it*/ void handleRefer( void ); /** * evaluate the Refer new terminating leg* and start the new widget*/ void newSessionRefer( const QString &referto );/*** ???*/ void getUri( void ); /** * start/restart ring tone*/ void ringTimeout( void );/*** receive evaluate and answer the incoming Invite*/ void acceptCallTimeout( void );/*** hide the Callwidget and doom it to be to be cleared, if in predial state*/ void hideCall( void ); /*** avoid that Xten and friends mess up Call Hold*/ bool isForceHold(void) { return forceHold; }/*** avoid thar Xten and friends mess up Call Hold*/ void doForceHold(bool dh) { forceHold = dh; }/*** set load and audio state*/ void setLoadText(int load); protected slots: void keypadPressed( int id ); void keypadReleased( int id ); /** * to send state Notification to REFER source*/ void sendTrNotify( QString cause); /** * in case of outgoing audio calls sends a DTMF sequence when connected.*/ void sendDTMFSeq(void);private:/** forbide doPayload to start a new session. Used : 1. in case of a new INVITE without changes in the session description 2. if a CANCEL competes with INVITE*/ int debug; bool preventSessionStart; QString myCS; QString myLT; QString myAS; QString myCon; QTimer *notiTimer; QTimer *referTimer; QString dtmfStr; int dtmfSize; int referTime; int notiTime; bool doTransfer; void permFlags(void); QString dirFlag; QPtrList<IncomingCall> receivedCalls; QPtrList<IncomingCall> missedCalls; QPtrList<IncomingCall> dialledCalls; IncomingCall *incomingCall; void updateCallRegister( void ); void createKeypad(void); KPhoneView *papa; KCallWidget *referedFrom; int referedNr; bool forceHold; // Sip Stuff SipCall *call; SipCallMember *member; SdpBuild *sdpS; KSipAuthentication *sipauthentication; SessionControl *sessionC; // Audio Stuff CallAudio *audio; int ringCount; QTimer *ringTimer; int isRingingTone; QTimer *acceptCallTimer; int audio_fd; QString subject; //ExtMessageSocket *KWsocket; UDPMessageSocket *KWsocket; DspEarly *dspe; //session Stuff/*** Kill external Session*/ void detachFromCall( SipCall *lcall );/*** Prepare the commandline, fork and exec*/ void doPayload( int load ); // GUI Stuff QLabel *infostat; QLabel *curstat; QLabel *curload; QLabel *curaudiostat; QPushButton *dial; QPushButton *rstbutton; QPushButton *crnbutton; QPushButton *hangup; QPushButton *morebutton; QPushButton *hidebutton; QPushButton *transferbutton; QPushButton *referbutton;// QPushButton *sTransferbutton; QPushButton *holdbutton; QComboBox *remote; KReferDialog *referdialog; PhoneBook *phoneBook; bool hided; bool shortTransfer; QString referTo; QButtonGroup* keypad; static int isActiv; SipUri redirto; int redirTo; enum RedirHoldState { RdHoldNo, RdHoldPassive, RdHoldActive, RdHoldForward }; enum earlyAction { earlyNo, earlyCaller, earlyCalled, earlyMPO};typedef enum earlyAction eaT; eaT earlyMedia; // State stuff enum CallState { PreDial, Calling, Connected, Called, Releasing }; CallState curstate; QString thatsMe; QString thatsMyHost; // Private functions/*** Say by, mark own class for deletion and delete * SipCall and SipCallMember*/ void forceDisconnect( void ); QString getUserPrefix( void ); /** * reads the Identity string from theb DataBase and processes it*/ void MyIdentity(void); /*** are the two URIs logically the same*/ bool cmpUri ( QString uri1, QString uri2 ); /*** translates symbolic IP names to dot and compares them*/ bool cmpHostDot ( QString host1, QString host2 );/*** makes a socket reservation for external payload*/ void getExtSocket(int callt); int getStunPort(void);//ringingvoid stopRinging(void);int ringtonepid;};#endif // KCALLWIDGET_H_INCLUDED
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?