📄 callmanager.h
字号:
virtual void removeToneListener(const char* callId, int pListener); // Change the function name from getDtmfTone to enableDtmfEvent, to better // reflect what it does. // There are three functions used to process dtmf events for a client: // -- enableDtmfEvent: registers a dtmfEvent in CpCall (adding it to // CpCall's mDtmfEvents list, set 'enabled' flag to TRUE. When a dtmf // notification by MprRecoreder to the CpCall is recieved, CpCall // will signal it to this event. // -- disableDtmfEvent: temporarily remove the event from the CpCall's // mDtmfEvents list so that this client is not going to receive any // dtmf notification until enableDtmfEvent is called again. this // function does not delete the event object, it just sets the 'enabled' // flag to FALSE. // -- removeDtmfEvent: pernmanently remove the dtmf event object from // CpCall's mDtmfEvents list and delete the event object. virtual OsStatus enableDtmfEvent(const char* callId, int interDigitSecs, OsQueuedEvent* dtmfEvent, UtlBoolean ignoreKeyUp); virtual void disableDtmfEvent(const char* callId, int dtmfEvent); virtual void removeDtmfEvent(const char* callId, int dtmfEvent); virtual OsStatus ezRecord(const char* callId, int ms, int silenceLength, int& duration, const char* fileName, int& dtmfterm, OsProtectedEvent* recordEvent = NULL); virtual OsStatus setCodecCPULimitCall(const char* callId, int limit, UtlBoolean bRenegotiate) ; //:Sets the CPU codec limit for a call. Each connection within the call //:may only use a codec of the specified CPU intensity (or lesser). virtual OsStatus setInboundCodecCPULimit(int limit) ; //:Sets the inbound call CPU limit for codecs virtual OsStatus stopRecording(const char* callId); //: tells media system stop stop a curretn recording //: Set a media property on the media connection for the given call /* * @param callId - call id string for the conference or SIP dialog * @param remoteAddress - address on the remote leg of the connection on which to set property * @param propertyName string id for the property to set * @param propertyValue for the new value of the property */ virtual OsStatus setConnectionMediaProperty(const char* callId, const char* remoteAddress, const char* propertyName, const char* propertyValue); virtual void setMaxCalls(int maxCalls); //:Set the maximum number of calls to admit to the system. virtual void enableStun(const char* szStunServer, int iKeepAlivePeriodSecs, int stunOptions, OsNotification *pNotification = NULL) ; //:Enable STUN for NAT/Firewall traversal virtual void sendInfo(const char* callId, const char* szContentType, const size_t nContenLength, const char* szContent); //: Sends an INFO message to the other party(s) on the call/* ============================ ACCESSORS ================================= */ /** * Gets the number of lines made available by line manager. */ virtual int getNumLines(); /** * maxAddressesRequested is the number of addresses requested if available * numAddressesAvailable is the actual number of addresses available. * "addresses" is a pre-allocated array of size maxAddressesRequested */ virtual OsStatus getOutboundAddresses(int maxAddressesRequested, int& numAddressesAvailable, UtlString** addresses); virtual UtlBoolean getCallState(const char* callId, int& state); virtual UtlBoolean getConnectionState(const char* callId, const char* remoteAddress, int& state); virtual UtlBoolean getTermConnectionState(const char* callId, const char* address, const char* terminal, int& state); UtlBoolean getNextSipCseq(const char* callId, const char* remoteAddress, int& nextCseq); //:provides the next csequence number for a given call session (leg) if it exists. // Note: this does not protect against transaction void printCalls(); void setOutGoingCallType(int callType); int getTransferType(); virtual PtStatus validateAddress(UtlString& address); virtual void startCallStateLog(); virtual void stopCallStateLog(); virtual void setCallStateLogAutoWrite(UtlBoolean); virtual void clearCallStateLog(); virtual void logCallState(const char* message, const char* eventId, const char* cause); // Get the contents of the call state log. virtual void getCallStateLog(UtlString& logData); // Get the contents of the call state log and clear it. // (Avoids the race condition of calling getCallStateLog then // clearCallStateLog.) virtual void getAndClearCallStateLog(UtlString& logData); // Flush the CallStateLog in the same way that auto-writing does // (by writing it to the log file). virtual void flushCallStateLogAutoWrite(); // Soon to be removed: virtual OsStatus getFromField(const char* callId, const char* remoteAddress, UtlString& fromField); virtual OsStatus getToField(const char* callId, const char* remoteAddress, UtlString& toField); virtual OsStatus getCodecCPUCostCall(const char* callId, int& cost); //:Gets the CPU cost for an individual connection within the specified //:call. virtual OsStatus getCodecCPULimitCall(const char* callId, int& cost); //:Gets the CPU cost for an individual connection within the specified //:call. // It is assumed that each connection is at worst this level; however, // may actually use less resources. virtual void getCalls(int& currentCalls, int& maxCalls); //:Get the current number of calls in the system and the maximum number of //:calls to be admitted to the system. virtual OsStatus getLocalContactAddresses(const char* callid, CONTACT_ADDRESS addresses[], size_t nMaxAddresses, size_t& nActaulAddresses) ; //:The available local contact addresses virtual CpMediaInterfaceFactory* getMediaInterfaceFactory() ; //: Gets the media interface factory used by the call manager virtual int getMediaConnectionId(const char* szCallId, const char* remoteAddress, void** ppInstData = NULL); //: Gets the Media Connection ID //: @param szCallId The call-id string of the call with which the connection id is associated //: @param remoteAddress The remote address of the call's connection, with which the connection id is associated //: @param ppInstData Reserved for future use. virtual UtlBoolean canAddConnection(const char* szCallId); //: Can a new connection be added to the specified call? This method is //: delegated to the media interface. virtual void setDelayInDeleteCall(int delayInDeleteCall); //: Set the number of seconds to delay in deleting the call virtual int getDelayInDeleteCall(); //: Get the number of seconds to delay in deleting the call /* ============================ INQUIRY =================================== */ int getTotalNumberOutgoingCalls() { return mnTotalOutgoingCalls;} int getTotalNumberIncomingCalls() { return mnTotalIncomingCalls;} SipUserAgent* getUserAgent() { return sipUserAgent;}/* //////////////////////////// PROTECTED ///////////////////////////////// */protected: TaoListenerDb** mpListeners; int mListenerCnt; int mMaxNumListeners; void addTaoListenerToCall(CpCall* pCall);#if 0 // TO_BE_REMOVED void postTaoListenerMessage(int eventId, int type, int cause, CpMultiStringMessage* pEventMessage);#endif OsStatus addThisListener(OsServerTask* pListener, char* callId, int mask);/* //////////////////////////// PRIVATE /////////////////////////////////// */private: UtlString mOutboundLine; UtlBoolean dialing; UtlBoolean mOffHook; UtlBoolean speakerOn; UtlBoolean flashPending; SipUserAgent* sipUserAgent; int mSipSessionReinviteTimer; CpCall* infocusCall; UtlSList callStack; UtlString mDialString; int mOutGoingCallType; int mNumDialPlanDigits; int mHoldType; SdpCodecFactory* mpCodecFactory; int mTransferType; UtlString mLocale; int mMessageEventCount; int mnTotalIncomingCalls; int mnTotalOutgoingCalls; int mExpeditedIpTos; UtlString mCallManagerHistory[CP_CALL_HISTORY_LENGTH]; UtlBoolean mIsEarlyMediaFor180; SipLineMgr* mpLineMgrTask; //Line manager UtlBoolean mIsRequredUserIdMatch; // mMaxCalls can be changed by code running in other threads. volatile int mMaxCalls; UtlString mStunServer ; int mStunOptions ; int mStunKeepAlivePeriodSecs ; CpMediaInterfaceFactory* mpMediaFactory; // Delay in deleting the call int mDelayInDeleteCall; // Private accessors void pushCall(CpCall* call); CpCall* popCall(); CpCall* removeCall(CpCall* call); int getCallStackSize(); UtlBoolean changeCallFocus(CpCall* callToTakeFocus); CpCall* findHandlingCall(const char* callId); CpCall* findHandlingCall(int callIndex); CpCall* findHandlingCall(const OsMsg& eventMessage); CpCall* findFirstQueuedCall(); void getCodecs(int& numCodecs, SdpCodec**& codecArray); void addHistoryEvent(const char* messageLogString); void doHold(); void doCreateCall(const char* callId, int metaEventId = 0, int metaEventType = PtEvent::META_EVENT_NONE, int numMetaEventCalls = 0, const char* metaEventCallIds[] = NULL, UtlBoolean assumeFocusIfNoInfocusCall = TRUE); void doConnect(const char* callId, const char* addressUrl, const char* szDesiredConnectionCallId, CONTACT_ID contactId = 0, const void* pDisplay = NULL) ; void doSendInfo(const char* callId, const char* szContentType, UtlString sContent); //:Called by the handleMessage method, this method posts a message to the Call object's //:message handler, passing along the content type and content. void doEnableStun(const char* szStunServer, int iKeepAlivePeriodSecs, int stunOptions, OsNotification* pNotification) ; //:Enable STUN for NAT/Firewall traversal void releaseEvent(const char* callId, OsProtectEventMgr* eventMgr, OsProtectedEvent* dtmfEvent); CallManager(const CallManager& rCallManager); //:Copy constructor (disabled) CallManager& operator=(const CallManager& rhs); //:Assignment operator (disabled)};/* ============================ INLINE METHODS ============================ */#endif // _CallManager_h_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -