15 #ifndef _CpCallManager_h_ 16 #define _CpCallManager_h_ 22 #include <os/OsServerTask.h> 23 #include <os/OsRWMutex.h> 24 #include "os/OsProtectEvent.h" 25 #include "os/OsQueuedEvent.h" 29 #include "net/SipMessage.h" 30 #include "net/SipContactDb.h" 31 #include "net/SipDialog.h" 44 class CpMediaInterface;
48 class MpStreamPlaylistPlayer;
102 #ifndef DOXYGEN_SHOULD_SKIP_THIS 213 #endif // DOXYGEN_SHOULD_SKIP_THIS 240 const char* callIdPrefix,
241 int rtpPortStart = 8766,
243 const char* localAddress = NULL,
244 const char* publicAddress = NULL,
245 int internalSamplerate = 8000);
254 UtlString& typeString);
275 static void getNewCallId(
const char* callIdPrefix, UtlString* callId);
293 int numMetaEventCalls = 0,
294 const char* callIds[] = NULL,
295 UtlBoolean assumeFocusIfNoInfocusCall = TRUE) = 0;
305 virtual OsStatus
getCalls(
int maxCalls,
int& numCalls,
306 UtlString callIds[]) = 0;
313 const char* toAddress,
314 const char* fromAddress = NULL,
315 const char* desiredConnectionCallId = NULL,
317 const void* pDisplay = NULL,
318 const void* pSecurity = NULL,
319 const char* locationHeader = NULL,
322 const RTP_TRANSPORT rtpTransportOptions = RTP_TRANSPORT_UDP) = 0;
329 const char* activeOriginalCallId,
330 const char* originalCallControllerAddress,
331 const char* originalCallControllerTerminalId,
332 const char* consultAddressUrl,
333 UtlString& targetCallControllerAddress,
334 UtlString& targetCallConsultAddress) = 0;
338 const char* transferToUrl,
339 UtlString* targetCallId,
340 UtlString* targetConnectionAddress = NULL) = 0;
351 const char* originalCallId) = 0;
354 virtual void drop(
const char* callId) = 0;
357 virtual void toneStart(
const char* callId,
360 UtlBoolean remote) = 0;
363 virtual void toneStop(
const char* callId) = 0;
367 const char* szRemoteAddress,
370 UtlBoolean remote) = 0;
374 const char* szRemoteAddress) = 0;
380 virtual void audioPlay(
const char* callId,
381 const char* audioUrl,
385 UtlBoolean mixWithMic =
false,
386 int downScaling = 100) = 0;
392 const char* szRemoteAddress) = 0;
399 const char* szRemoteAddress,
400 const char* audioUrl,
404 UtlBoolean mixWithMic =
false,
405 int downScaling = 100) = 0;
410 virtual void audioStop(
const char* callId) = 0;
416 const void* audiobuf,
421 UtlBoolean remote) = 0;
431 MpStreamPlaylistPlayer** ppPlayer) = 0 ;
454 const char* szStream,
456 MpStreamPlayer** ppPlayer) = 0 ;
460 MpStreamPlaylistPlayer* pPlayer) = 0 ;
466 MpStreamPlayer* pPlayer) = 0 ;
476 UtlBoolean bRenegotiate) = 0 ;
482 virtual OsStatus
setMicGain(
const char* callId,
float gain) = 0;
494 const void* hWnd = NULL,
495 const void* security = NULL,
496 const char* locationHeader = NULL,
498 UtlBoolean sendEarlyMedia = FALSE) = 0;
513 const char* errorText =
"") = 0;
523 const char* forwardAddressUrl) = 0;
531 const char* address) = 0;
535 int& numConnections) = 0;
542 UtlString addresses[]) = 0;
549 UtlString addresses[]) = 0;
556 UtlString addresses[]) = 0;
573 const char* terminalId,
574 const void* pDisplay = NULL,
575 const void* pSecurity = NULL) = 0;
584 const char* terminalId) = 0;
606 const char* addresss,
607 const char* terminalId) = 0;
612 const char* remoteAddr,
613 const char* codecNames) = 0;
618 const char* remoteAddr,
619 const int audioBandwidth,
620 const int videoBandwidth,
621 const char* szVideoCodecName) = 0;
629 const char* addresss,
630 const char* terminalId) = 0;
639 int& numTerminalConnections) = 0;
644 int maxTerminalConnections,
645 int& numTerminalConnections,
646 UtlString terminalNames[]) = 0;
651 const char* terminalId) = 0;
655 virtual OsStatus
getSession(
const char* callId,
657 SipSession& session) = 0;
662 SipDialog& dialog) = 0;
665 #ifndef DOXYGEN_SHOULD_SKIP_THIS 669 virtual void unhold(
const char* callId) = 0;
675 #endif // DOXYGEN_SHOULD_SKIP_THIS 690 const char* addressUrl) = 0;
695 virtual void enableIce(UtlBoolean bEnable) ;
697 const char* remoteAddress,
698 UtlString& userAgent) = 0;
719 int& numAddressesAvailable, UtlString** addresses) = 0;
732 const char* remoteAddress,
743 const char* terminal,
750 const char* remoteAddress,
751 UtlString& fromField) = 0;
754 virtual OsStatus
getToField(
const char* callId,
755 const char* remoteAddress,
756 UtlString& toField) = 0;
794 #ifndef DOXYGEN_SHOULD_SKIP_THIS 858 #endif // DOXYGEN_SHOULD_SKIP_THIS 864 #endif // _CpCallManager_h_ Abstract call manager.
Definition: CpCallManager.h:97
static OsMutex mCallNumMutex
Definition: CpCallManager.h:814
Definition: CpCallManager.h:122
virtual void holdAllTerminalConnections(const char *callId)=0
Convenience method to put all of the terminal connections in the specified call on hold...
PtStatus
Definition: PtDefs.h:49
Definition: CpCallManager.h:206
virtual UtlBoolean disconnectConnection(const char *callId, const char *addressUrl)=0
Definition: CpCallManager.h:161
virtual OsStatus getConnections(const char *callId, int maxConnections, int &numConnections, UtlString addresses[])=0
Query the list of addresses or handles for the connections in the specified call. ...
Definition: CpCallManager.h:123
Definition: CpCallManager.h:195
Definition: CpCallManager.h:232
Definition: CpCallManager.h:141
Definition: CpCallManager.h:120
virtual OsStatus getCallingAddresses(const char *callId, int maxConnections, int &numConnections, UtlString addresses[])=0
Query the list of addresses or handles for the connections in the specified call that were set up as ...
virtual UtlBoolean handleMessage(OsMsg &eventMessage)=0
For internal use only.
virtual void holdTerminalConnection(const char *callId, const char *address, const char *terminalId)=0
Put the specified terminal connection on hold.
virtual UtlBoolean getTermConnectionState(const char *callId, const char *address, const char *terminal, int &state)=0
Get the terminal connection state for the specified terminal connection.
Definition: CpCallManager.h:230
Definition: CpCallManager.h:109
Definition: CpCallManager.h:152
virtual PtStatus redirectConnection(const char *callId, const char *address, const char *forwardAddressUrl)=0
Redirect the incoming connection.
virtual void createCall(UtlString *callId, int metaEventId=0, int metaEventType=PtEvent::META_EVENT_NONE, int numMetaEventCalls=0, const char *callIds[]=NULL, UtlBoolean assumeFocusIfNoInfocusCall=TRUE)=0
Creates a new call with an implicit local connection.
Definition: CpCallManager.h:139
virtual CpCall * findCall(const char *callId)
Definition: CpCallManager.cpp:517
Definition: CpCallManager.h:110
Definition: CpCallManager.h:171
Definition: CpCallManager.h:197
virtual void toneChannelStart(const char *callId, const char *szRemoteAddress, int toneId, UtlBoolean local, UtlBoolean remote)=0
Direct the media subsystem to begin playing a DTMF or progress tone.
CpCallManager & operator=(const CpCallManager &rhs)
Assignment operator.
Definition: CpCallManager.cpp:366
Definition: CpCallManager.h:202
virtual void answerTerminalConnection(const char *callId, const char *address, const char *terminalId, const void *pDisplay=NULL, const void *pSecurity=NULL)=0
Answer the incoming terminal connection.
virtual void setOutboundLine(const char *lineUrl)=0
Set the default address for the local connection.
virtual void unhold(const char *callId)=0
Deprecated, use holdAllTerminalConnections.
Definition: CpCallManager.h:106
virtual void renegotiateCodecsAllTerminalConnections(const char *callId)=0
Convenience method to renegotiate the codecs for all of the terminal connections in the specified cal...
Definition: CpCallManager.h:145
virtual void doGetFocus(CpCall *call)=0
Definition: CpCallManager.h:217
virtual void setOutboundLineForCall(const char *callId, const char *address, SIPX_CONTACT_TYPE eType=CONTACT_AUTO)=0
virtual OsStatus setMicGain(const char *callId, float gain)=0
Sets the Mic gain.
CpStatus
Definition: CpCallManager.h:227
Definition: CpCallManager.h:224
Definition: CpCallManager.h:174
Definition: CpCallManager.h:178
Definition: CpCallManager.h:154
Definition: CpCallManager.h:180
Definition: CpCallManager.h:132
virtual void getLocalAddress(UtlString &address)
Get the configured local address.
Definition: CpCallManager.cpp:607
Definition: CpCallManager.h:194
virtual OsStatus getCodecCPUCostCall(const char *callId, int &cost)=0
Gets the CPU cost for an individual connection within the specified call.
Definition: CpCallManager.h:166
virtual void holdLocalTerminalConnection(const char *callId)=0
Convenience method to put the local terminal connection on hold.
Definition: CpCallManager.h:163
Definition: CpCallManager.h:172
Definition: CpCallManager.h:113
Definition: CpCallManager.h:118
void getNewSessionId(UtlString *sessionId)
For internal use only.
Definition: CpCallManager.cpp:384
Definition: CpCallManager.h:146
virtual void acceptConnection(const char *callId, const char *address, SIPX_CONTACT_ID contactId=0, const void *hWnd=NULL, const void *security=NULL, const char *locationHeader=NULL, const int bandWidth=AUDIO_CODEC_BW_DEFAULT, UtlBoolean sendEarlyMedia=FALSE)=0
Accept the incoming connection.
Definition: CpCallManager.h:196
Definition: CpCallManager.h:127
virtual void getNewCallId(UtlString *callId)
For internal use only.
Definition: CpCallManager.cpp:379
Definition: CpCallManager.h:223
virtual void audioStop(const char *callId)=0
Deprecated, use the player controls.
Definition: CpCallManager.h:140
static const int CALLMANAGER_MAX_REQUEST_MSGS
Maximum number of request messages.
Definition: CpCallManager.h:841
Definition: CpCallManager.h:126
int aquireCallIndex()
Definition: CpCallManager.cpp:618
Definition: CpCallManager.h:193
virtual void drop(const char *callId)=0
Drop this call and disconnect all connections associated with it.
virtual void pushCall(CpCall *call)
Definition: CpCallManager.cpp:545
Definition: CpCallManager.h:158
virtual OsStatus getCalledAddresses(const char *callId, int maxConnections, int &numConnections, UtlString addresses[])=0
Query the list of addresses or handles for the connections in the specified call that were set up as ...
Definition: CpCallManager.h:137
Definition: CpCallManager.h:209
Definition: CpCallManager.h:181
Definition: CpCallManager.h:156
virtual void destroyPlayer(const char *callid, MpStreamPlaylistPlayer *pPlayer)=0
Destroy the media player associated with a call.
virtual void renegotiateCodecsTerminalConnection(const char *callId, const char *addresss, const char *terminalId)=0
Renegotiate the codecs to be use for the sepcified terminal connection.
virtual OsStatus getTerminalConnections(const char *callId, const char *address, int maxTerminalConnections, int &numTerminalConnections, UtlString terminalNames[])=0
Get the list of terminal connection identifiers for the specified call.
virtual void toneStop(const char *callId)=0
Direct the media subsystem to stop playing a DTMF or progress tone.
virtual PtStatus transfer(const char *targetCallId, const char *originalCallId)=0
Consultative transfer.
Definition: CpCallManager.h:167
Definition: CpCallManager.h:208
Definition: CpCallManager.h:218
Definition: CpCallManager.h:184
int SIPX_CONTACT_ID
Type for storing Contact Record identifiers.
Definition: sipXtapi.h:632
int mRtpPortEnd
Definition: CpCallManager.h:819
Definition: CpCallManager.h:205
Definition: CpCallManager.h:201
virtual void yieldFocus(CpCall *call)=0
virtual void unholdTerminalConnection(const char *callId, const char *addresss, const char *terminalId)=0
Convenience method to take the local terminal connection off hold.
Definition: CpCallManager.h:130
virtual PtStatus transfer_blind(const char *callId, const char *transferToUrl, UtlString *targetCallId, UtlString *targetConnectionAddress=NULL)=0
Blind transfer.
OsMutex mManagerMutex
Definition: CpCallManager.h:811
Definition: CpCallManager.h:133
int mNoAnswerTimeout
Definition: CpCallManager.h:827
virtual void toneChannelStop(const char *callId, const char *szRemoteAddress)=0
Direct the media subsystem to stop playing a DTMF or progress tone.
virtual void dropConnection(const char *callId, const char *address)=0
Drop the specifed connection.
Definition: CpCallManager.h:185
Definition: CpCallManager.h:187
int getNewMetaEventId()
For internal use only.
Definition: CpCallManager.cpp:582
Definition: CpCallManager.h:190
Definition: CpCallManager.h:157
Definition: CpCallManager.h:173
virtual void audioChannelPlay(const char *callId, const char *szRemoteAddress, const char *audioUrl, UtlBoolean repeat, UtlBoolean local, UtlBoolean remote, UtlBoolean mixWithMic=false, int downScaling=100)=0
Deprecated, use the player controls.
virtual OsStatus getSipDialog(const char *callId, const char *address, SipDialog &dialog)=0
Get the SIP dialog information for the specified terminal connection.
Definition: CpCallManager.h:142
Definition: CpCallManager.h:162
Definition: CpCallManager.h:135
virtual void limitCodecPreferences(const char *callId, const char *remoteAddr, const int audioBandwidth, const int videoBandwidth, const char *szVideoCodecName)=0
Rebuild codec factory on the fly with new audio codec requirements and one specific video codec...
SIPX_CONTACT_TYPE
SIPX_CONTACT_TYPE is an enumeration of possible address types for use with SIP contacts and SDP conne...
Definition: sipXtapi.h:524
Definition: CpCallManager.h:211
virtual OsStatus getCalls(int maxCalls, int &numCalls, UtlString callIds[])=0
Gets the list of names or identifiers for all of the existing calls.
static int64_t mCallNum
Definition: CpCallManager.h:856
Definition: CpCallManager.h:159
Automatic contact selection; used for API parameters.
Definition: sipXtapi.h:531
virtual void unholdLocalTerminalConnection(const char *callId)=0
Take the specified terminal connection off hold,.
Definition: CpCallManager.h:160
virtual void setMessageWaiting(int flag)
msg waiting flag
Definition: CpCallManager.cpp:558
virtual void appendCall(CpCall *call)
Definition: CpCallManager.cpp:538
UtlString mForwardOnNoAnswer
Definition: CpCallManager.h:828
Definition: CpCallManager.h:155
Definition: CpCallManager.h:170
Definition: CpCallManager.h:149
virtual void audioPlay(const char *callId, const char *audioUrl, UtlBoolean repeat, UtlBoolean local, UtlBoolean remote, UtlBoolean mixWithMic=false, int downScaling=100)=0
Deprecated, use the player controls.
UtlDList mCallList
Definition: CpCallManager.h:850
int mMsgWaitingFlag
Definition: CpCallManager.h:831
Definition: CpCallManager.h:169
int mOfferedTimeOut
Definition: CpCallManager.h:832
Definition: CpCallManager.h:129
virtual UtlBoolean getVoiceQualityReportTarget(UtlString &reportSipUrl)
Get the target sip url for voice quality reports.
Definition: CpCallManager.cpp:594
Definition: CpCallManager.h:143
UtlString mCallIdPrefix
Definition: CpCallManager.h:849
Definition: CpCallManager.h:199
Definition: CpCallManager.h:150
virtual void dialString(const char *url)=0
Deprecated, use connect.
void releaseCallIndex(int callIndex)
Definition: CpCallManager.cpp:639
virtual OsStatus setCodecCPULimitCall(const char *callId, int limit, UtlBoolean bRenegotiate)=0
Sets the CPU codec limit for a call.
Definition: CpCallManager.h:147
Definition: CpCallManager.h:200
Definition: CpCallManager.h:204
Definition: CpCallManager.h:189
Definition: CpCallManager.h:125
virtual void enableIce(UtlBoolean bEnable)
Definition: CpCallManager.cpp:568
Definition: CpCallManager.h:148
Definition: CpCallManager.h:136
EventSubTypes
Definition: CpCallManager.h:104
Definition: CpCallManager.h:198
Definition: CpCallManager.h:183
virtual void setDoNotDisturb(int flag)
do-not-disturb flag
Definition: CpCallManager.cpp:553
virtual void createPlayer(const char *callid, MpStreamPlaylistPlayer **ppPlayer)=0
Create a MpStreamPlaylistPlayer media player associated with.
UtlString mForwardUnconditional
Definition: CpCallManager.h:822
Definition: CpCallManager.h:231
Definition: CpCallManager.h:138
Definition: CpCallManager.h:191
CpCallManager(const char *taskName, const char *callIdPrefix, int rtpPortStart=8766, int rtpPortEnd=-1, const char *localAddress=NULL, const char *publicAddress=NULL, int internalSamplerate=8000)
Default constructor.
Definition: CpCallManager.cpp:48
Definition: CpCallManager.h:124
virtual UtlBoolean isIceEnabled() const
Definition: CpCallManager.cpp:588
virtual OsStatus setInboundCodecCPULimit(int limit)=0
Set the call codec CPU limit for inbound connections in a call.
virtual void setTransferType(int type)=0
Deprecated.
virtual UtlBoolean isTerminalConnectionLocal(const char *callId, const char *address, const char *terminalId)=0
Query whether the specified terminal connection is a local or remote connection.
Definition: CpCallManager.h:117
virtual ~CpCallManager()
Destructor.
Definition: CpCallManager.cpp:111
Definition: CpCallManager.h:114
virtual void limitCodecs(const char *callId, const char *remoteAddr, const char *codecNames)=0
Further limit the set of codecs to use for the call to the given set of codecs The codecs named...
Definition: CpCallManager.h:165
Definition: CpCallManager.h:115
Definition: CpCallManager.h:233
Definition: sipXtapiInternal.h:288
Definition: CpCallManager.h:116
virtual OsStatus getFromField(const char *callId, const char *remoteAddress, UtlString &fromField)=0
Deprecated, use getSession.
virtual UtlBoolean getConnectionState(const char *callId, const char *remoteAddress, int &state)=0
Get the connection state for the specified connection.
Definition: CpCallManager.h:192
Definition: CpCallManager.h:186
Definition: CpCallManager.h:188
Definition: CpCallManager.h:182
int mDoNotDisturbFlag
Definition: CpCallManager.h:830
virtual UtlBoolean getCallState(const char *callId, int &state)=0
Get the state of the identified call.
int mInviteExpireSeconds
Definition: CpCallManager.h:833
int mLineAvailableBehavior
Definition: CpCallManager.h:821
Definition: CpCallManager.h:164
virtual OsStatus getOutboundAddresses(int maxAddressesRequested, int &numAddressesAvailable, UtlString **addresses)=0
maxAddressesRequested is the number of addresses requested if available numAddressesAvailable is the ...
virtual void getNumConnections(const char *callId, int &numConnections)=0
Query the number of connections in the specified call.
virtual void toneStart(const char *callId, int toneId, UtlBoolean local, UtlBoolean remote)=0
Direct the media subsystem to begin playing a DTMF or progress tone.
virtual void unholdAllTerminalConnections(const char *callId)=0
Convenience method to take all of the terminal connections in the specified call off hold...
CallTypes
Definition: CpCallManager.h:215
Definition: CpCallManager.h:108
virtual void getNumTerminalConnections(const char *callId, const char *address, int &numTerminalConnections)=0
Query the number of terminal connections in the specified call.
Definition: CpCallManager.h:111
int mDefaultSampleRate
for flowgraph creation
Definition: CpCallManager.h:836
CallHoldType
Definition: CpCallManager.h:221
virtual void setVoiceQualityReportTarget(const char *szTargetSipUrl)
Set the target sip url for voice quality reports.
Definition: CpCallManager.cpp:574
Definition: CpCallManager.h:179
int mLineBusyBehavior
Definition: CpCallManager.h:824
Definition: CpCallManager.h:177
virtual PtStatus consult(const char *idleTargetCallId, const char *activeOriginalCallId, const char *originalCallControllerAddress, const char *originalCallControllerTerminalId, const char *consultAddressUrl, UtlString &targetCallControllerAddress, UtlString &targetCallConsultAddress)=0
Create a new call and associate it with an existing call.
Definition: CpCallManager.h:112
Definition: CpCallManager.h:207
virtual OsStatus getCodecCPULimitCall(const char *callId, int &cost)=0
Gets the CPU cost for an individual connection within the specified call.
Definition: CpCallManager.h:176
int mRtpPortStart
Definition: CpCallManager.h:818
Definition: CpCallManager.h:128
virtual OsStatus getToField(const char *callId, const char *remoteAddress, UtlString &toField)=0
Deprecated, use getSession.
Definition: CpCallManager.h:151
virtual void rejectConnection(const char *callId, const char *address, int errorCode=0, const char *errorText="")=0
Reject the incoming connection.
Definition: CpCallManager.h:134
Definition: CpCallManager.h:210
Definition: CpCallManager.h:131
virtual OsStatus getSession(const char *callId, const char *address, SipSession &session)=0
Get the SIP session information for the specified terminal connection.
UtlString mPublicAddress
Definition: CpCallManager.h:817
Definition: CpCallManager.h:229
Definition: CpCallManager.h:153
Value used to signify the default bandwidth level when calling sipxCallConnect, sipxCallAccept, or sipxConferenceAdd.
Definition: sipXtapi.h:203
Definition: CpCallManager.h:175
Definition: CpCallManager.h:168
UtlString mLocalAddress
Definition: CpCallManager.h:816
virtual void setOfferedTimeout(int millisec)
offered time-out for all incoming calls
Definition: CpCallManager.cpp:563
UtlBoolean mbEnableICE
Definition: CpCallManager.h:852
virtual PtStatus connect(const char *callId, const char *toAddress, const char *fromAddress=NULL, const char *desiredConnectionCallId=NULL, SIPX_CONTACT_ID contactId=0, const void *pDisplay=NULL, const void *pSecurity=NULL, const char *locationHeader=NULL, const int bandWidth=AUDIO_CODEC_BW_DEFAULT, SIPX_TRANSPORT_DATA *pTransportData=NULL, const RTP_TRANSPORT rtpTransportOptions=RTP_TRANSPORT_UDP)=0
Initiates a new outbound connection to the specified address.
Definition: CpCallManager.h:107
OsRWMutex mCallListMutex
Definition: CpCallManager.h:812
UtlString mVoiceQualityReportTarget
Definition: CpCallManager.h:853
virtual PtStatus validateAddress(UtlString &address)=0
Definition: CpCallManager.h:203
static void getEventSubTypeString(EventSubTypes type, UtlString &typeString)
Definition: CpCallManager.cpp:117
virtual void getRemoteUserAgent(const char *callId, const char *remoteAddress, UtlString &userAgent)=0
Definition: PtEvent.h:346
virtual void bufferPlay(const char *callId, const void *audiobuf, int bufSize, int type, UtlBoolean repeat, UtlBoolean local, UtlBoolean remote)=0
Deprecated, use the player controls.
Definition: CpCallManager.h:121
virtual void onCallDestroy(CpCall *pCall)=0
UtlString mSipForwardOnBusy
Definition: CpCallManager.h:825
Definition: CpCallManager.h:144
Definition: CpCallManager.h:119
virtual void audioChannelStop(const char *callId, const char *szRemoteAddress)=0
Deprecated, use the player controls.
int mLastMetaEventId
Definition: CpCallManager.h:851
UtlHashBag mCallIndices
Definition: CpCallManager.h:815
virtual int getNumLines()=0
Gets the number of lines made available by line manager.