sipXcallLib home page


CallManager.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2005-2021 SIPez LLC. All rights reserved.
3 //
4 // Copyright (C) 2004-2007 SIPfoundry Inc.
5 // Licensed by SIPfoundry under the LGPL license.
6 //
7 // Copyright (C) 2004-2006 Pingtel Corp. All rights reserved.
8 // Licensed to SIPfoundry under a Contributor Agreement.
9 //
10 // $$
12 
13 // Author: Daniel Petrie dpetrie AT SIPez DOT com
14 
15 #ifndef _CallManager_h_
16 #define _CallManager_h_
17 
18 // SYSTEM INCLUDES
19 //#include <...>
20 
21 // APPLICATION INCLUDES
22 #include <os/OsMsgDispatcher.h>
23 #include <cp/CpCallManager.h>
24 #include <cp/Connection.h>
25 #include <mi/CpMediaInterfaceFactoryImpl.h>
26 #include <net/QoS.h>
27 
28 #include <tao/TaoObjectMap.h>
29 #include <os/OsProtectEventMgr.h>
30 #include <tapi/sipXtapiInternal.h>
31 
32 // DEFINES
33 // Much larger value needed when running under Valgrind on an embedded dev board:
34 // #define LONG_EVENT_RESPONSE_TIMEOUTS
35 #ifdef LONG_EVENT_RESPONSE_TIMEOUTS
36 # define CP_MAX_EVENT_WAIT_SECONDS 2592000 // 30 days in seconds
37 #else
38 # define CP_MAX_EVENT_WAIT_SECONDS 30 // time out, seconds
39 #endif
40 
41 #define CP_CALL_HISTORY_LENGTH 50
42 
43 #define CP_MAXIMUM_RINGING_EXPIRE_SECONDS 180
44 // MACROS
45 // EXTERNAL FUNCTIONS
46 // EXTERNAL VARIABLES
47 // CONSTANTS
48 // STRUCTS
49 // TYPEDEFS
50 
51 
52 // FORWARD DECLARATIONS
53 class SdpCodec;
54 class CpCall;
55 class SipUserAgent;
56 class OsConfigDb;
57 class PtMGCP;
58 class TaoObjectMap;
59 class TaoReference;
60 class SdpCodecList;
62 class SipSession;
63 class SipDialog;
64 class SipLineMgr;
65 class CpMediaInterfaceFactory;
66 
67 //:Class short description which may consist of multiple lines (note the ':')
68 // Class detailed description which may extend to multiple lines
69 class CallManager : public CpCallManager
70 {
71 /* //////////////////////////// PUBLIC //////////////////////////////////// */
72 public:
73 
74 /* ============================ CREATORS ================================== */
75 
76  CallManager(UtlBoolean isRequiredUserIdMatch,
77  SipLineMgr* lineMgrTask,
78  UtlBoolean isEarlyMediaFor180Enabled,
79  SdpCodecList* pCodecFactory,
80  int rtpPortStart,
81  int rtpPortEnd,
82  const char* localAddress,
83  const char* publicAddress,
84  SipUserAgent* userAgent,
85  int sipSessionReinviteTimer, // Suggested value: 0
86  PtMGCP* mgcpStackTask, // Suggested value: NULL
87  const char* defaultCallExtension, // Suggested value: NULL
88  int availableBehavior, // Suggested value: Connection::RING
89  const char* unconditionalForwardUrl, // Suggested value: NULL
90  int forwardOnNoAnswerSeconds, // Suggested value: -1
91  const char* forwardOnNoAnswerUrl, // Suggested value: NULL
92  int busyBehavior, // Suggested value: Connection::BUSY
93  const char* sipForwardOnBusyUrl, // Suggested value: NULL
94  OsConfigDb* speedNums, // Suggested value: NULL
95  CallTypes phonesetOutgoingCallProtocol, // Suggested value: CallManager::SIP_CALL
96  int numDialPlanDigits, // Suggested value: 4
97  int holdType, // Suggested value: CallManager::NEAR_END_HOLD
98  int offeringDelay, // Suggested value: Connection::IMMEDIATE
99  const char* pLocal, // Suggested value: ""
100  int inviteExpireSeconds, // Suggested value: CP_MAXIMUM_RINGING_EXPIRE_SECONDS
101  int expeditedIpTos, // Suggested value: QOS_LAYER3_LOW_DELAY_IP_TOS
102  int maxCalls, // Suggested value: 10
103  CpMediaInterfaceFactory* pMediaFactory, // Suggested value: NULL
104  int internalSamplerate); // Suggested value: 8000, 16000 or 32000
105 
106  virtual
107  ~CallManager();
108  //:Destructor
109 
110 /* ============================ MANIPULATORS ============================== */
111 
112  virtual UtlBoolean handleMessage(OsMsg& eventMessage);
113 
114  virtual void requestShutdown(void);
115 
116  virtual void setOutboundLine(const char* lineUrl);
117  virtual void setOutboundLineForCall(const char* callId, const char* address, SIPX_CONTACT_TYPE eType = CONTACT_AUTO);
118 
119  // Operations for calls
120  virtual void createCall(UtlString* callId,
121  int metaEventId = 0,
122  int metaEventType = PtEvent::META_EVENT_NONE,
123  int numMetaEventCalls = 0,
124  const char* metaEventCallIds[] = NULL,
125  UtlBoolean assumeFocusIfNoInfocusCall = TRUE);
126  virtual OsStatus getCalls(int maxCalls, int& numCalls, UtlString callIds[]);
127 
128  virtual PtStatus connect(const char* callId,
129  const char* toAddress,
130  const char* fromAddress = NULL,
131  const char* desiredConnectionCallId = NULL,
132  SIPX_CONTACT_ID contactId = 0,
133  const void* pDisplay = NULL,
134  const void* pSecurity = NULL,
135  const char* locationHeader = NULL,
136  const int bandWidth=AUDIO_CODEC_BW_DEFAULT,
137  SIPX_TRANSPORT_DATA* pTransportData = NULL,
138  const RTP_TRANSPORT rtpTransportOptions = RTP_TRANSPORT_UDP) ;
139 
140  virtual PtStatus consult(const char* idleTargetCallId,
141  const char* activeOriginalCallId, const char* originalCallControllerAddress,
142  const char* originalCallControllerTerminalId, const char* consultAddressUrl,
143  UtlString& targetCallControllerAddress, UtlString& targetCallConsultAddress);
144  virtual void drop(const char* callId);
145  virtual PtStatus transfer_blind(const char* callId, const char* transferToUrl,
146  UtlString* targetCallId,
147  UtlString* targetConnectionAddress = NULL);
148  // Blind transfer
149 
150  virtual PtStatus transfer(const char* targetCallId, const char* originalCallId);
151  // Consultative transfer
152  // The couple targetCallId & targetConnectionAddress return/define
153  // the transfer target connection in the resulting new transfer
154  // target call
155 
156  PtStatus transfer(const char* sourceCallId,
157  const char* sourceAddress,
158  const char* targetCallId,
159  const char* targetAddress) ;
160  //: Transfer an individual participant from one end point to another using
161  //: REFER w/replaces.
162 
163 
164  virtual PtStatus split(const char* szSourceCallId,
165  const char* szSourceAddress,
166  const char* szTargetCallId) ;
167  //: Split szSourceAddress from szSourceCallId and join it to the specified
168  //: target call id. The source call/connection MUST be on hold prior
169  //: to initiating the split/join.
170 
171 
172  virtual void sendFlowgraphMessage(const char* callId, OsMsg& flowgraphMessage);
173  virtual void toneStart(const char* callId, int toneId, UtlBoolean local, UtlBoolean remote);
174  virtual void toneStop(const char* callId);
175  virtual void toneChannelStart(const char* callId, const char* szRemoteAddress, int toneId, UtlBoolean local, UtlBoolean remote);
176  virtual void toneChannelStop(const char* callId, const char* szRemoteAddress);
177  virtual void audioPlay(const char* callId, const char* audioUrl, UtlBoolean repeat, UtlBoolean local, UtlBoolean remote, UtlBoolean mixWithMic = false, int downScaling = 100);
178  virtual void audioStop(const char* callId);
179  virtual void audioChannelPlay(const char* callId, const char* szRemoteAddress, const char* audioUrl, UtlBoolean repeat, UtlBoolean local, UtlBoolean remote, UtlBoolean mixWithMic = false, int downScaling = 100);
180  virtual void audioChannelStop(const char* callId, const char* szRemoteAddress);
181 
183  virtual OsStatus audioChannelRecordStart(const char* callId,
184  const char* szRemoteAddress,
185  const char* szFile,
186  const CpMediaInterface::CpAudioFileFormat = CpMediaInterface::CP_WAVE_PCM_16,
187  const UtlBoolean appendToFile = FALSE,
188  const int numChannels = 1);
189 
191  virtual OsStatus audioChannelRecordPause(const char* callId, const char* szRemoteAddress);
192 
194  virtual OsStatus audioChannelRecordResume(const char* callId, const char* szRemoteAddress);
195 
196  virtual OsStatus audioChannelRecordStop(const char* callId, const char* szRemoteAddress) ;
197  virtual OsStatus audioChannelRecordBufferStart(const char* callId, const char* szRemoteAddress, const char* pBuffer, const int bufferSize, const int bufferType, const int maxRecordTime, const int maxSilence);
198  virtual OsStatus audioChannelRecordBufferStop(const char* callId, const char* szRemoteAddress);
199  virtual OsStatus setMediaPassThrough(const UtlString& callId, const UtlString& remoteAddress, CpMediaInterface::MEDIA_STREAM_TYPE mediaType,
200  int mediaTypeStreamIndex, const UtlString& mediaRecieveAddress, int rtpPort, int rtcpPort);
201  virtual OsStatus createMediaConnection(const UtlString& callId, int& connectionId);
202  virtual OsStatus setRtpDestination(const UtlString& callId, int connectionId, CpMediaInterface::MEDIA_STREAM_TYPE mediaType,
203  int mediaTypeStreamIndex, const UtlString& mediaRecieveAddress, int rtpPort, int rtcpPort);
204  virtual OsStatus startRtpSend(const UtlString& callId, int connectionId, const SdpCodecList& codecList);
205  virtual OsStatus stopRtpSend(const UtlString& callId, int connectionId);
206  virtual void bufferPlay(const char* callId, const void* audiobuf, int bufSize, int type, UtlBoolean repeat, UtlBoolean local, UtlBoolean remote);
207 
208 #ifndef EXCLUDE_STREAMING
209  virtual void createPlayer(const char* callid, MpStreamPlaylistPlayer** ppPlayer) ;
210  virtual void createPlayer(int type, const char* callid, const char* szStream, int flags, MpStreamPlayer** ppPlayer) ;
211  virtual void destroyPlayer(const char* callid, MpStreamPlaylistPlayer* pPlayer) ;
212  virtual void destroyPlayer(int type, const char* callid, MpStreamPlayer* pPlayer) ;
213 #endif
214 
215 
216  // Operations for calls & connections
217  virtual void acceptConnection(const char* callId,
218  const char* address,
219  SIPX_CONTACT_ID contactId = 0,
220  const void* hWnd = NULL,
221  const void* security = NULL,
222  const char* locationHeader = NULL,
223  const int bandWidth=AUDIO_CODEC_BW_DEFAULT,
224  UtlBoolean sendEarlyMedia = FALSE);
225 
226  virtual void rejectConnection(const char* callId, const char* address, int errorCode = 0, const char* errorText = "");
227  virtual PtStatus redirectConnection(const char* callId, const char* address, const char* forwardAddressUrl);
228  virtual void dropConnection(const char* callId, const char* address);
229  virtual void getNumConnections(const char* callId, int& numConnections);
230  virtual OsStatus getConnections(const char* callId, int maxConnections,
231  int& numConnections, UtlString addresses[]);
232  virtual OsStatus getCalledAddresses(const char* callId, int maxConnections,
233  int& numConnections, UtlString addresses[]);
234  virtual OsStatus getCallingAddresses(const char* callId, int maxConnections,
235  int& numConnections, UtlString addresses[]);
236 
237  // Operations for calls & terminal connections
238  virtual void answerTerminalConnection(const char* callId, const char* address, const char* terminalId,
239  const void* pDisplay = NULL, const void* pSecurity = NULL);
240  virtual void holdTerminalConnection(const char* callId, const char* address, const char* terminalId);
241  virtual void holdAllTerminalConnections(const char* callId);
242  virtual void holdLocalTerminalConnection(const char* callId);
243  virtual void unholdLocalTerminalConnection(const char* callId);
244  virtual void unholdAllTerminalConnections(const char* callId);
245  virtual void unholdTerminalConnection(const char* callId, const char* addresss, const char* terminalId);
246  virtual void limitCodecs(const char* callId, const char* remoteAddr, const char* codecNames);
247  virtual void limitCodecPreferences(const char* callId, const char* remoteAddr, const int audioBandwidth, const int videoBandwidth, const char* szVideoCodecName);
248  virtual void limitCodecPreferences(const char* callId, const int audioBandwidth, const int videoBandwidth, const char* szVideoCodecName);
249  virtual void silentRemoteHold(const char* callId) ;
250  virtual void renegotiateCodecsTerminalConnection(const char* callId, const char* addresss, const char* terminalId);
251  virtual void renegotiateCodecsAllTerminalConnections(const char* callId);
252  virtual void getNumTerminalConnections(const char* callId, const char* address, int& numTerminalConnections);
253  virtual OsStatus getTerminalConnections(const char* callId, const char* address,
254  int maxTerminalConnections, int& numTerminalConnections, UtlString terminalNames[]);
255  virtual UtlBoolean isTerminalConnectionLocal(const char* callId, const char* address, const char* terminalId);
256  virtual void doGetFocus(CpCall* call);
257 
258  virtual OsStatus getSession(const char* callId,
259  const char* address,
260  SipSession& session);
261 
262  virtual OsStatus getSipDialog(const char* callId,
263  const char* address,
264  SipDialog& dialog);
265 
266  // Stimulus based operations DEPRICATED DO NOT USE
267  virtual void unhold(const char* callId);
268  virtual void dialString(const char* url);
269 
270  virtual UtlBoolean disconnectConnection(const char* callId, const char* addressUrl);
271 
272  virtual void setTransferType(int type);
273 
274  virtual OsStatus setCodecCPULimitCall(const char* callId, int limit, UtlBoolean bRenegotiate) ;
275  //:Sets the CPU codec limit for a call. Each connection within the call
276  //:may only use a codec of the specified CPU intensity (or lesser).
277 
278  virtual OsStatus setInboundCodecCPULimit(int limit) ;
279  //:Sets the inbound call CPU limit for codecs
280 
282  virtual OsStatus setMicGain(const char* callId, float gain);
283 
285  virtual OsStatus setOutputMixWeight(const char* callId, int bridgeOutputIndex, float gain);
286 
287  virtual void setMaxCalls(int maxCalls);
288  //:Set the maximum number of calls to admit to the system.
289 
290  virtual void enableStun(const char* szStunServer,
291  int iStunPort,
292  int iKeepAlivePeriodSecs,
293  OsNotification *pNotification = NULL) ;
294  //:Enable STUN for NAT/Firewall traversal
295 
296  virtual void enableTurn(const char* szTurnServer,
297  int iTurnPort,
298  const char* szUsername,
299  const char* szPassword,
300  int iKeepAlivePeriodSecs) ;
301 
302 
303  virtual UtlBoolean sendInfo(const char* callId,
304  const char* szRemoteAddress,
305  const char* szContentType,
306  const size_t nContenLength,
307  const char* szContent);
308  //: Sends an INFO message to the other party(s) on the call
309 
310 /* ============================ ACCESSORS ================================= */
314  virtual int getNumLines();
315 
321  virtual OsStatus getOutboundAddresses(int maxAddressesRequested,
322  int& numAddressesAvailable, UtlString** addresses);
323 
324  virtual UtlBoolean getCallState(const char* callId, int& state);
325  virtual UtlBoolean getConnectionState(const char* callId, const char* remoteAddress, int& state);
326 
327  virtual UtlBoolean getTermConnectionState(const char* callId,
328  const char* address,
329  const char* terminal,
330  int& state);
331 
332  UtlBoolean getNextSipCseq(const char* callId,
333  const char* remoteAddress,
334  int& nextCseq);
335  //:provides the next csequence number for a given call session (leg) if it exists.
336  // Note: this does not protect against transaction
337 
338  void printCalls();
339 
340  void setOutGoingCallType(int callType);
341 
342  int getTransferType();
343 
344  virtual PtStatus validateAddress(UtlString& address);
345 
346  // Soon to be removed:
347  virtual OsStatus getFromField(const char* callId, const char* remoteAddress, UtlString& fromField);
348  virtual OsStatus getToField(const char* callId, const char* remoteAddress, UtlString& toField);
349 
350  virtual OsStatus getCodecCPUCostCall(const char* callId, int& cost);
351  //:Gets the CPU cost for an individual connection within the specified
352  //:call.
353 
354  virtual OsStatus getCodecCPULimitCall(const char* callId, int& cost);
355  //:Gets the CPU cost for an individual connection within the specified
356  //:call.
357  // It is assumed that each connection is at worst this level; however,
358  // may actually use less resources.
359 
360  virtual void getCalls(int& currentCalls, int& maxCalls);
361  //:Get the current number of calls in the system and the maximum number of
362  //:calls to be admitted to the system.
363 
364  virtual OsStatus getLocalContactAddresses(const char* callid,
365  SIPX_CONTACT_ADDRESS addresses[],
366  size_t nMaxAddresses,
367  size_t& nActaulAddresses) ;
368  //:The available local contact addresses
369 
370  virtual CpMediaInterfaceFactory* getMediaInterfaceFactory() ;
371  //: Gets the media interface factory used by the call manager
372 
373  virtual int getMediaConnectionId(const char* szCallId, const char* remoteAddress, void** ppInstData = NULL);
374  //: Gets the Media Connection ID
375  //: @param szCallId The call-id string of the call with which the connection id is associated
376  //: @param remoteAddress The remote address of the call's connection, with which the connection id is associated
377  //: @param ppInstData Pointer to the media interface
378 
379  virtual UtlBoolean getAudioEnergyLevels(const char* szCallId,
380  const char* szRemoteAddress,
381  int& iInputEnergyLevel,
382  int& iOutputEnergyLevel,
383  int& nContributors,
384  unsigned int* pContributorSRCIds,
385  int* pContributorEngeryLevels) ;
386 
387  virtual UtlBoolean getAudioEnergyLevels(const char* szCallId,
388  int& iInputEnergyLevel,
389  int& iOutputEnergyLevel) ;
390 
391  virtual UtlBoolean getAudioRtpSourceIDs(const char* szCallId,
392  const char* szRemoteAddress,
393  unsigned int& uiSendingSSRC,
394  unsigned int& uiReceivingSSRC) ;
395 
396  virtual void getRemoteUserAgent(const char* callId,
397  const char* remoteAddress,
398  UtlString& userAgent);
399 
400  virtual OsStatus getInviteHeaderValue(const char* callId,
401  const char* remoteAddress,
402  const char* headerName,
403  UtlString& headerValueString,
404  UtlBoolean& inviteIsFromRemote,
405  const int headerInstanceIndex);
406  //: Get the named header field value from the INVITE for the indicated call.
407  //: @param callId for the CpPeerCall
408  //: @param remoteAddress for the CpConnection
409  //: @param headerName for the SIP INVITE header to retrieve
410  //: @param inviteIsFromRemote - TRUE/FALSE if INVITE is received (vs sent)
411  //: @param headerInstanceIndex - index to headers of the same name
412  //: @return
413  //: OS_SUCCESS
414  //: OS_NOT_FOUND - INVITE exists, header not found
415  //: OS_INVALID_STATE - call or INVITE does not exist
416 
417  virtual UtlBoolean canAddConnection(const char* szCallId);
418  //: Can a new connection be added to the specified call? This method is
419  //: delegated to the media interface.
420 
421 /* ============================ INQUIRY =================================== */
424 
425  virtual void onCallDestroy(CpCall* pCall);
426  virtual void yieldFocus(CpCall* call);
427 
428 /* //////////////////////////// PROTECTED ///////////////////////////////// */
429 protected:
430 
431 /* //////////////////////////// PRIVATE /////////////////////////////////// */
432 private:
433 
434  UtlString mOutboundLine;
435  UtlBoolean dialing;
436  UtlBoolean mOffHook;
437  UtlBoolean speakerOn;
438  UtlBoolean flashPending;
439  SipUserAgent* sipUserAgent;
442  UtlSList callStack;
443  UtlString mDialString;
448  SdpCodecList* mpCodecFactory;
450  UtlString mLocale;
457  SipLineMgr* mpLineMgrTask; //Line manager
459  // mMaxCalls can be changed by code running in other threads.
460  volatile int mMaxCalls;
461  UtlString mStunServer ;
462  int mStunPort ;
464  UtlString mTurnServer ;
465  int mTurnPort ;
466  UtlString mTurnUsername;
467  UtlString mTurnPassword;
469 
470  CpMediaInterfaceFactory* mpMediaFactory;
471  OsMsgDispatcher mDispatcher;
472 
473  // Private accessors
474  void pushCall(CpCall* call);
475  CpCall* popCall();
476  CpCall* removeCall(CpCall* call);
477  int getCallStackSize();
478  UtlBoolean changeCallFocus(CpCall* callToTakeFocus);
479  CpCall* findHandlingCall(const char* callId);
480  CpCall* findHandlingCall(int callIndex);
481  CpCall* findHandlingCall(const OsMsg& eventMessage);
483  void getCodecs(int& numCodecs, SdpCodec**& codecArray);
484  void addHistoryEvent(const char* messageLogString);
485 
486  void doHold();
487 
488  OsStatus doCreateCall(const char* callId,
489  int metaEventId = 0,
490  int metaEventType = PtEvent::META_EVENT_NONE,
491  int numMetaEventCalls = 0,
492  const char* metaEventCallIds[] = NULL,
493  UtlBoolean assumeFocusIfNoInfocusCall = TRUE);
494 
495  void doConnect(const char* callId,
496  const char* addressUrl,
497  const char* szDesiredConnectionCallId,
498  SIPX_CONTACT_ID contactId = 0,
499  const void* pDisplay = NULL,
500  const void* pSecurity = NULL,
501  const char* locationHeader = NULL,
502  const int bandWidth = AUDIO_CODEC_BW_DEFAULT,
503  SIPX_TRANSPORT_DATA* pTransport = NULL,
504  const RtpTransportOptions rtpTransportOptions = RTP_TRANSPORT_UDP) ;
505 
506  void doEnableStun(const UtlString& szStunServer,
507  int iServerPort,
508  int iKeepAlivePeriodSecs,
509  OsNotification* pNotification) ;
510  //:Enable STUN for NAT/Firewall traversal
511 
512  void doEnableTurn(const UtlString& turnServer,
513  int iTurnPort,
514  const UtlString& turnUsername,
515  const UtlString& szTurnPassword,
516  int iKeepAlivePeriodSecs) ;
517  //:Enable TURN for NAT/Firewall traversal
518 
519  CallManager(const CallManager& rCallManager);
520  //:Copy constructor (disabled)
521 
522  CallManager& operator=(const CallManager& rhs);
523  //:Assignment operator (disabled)
524 
525 #ifdef _WIN32
526  UtlBoolean IsTroubleShootingModeEnabled();
527 #endif
528 };
529 
530 /* ============================ INLINE METHODS ============================ */
531 
532 #endif // _CallManager_h_
Definition: TaoReference.h:35
virtual void toneChannelStop(const char *callId, const char *szRemoteAddress)
Direct the media subsystem to stop playing a DTMF or progress tone.
Definition: CallManager.cpp:1639
void doEnableStun(const UtlString &szStunServer, int iServerPort, int iKeepAlivePeriodSecs, OsNotification *pNotification)
Definition: CallManager.cpp:4174
Abstract call manager.
Definition: CpCallManager.h:97
virtual void limitCodecPreferences(const char *callId, const char *remoteAddr, const int audioBandwidth, const int videoBandwidth, const char *szVideoCodecName)
Rebuild codec factory on the fly with new audio codec requirements and one specific video codec...
Definition: CallManager.cpp:2622
virtual void bufferPlay(const char *callId, const void *audiobuf, int bufSize, int type, UtlBoolean repeat, UtlBoolean local, UtlBoolean remote)
Deprecated, use the player controls.
Definition: CallManager.cpp:2087
int mExpeditedIpTos
Definition: CallManager.h:454
PtStatus
Definition: PtDefs.h:49
OsStatus doCreateCall(const char *callId, int metaEventId=0, int metaEventType=PtEvent::META_EVENT_NONE, int numMetaEventCalls=0, const char *metaEventCallIds[]=NULL, UtlBoolean assumeFocusIfNoInfocusCall=TRUE)
Definition: CallManager.cpp:4031
int getCallStackSize()
Definition: CallManager.cpp:3493
void doHold()
virtual OsStatus getCodecCPUCostCall(const char *callId, int &cost)
Gets the CPU cost for an individual connection within the specified call.
Definition: CallManager.cpp:2956
int mOutGoingCallType
Definition: CallManager.h:444
virtual void audioChannelStop(const char *callId, const char *szRemoteAddress)
Deprecated, use the player controls.
Definition: CallManager.cpp:1655
void getCodecs(int &numCodecs, SdpCodec **&codecArray)
Definition: CallManager.cpp:4228
virtual void setMaxCalls(int maxCalls)
Definition: CallManager.cpp:3242
virtual OsStatus createMediaConnection(const UtlString &callId, int &connectionId)
Definition: CallManager.cpp:1867
int mNumDialPlanDigits
Definition: CallManager.h:446
virtual void enableTurn(const char *szTurnServer, int iTurnPort, const char *szUsername, const char *szPassword, int iKeepAlivePeriodSecs)
Definition: CallManager.cpp:3259
virtual OsStatus getCalledAddresses(const char *callId, int maxConnections, int &numConnections, UtlString addresses[])
Query the list of addresses or handles for the connections in the specified call that were set up as ...
Definition: CallManager.cpp:2462
int getTotalNumberIncomingCalls()
Definition: CallManager.h:423
CpCall * infocusCall
Definition: CallManager.h:441
Definition: TaoObjectMap.h:56
int getTotalNumberOutgoingCalls()
Definition: CallManager.h:422
virtual OsStatus getCalls(int maxCalls, int &numCalls, UtlString callIds[])
Gets the list of names or identifiers for all of the existing calls.
Definition: CallManager.cpp:1137
UtlString mOutboundLine
Definition: CallManager.h:434
void printCalls()
Definition: CallManager.cpp:3644
virtual void limitCodecs(const char *callId, const char *remoteAddr, const char *codecNames)
Further limit the set of codecs to use for the call to the given set of codecs The codecs named...
Definition: CallManager.cpp:2612
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)
Initiates a new outbound connection to the specified address.
Definition: CallManager.cpp:1288
virtual void drop(const char *callId)
Drop this call and disconnect all connections associated with it.
Definition: CallManager.cpp:1352
PtMGCP * mpMgcpStackTask
Definition: CallManager.h:445
virtual void renegotiateCodecsTerminalConnection(const char *callId, const char *addresss, const char *terminalId)
Renegotiate the codecs to be use for the sepcified terminal connection.
Definition: CallManager.cpp:3148
CpCall * findHandlingCall(const char *callId)
Definition: CallManager.cpp:3505
virtual OsStatus getCallingAddresses(const char *callId, int maxConnections, int &numConnections, UtlString addresses[])
Query the list of addresses or handles for the connections in the specified call that were set up as ...
Definition: CallManager.cpp:2525
virtual OsStatus getSipDialog(const char *callId, const char *address, SipDialog &dialog)
Get the SIP dialog information for the specified terminal connection.
Definition: CallManager.cpp:2710
virtual OsStatus audioChannelRecordBufferStop(const char *callId, const char *szRemoteAddress)
Definition: CallManager.cpp:2042
int getTransferType()
Definition: CallManager.cpp:3271
virtual PtStatus consult(const char *idleTargetCallId, const char *activeOriginalCallId, const char *originalCallControllerAddress, const char *originalCallControllerTerminalId, const char *consultAddressUrl, UtlString &targetCallControllerAddress, UtlString &targetCallConsultAddress)
Create a new call and associate it with an existing call.
Definition: CallManager.cpp:1324
void pushCall(CpCall *call)
Definition: CallManager.cpp:3454
virtual void holdTerminalConnection(const char *callId, const char *address, const char *terminalId)
Put the specified terminal connection on hold.
Definition: CallManager.cpp:3109
virtual void holdAllTerminalConnections(const char *callId)
Convenience method to put all of the terminal connections in the specified call on hold...
Definition: CallManager.cpp:3115
virtual void setOutboundLineForCall(const char *callId, const char *address, SIPX_CONTACT_TYPE eType=CONTACT_AUTO)
Definition: CallManager.cpp:2312
virtual OsStatus setOutputMixWeight(const char *callId, int bridgeOutputIndex, float gain)
Set gain for all inputs to the given output on bridge.
Definition: CallManager.cpp:3073
UtlBoolean flashPending
Definition: CallManager.h:438
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)
Accept the incoming connection.
Definition: CallManager.cpp:2320
virtual OsStatus getFromField(const char *callId, const char *remoteAddress, UtlString &fromField)
Deprecated, use getSession.
Definition: CallManager.cpp:2587
CpCall * removeCall(CpCall *call)
Definition: CallManager.cpp:3472
virtual void setTransferType(int type)
Deprecated.
Definition: CallManager.cpp:3236
virtual OsStatus setInboundCodecCPULimit(int limit)
Set the call codec CPU limit for inbound connections in a call.
Definition: CallManager.cpp:3053
virtual void toneChannelStart(const char *callId, const char *szRemoteAddress, int toneId, UtlBoolean local, UtlBoolean remote)
Direct the media subsystem to begin playing a DTMF or progress tone.
Definition: CallManager.cpp:1630
int mMessageEventCount
Definition: CallManager.h:451
virtual void onCallDestroy(CpCall *pCall)
Definition: CallManager.cpp:4293
int mTurnKeepAlivePeriodSecs
Definition: CallManager.h:468
void doEnableTurn(const UtlString &turnServer, int iTurnPort, const UtlString &turnUsername, const UtlString &szTurnPassword, int iKeepAlivePeriodSecs)
Definition: CallManager.cpp:4190
virtual void yieldFocus(CpCall *call)
Definition: CallManager.cpp:4316
CpCall * popCall()
Definition: CallManager.cpp:3459
virtual CpMediaInterfaceFactory * getMediaInterfaceFactory()
Definition: CallManager.cpp:4022
virtual OsStatus getTerminalConnections(const char *callId, const char *address, int maxTerminalConnections, int &numTerminalConnections, UtlString terminalNames[])
Get the list of terminal connection identifiers for the specified call.
Definition: CallManager.cpp:2887
Definition: CallManager.h:69
virtual void setOutboundLine(const char *lineUrl)
Set the default address for the local connection.
Definition: CallManager.cpp:299
UtlString mTurnPassword
Definition: CallManager.h:467
virtual void createPlayer(const char *callid, MpStreamPlaylistPlayer **ppPlayer)
Create a MpStreamPlaylistPlayer media player associated with.
Definition: CallManager.cpp:2130
virtual PtStatus transfer_blind(const char *callId, const char *transferToUrl, UtlString *targetCallId, UtlString *targetConnectionAddress=NULL)
Blind transfer.
Definition: CallManager.cpp:1554
virtual UtlBoolean isTerminalConnectionLocal(const char *callId, const char *address, const char *terminalId)
Query whether the specified terminal connection is a local or remote connection.
Definition: CallManager.cpp:3166
UtlBoolean mOffHook
Definition: CallManager.h:436
virtual void dropConnection(const char *callId, const char *address)
Drop the specifed connection.
Definition: CallManager.cpp:2357
virtual void dialString(const char *url)
Deprecated, use connect.
Definition: CallManager.cpp:3214
UtlBoolean mIsRequredUserIdMatch
Definition: CallManager.h:458
virtual OsStatus getOutboundAddresses(int maxAddressesRequested, int &numAddressesAvailable, UtlString **addresses)
maxAddressesRequested is the number of addresses requested if available numAddressesAvailable is the ...
Definition: CallManager.cpp:2776
int mTransferType
Definition: CallManager.h:449
int SIPX_CONTACT_ID
Type for storing Contact Record identifiers.
Definition: sipXtapi.h:632
virtual OsStatus stopRtpSend(const UtlString &callId, int connectionId)
Definition: CallManager.cpp:1966
virtual void getRemoteUserAgent(const char *callId, const char *remoteAddress, UtlString &userAgent)
Definition: CallManager.cpp:1202
virtual void audioStop(const char *callId)
Deprecated, use the player controls.
Definition: CallManager.cpp:1623
virtual UtlBoolean canAddConnection(const char *szCallId)
Definition: CallManager.cpp:3988
virtual OsStatus getConnections(const char *callId, int maxConnections, int &numConnections, UtlString addresses[])
Query the list of addresses or handles for the connections in the specified call. ...
Definition: CallManager.cpp:2398
virtual OsStatus setCodecCPULimitCall(const char *callId, int limit, UtlBoolean bRenegotiate)
Sets the CPU codec limit for a call.
Definition: CallManager.cpp:3032
volatile int mMaxCalls
Definition: CallManager.h:460
CpMediaInterfaceFactory * mpMediaFactory
Definition: CallManager.h:470
UtlString mLocale
Definition: CallManager.h:450
SipLineMgr * mpLineMgrTask
Definition: CallManager.h:457
virtual UtlBoolean getConnectionState(const char *callId, const char *remoteAddress, int &state)
Get the connection state for the specified connection.
Definition: CallManager.cpp:3312
UtlString mDialString
Definition: CallManager.h:443
virtual int getNumLines()
Gets the number of lines made available by line manager.
Definition: CallManager.cpp:2761
virtual PtStatus validateAddress(UtlString &address)
Definition: CallManager.cpp:3714
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
UtlString mTurnServer
Definition: CallManager.h:464
Automatic contact selection; used for API parameters.
Definition: sipXtapi.h:531
UtlBoolean changeCallFocus(CpCall *callToTakeFocus)
Definition: CallManager.cpp:3427
virtual UtlBoolean getAudioRtpSourceIDs(const char *szCallId, const char *szRemoteAddress, unsigned int &uiSendingSSRC, unsigned int &uiReceivingSSRC)
Definition: CallManager.cpp:3946
void addHistoryEvent(const char *messageLogString)
Definition: CallManager.cpp:3498
virtual UtlBoolean handleMessage(OsMsg &eventMessage)
For internal use only.
Definition: CallManager.cpp:304
virtual void unholdTerminalConnection(const char *callId, const char *addresss, const char *terminalId)
Convenience method to take the local terminal connection off hold.
Definition: CallManager.cpp:3142
virtual OsStatus audioChannelRecordBufferStart(const char *callId, const char *szRemoteAddress, const char *pBuffer, const int bufferSize, const int bufferType, const int maxRecordTime, const int maxSilence)
Definition: CallManager.cpp:1988
int mStunKeepAlivePeriodSecs
Definition: CallManager.h:463
int mTurnPort
Definition: CallManager.h:465
void doConnect(const char *callId, const char *addressUrl, const char *szDesiredConnectionCallId, 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 *pTransport=NULL, const RtpTransportOptions rtpTransportOptions=RTP_TRANSPORT_UDP)
Definition: CallManager.cpp:4145
virtual void enableStun(const char *szStunServer, int iStunPort, int iKeepAlivePeriodSecs, OsNotification *pNotification=NULL)
Definition: CallManager.cpp:3248
UtlString mTurnUsername
Definition: CallManager.h:466
virtual OsStatus getToField(const char *callId, const char *remoteAddress, UtlString &toField)
Deprecated, use getSession.
Definition: CallManager.cpp:2825
Definition: CpMultiStringMessage.h:33
OsMsgDispatcher mDispatcher
Definition: CallManager.h:471
virtual void getNumConnections(const char *callId, int &numConnections)
Query the number of connections in the specified call.
Definition: CallManager.cpp:2363
UtlBoolean speakerOn
Definition: CallManager.h:437
virtual OsStatus setMediaPassThrough(const UtlString &callId, const UtlString &remoteAddress, CpMediaInterface::MEDIA_STREAM_TYPE mediaType, int mediaTypeStreamIndex, const UtlString &mediaRecieveAddress, int rtpPort, int rtcpPort)
Definition: CallManager.cpp:1842
virtual PtStatus transfer(const char *targetCallId, const char *originalCallId)
Consultative transfer.
Definition: CallManager.cpp:1398
UtlString mStunServer
Definition: CallManager.h:461
virtual OsStatus getSession(const char *callId, const char *address, SipSession &session)
Get the SIP session information for the specified terminal connection.
Definition: CallManager.cpp:2655
int mnTotalOutgoingCalls
Definition: CallManager.h:453
CallManager(UtlBoolean isRequiredUserIdMatch, SipLineMgr *lineMgrTask, UtlBoolean isEarlyMediaFor180Enabled, SdpCodecList *pCodecFactory, int rtpPortStart, int rtpPortEnd, const char *localAddress, const char *publicAddress, SipUserAgent *userAgent, int sipSessionReinviteTimer, PtMGCP *mgcpStackTask, const char *defaultCallExtension, int availableBehavior, const char *unconditionalForwardUrl, int forwardOnNoAnswerSeconds, const char *forwardOnNoAnswerUrl, int busyBehavior, const char *sipForwardOnBusyUrl, OsConfigDb *speedNums, CallTypes phonesetOutgoingCallProtocol, int numDialPlanDigits, int holdType, int offeringDelay, const char *pLocal, int inviteExpireSeconds, int expeditedIpTos, int maxCalls, CpMediaInterfaceFactory *pMediaFactory, int internalSamplerate)
Definition: CallManager.cpp:87
UtlBoolean dialing
Definition: CallManager.h:435
virtual void requestShutdown(void)
Definition: CallManager.cpp:1069
virtual void getNumTerminalConnections(const char *callId, const char *address, int &numTerminalConnections)
Query the number of terminal connections in the specified call.
Definition: CallManager.cpp:2851
virtual void doGetFocus(CpCall *call)
Definition: CallManager.cpp:4235
virtual OsStatus audioChannelRecordResume(const char *callId, const char *szRemoteAddress)
Resume a file recording that is paused.
Definition: CallManager.cpp:1756
CpCall * findFirstQueuedCall()
Definition: CallManager.cpp:3622
virtual void destroyPlayer(const char *callid, MpStreamPlaylistPlayer *pPlayer)
Destroy the media player associated with a call.
Definition: CallManager.cpp:2215
virtual void sendFlowgraphMessage(const char *callId, OsMsg &flowgraphMessage)
Definition: CallManager.cpp:1586
virtual UtlBoolean sendInfo(const char *callId, const char *szRemoteAddress, const char *szContentType, const size_t nContenLength, const char *szContent)
Definition: CallManager.cpp:1358
virtual void audioPlay(const char *callId, const char *audioUrl, UtlBoolean repeat, UtlBoolean local, UtlBoolean remote, UtlBoolean mixWithMic=false, int downScaling=100)
Deprecated, use the player controls.
Definition: CallManager.cpp:1614
virtual UtlBoolean getAudioEnergyLevels(const char *szCallId, const char *szRemoteAddress, int &iInputEnergyLevel, int &iOutputEnergyLevel, int &nContributors, unsigned int *pContributorSRCIds, int *pContributorEngeryLevels)
Definition: CallManager.cpp:3863
UtlBoolean getNextSipCseq(const char *callId, const char *remoteAddress, int &nextCseq)
Definition: CallManager.cpp:3350
virtual void unholdLocalTerminalConnection(const char *callId)
Take the specified terminal connection off hold,.
Definition: CallManager.cpp:3127
void setOutGoingCallType(int callType)
Definition: CallManager.cpp:3699
int mnTotalIncomingCalls
Definition: CallManager.h:452
Definition: sipXtapiInternal.h:288
virtual void holdLocalTerminalConnection(const char *callId)
Convenience method to put the local terminal connection on hold.
Definition: CallManager.cpp:3121
virtual OsStatus setRtpDestination(const UtlString &callId, int connectionId, CpMediaInterface::MEDIA_STREAM_TYPE mediaType, int mediaTypeStreamIndex, const UtlString &mediaRecieveAddress, int rtpPort, int rtcpPort)
Definition: CallManager.cpp:1909
UtlSList callStack
Definition: CallManager.h:442
virtual PtStatus split(const char *szSourceCallId, const char *szSourceAddress, const char *szTargetCallId)
Definition: CallManager.cpp:1508
#define CP_CALL_HISTORY_LENGTH
Definition: CallManager.h:41
SdpCodecList * mpCodecFactory
Definition: CallManager.h:448
int mStunPort
Definition: CallManager.h:462
int mSipSessionReinviteTimer
Definition: CallManager.h:440
virtual OsStatus setMicGain(const char *callId, float gain)
Sets the Mic gain.
Definition: CallManager.cpp:3063
SipUserAgent * sipUserAgent
Definition: CallManager.h:439
virtual OsStatus startRtpSend(const UtlString &callId, int connectionId, const SdpCodecList &codecList)
Definition: CallManager.cpp:1942
UtlString mCallManagerHistory[CP_CALL_HISTORY_LENGTH]
Definition: CallManager.h:455
CallTypes
Definition: CpCallManager.h:215
virtual void toneStart(const char *callId, int toneId, UtlBoolean local, UtlBoolean remote)
Direct the media subsystem to begin playing a DTMF or progress tone.
Definition: CallManager.cpp:1599
virtual void toneStop(const char *callId)
Direct the media subsystem to stop playing a DTMF or progress tone.
Definition: CallManager.cpp:1608
virtual ~CallManager()
Definition: CallManager.cpp:283
virtual void rejectConnection(const char *callId, const char *address, int errorCode=0, const char *errorText="")
Reject the incoming connection.
Definition: CallManager.cpp:2336
virtual void renegotiateCodecsAllTerminalConnections(const char *callId)
Convenience method to renegotiate the codecs for all of the terminal connections in the specified cal...
Definition: CallManager.cpp:3160
virtual UtlBoolean disconnectConnection(const char *callId, const char *addressUrl)
Definition: CallManager.cpp:4209
virtual OsStatus getInviteHeaderValue(const char *callId, const char *remoteAddress, const char *headerName, UtlString &headerValueString, UtlBoolean &inviteIsFromRemote, const int headerInstanceIndex)
Definition: CallManager.cpp:1234
Definition: CpCall.h:56
virtual UtlBoolean getCallState(const char *callId, int &state)
Get the state of the identified call.
Definition: CallManager.cpp:3276
virtual OsStatus getCodecCPULimitCall(const char *callId, int &cost)
Gets the CPU cost for an individual connection within the specified call.
Definition: CallManager.cpp:2994
virtual UtlBoolean getTermConnectionState(const char *callId, const char *address, const char *terminal, int &state)
Get the terminal connection state for the specified terminal connection.
Definition: CallManager.cpp:3387
int mHoldType
Definition: CallManager.h:447
virtual OsStatus getLocalContactAddresses(const char *callid, SIPX_CONTACT_ADDRESS addresses[], size_t nMaxAddresses, size_t &nActaulAddresses)
Definition: CallManager.cpp:3797
Value used to signify the default bandwidth level when calling sipxCallConnect, sipxCallAccept, or sipxConferenceAdd.
Definition: sipXtapi.h:203
virtual void unholdAllTerminalConnections(const char *callId)
Convenience method to take all of the terminal connections in the specified call off hold...
Definition: CallManager.cpp:3133
virtual void silentRemoteHold(const char *callId)
Definition: CallManager.cpp:3154
The CONTACT_ADDRESS structure includes contact information (IP-address and port), address source type...
Definition: sipXtapi.h:640
virtual OsStatus audioChannelRecordStop(const char *callId, const char *szRemoteAddress)
Definition: CallManager.cpp:1799
Definition: PtEvent.h:346
virtual void answerTerminalConnection(const char *callId, const char *address, const char *terminalId, const void *pDisplay=NULL, const void *pSecurity=NULL)
Answer the incoming terminal connection.
Definition: CallManager.cpp:3088
virtual OsStatus audioChannelRecordStart(const char *callId, const char *szRemoteAddress, const char *szFile, const CpMediaInterface::CpAudioFileFormat=CpMediaInterface::CP_WAVE_PCM_16, const UtlBoolean appendToFile=FALSE, const int numChannels=1)
Definition: CallManager.cpp:1663
virtual void audioChannelPlay(const char *callId, const char *szRemoteAddress, const char *audioUrl, UtlBoolean repeat, UtlBoolean local, UtlBoolean remote, UtlBoolean mixWithMic=false, int downScaling=100)
Deprecated, use the player controls.
Definition: CallManager.cpp:1646
virtual int getMediaConnectionId(const char *szCallId, const char *remoteAddress, void **ppInstData=NULL)
Definition: CallManager.cpp:3834
virtual OsStatus audioChannelRecordPause(const char *callId, const char *szRemoteAddress)
Pause a file recording that is already started.
Definition: CallManager.cpp:1713
virtual PtStatus redirectConnection(const char *callId, const char *address, const char *forwardAddressUrl)
Redirect the incoming connection.
Definition: CallManager.cpp:2342
UtlBoolean mIsEarlyMediaFor180
Definition: CallManager.h:456
virtual void unhold(const char *callId)
Deprecated, use holdAllTerminalConnections.
Definition: CallManager.cpp:1103
virtual void createCall(UtlString *callId, int metaEventId=0, int metaEventType=PtEvent::META_EVENT_NONE, int numMetaEventCalls=0, const char *metaEventCallIds[]=NULL, UtlBoolean assumeFocusIfNoInfocusCall=TRUE)
Creates a new call with an implicit local connection.
Definition: CallManager.cpp:1109
CallManager & operator=(const CallManager &rhs)
Definition: CallManager.cpp:3206