Debian Codegraph @

addons/ooh323c/src/ooCalls.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2004-2005 by Objective Systems, Inc.
3 *
4 * This software is furnished under an open source license and may be
5 * used and copied only in accordance with the terms of this license.
6 * The text of the license may generally be found in the root
7 * directory of this installation in the COPYING file. It
8 * can also be viewed online at the following URL:
9 *
10 * http://www.obj-sys.com/open/license.html
11 *
12 * Any redistributions of this file including modified versions must
13 * maintain this copyright notice.
14 *
15 *****************************************************************************/
16 /**
17 * @file ooCalls.h
18 * This file contains call management functions.
19 */
20 #ifndef _OOCALLS_H_
21 #define _OOCALLS_H_
22
23 #include "ooLogChan.h"
24 #include "ooCapability.h"
25 #include <regex.h>
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31
32 /**
33 * @defgroup callmgmt Call Management
34 * @{
35 */
36 /* Flag mask values */
37 /* DISABLEGK is used to selectively disable gatekeeper use. For incoming calls
38 DISABLEGK can be set in onReceivedSetup callback by application.
39 Very useful in pbx applications where gk is used only when call is
40 to or from outside pbx domian. For outgoing calls, ooMakeCallNoGk
41 disables use of gk for specific call.
42 */
43
44
45 #define OO_M_ENDSESSION_BUILT ASN1UINTCNT(0x00800000)
46 #define OO_M_RELEASE_BUILT ASN1UINTCNT(0x00400000)
47 #define OO_M_FASTSTARTANSWERED ASN1UINTCNT(0x04000000)
48
49 #define OO_M_ENDPOINTCREATED ASN1UINTCNT(0x00010000)
50 #define OO_M_GKROUTED ASN1UINTCNT(0x00200000)
51 #define OO_M_AUTOANSWER ASN1UINTCNT(0x00100000)
52 #define OO_M_TUNNELING ASN1UINTCNT(0x08000000)
53 #define OO_M_MEDIAWAITFORCONN ASN1UINTCNT(0x20000000)
54 #define OO_M_FASTSTART ASN1UINTCNT(0x02000000)
55 #define OO_M_DISABLEGK ASN1UINTCNT(0x01000000)
56 #define OO_M_MANUALRINGBACK ASN1UINTCNT(0x10000000)
57
58 #define OO_M_TRYBEMASTER ASN1UINTCNT(0x00000010)
59 #define OO_M_AUDIOSESSION ASN1UINTCNT(0x00000100)
60 #define OO_M_DATASESSION ASN1UINTCNT(0x00000200)
61 #define OO_M_T38SUPPORTED ASN1UINTCNT(0x00000400)
62
63 /**
64 * Call states.
65 */
66 typedef enum {
67 OO_CALL_CREATED, /*!< Call created. */
68 OO_CALL_WAITING_ADMISSION, /*!< Call waiting for admission by GK */
69 OO_CALL_CONNECTING, /*!< Call in process of connecting */
70 OO_CALL_CONNECTED, /*!< Call currently connected. */
71 OO_CALL_PAUSED, /*!< Call Paused for hold/transfer. */
72 OO_CALL_CLEAR, /*!< Call marked for clearing */
73 OO_CALL_CLEAR_RELEASERECVD, /*!< Release command received. */
74 OO_CALL_CLEAR_RELEASESENT, /*!< Release sent */
75 OO_CALL_CLEARED, /*!< Call cleared */
76 OO_CALL_REMOVED /* call removed */
77 } OOCallState;
78
79 /**
80 * H.245 session states.
81 */
82 typedef enum {
83 OO_H245SESSION_IDLE,
84 OO_H245SESSION_PAUSED,
85 OO_H245SESSION_ACTIVE,
86 OO_H245SESSION_ENDSENT,
87 OO_H245SESSION_ENDRECVD,
88 OO_H245SESSION_CLOSED
89 } OOH245SessionState;
90
91 /**
92 * Structure to store local and remote media endpoint info for a
93 * given media type.
94 */
95 typedef struct OOMediaInfo{
96 char dir[15]; /* transmit/receive*/
97 int cap;
98 int lMediaPort;
99 int lMediaCntrlPort;
100 int lMediaRedirPort;
101 int lMediaRedirCPort;
102 char lMediaIP[2+8*4+7];
103 struct OOMediaInfo *next;
104 } OOMediaInfo;
105
106 #define ooMediaInfo OOMediaInfo
107
108 struct OOAliases;
109
110 /**
111 * Structure to hold information on a forwarded call.
112 */
113 typedef struct OOCallFwdData {
114 char ip[20];
115 int port;
116 struct OOAliases *aliases;
117 OOBOOL fwdedByRemote; /*Set when we are being fwded by remote*/
118 } OOCallFwdData;
119
120 /**
121 * Structure to store information on an H.323 channel (H.225 or H.245) for
122 * a particular call.
123 */
124 typedef struct OOH323Channel {
125 OOSOCKET sock; /*!< Socket connection for the channel */
126 int port; /*!< Port assigned to the channel */
127 DList outQueue; /*!< Output message queue */
128 } OOH323Channel;
129
130 /**
131 * Structure to store information on fast start response (H.225) to
132 * reply same answer in CALL PROCEEDING, ALERTING & CONNECT.
133 */
134 typedef struct EXTERN FastStartResponse {
135 ASN1UINT n;
136 ASN1DynOctStr *elem;
137 } FastStartResponse;
138
139 typedef struct OOH323Regex {
140 regex_t regex;
141 int inuse;
142 ast_mutex_t lock;
143 } OOH323Regex;
144
145
146 /**
147 * This structure is used to maintain all information on an active call.
148 * A list of these structures is maintained within the global endpoint
149 * structure.
150 */
151 typedef struct OOH323CallData {
152 OOCTXT *pctxt;
153 OOCTXT *msgctxt;
154 pthread_t callThread;
155 ast_cond_t gkWait;
156 ast_mutex_t GkLock;
157 ast_mutex_t Lock;
158 OOBOOL Monitor;
159 OOBOOL fsSent;
160 OOSOCKET CmdChan;
161 OOSOCKET cmdSock;
162 ast_mutex_t* CmdChanLock;
163 char callToken[20]; /* ex: ooh323c_call_1 */
164 char callType[10]; /* incoming/outgoing */
165 OOCallMode callMode;
166 int transfercap;
167 ASN1USINT callReference;
168 char ourCallerId[256];
169 H225CallIdentifier callIdentifier;/* The call identifier for the active
170 call. */
171 char *callingPartyNumber;
172 char *calledPartyNumber;
173 H225ConferenceIdentifier confIdentifier;
174 ASN1UINT flags;
175 OOCallState callState;
176 OOCallClearReason callEndReason;
177 int q931cause;
178 ASN1UINT h225version;
179 unsigned h245ConnectionAttempts;
180 OOH245SessionState h245SessionState;
181 int dtmfmode;
182 int dtmfcodec;
183 OOMediaInfo *mediaInfo;
184 OOCallFwdData *pCallFwdData;
185 char localIP[2+8*4+7];/* Local IP address */
186 int versionIP; /* IP Address family 6 or 4 */
187 OOH323Channel* pH225Channel;
188 OOH323Channel* pH245Channel;
189 OOSOCKET *h245listener;
190 int *h245listenport;
191 char remoteIP[2+8*4+7];/* Remote IP address */
192 int remotePort;
193 int remoteH245Port;
194 char *remoteDisplayName;
195 struct OOAliases *remoteAliases;
196 struct OOAliases *ourAliases; /*aliases used in the call for us */
197 OOMasterSlaveState masterSlaveState; /*!< Master-Slave state */
198 OOMSAckStatus msAckStatus; /* Master-Slave ack's status */
199 ASN1UINT statusDeterminationNumber;
200 OOCapExchangeState localTermCapState;
201 OOCapExchangeState remoteTermCapState;
202 OOBOOL TCSPending;
203 struct ooH323EpCapability* ourCaps;
204 struct ooH323EpCapability* remoteCaps; /* TODO: once we start using jointCaps, get rid of remoteCaps*/
205 struct ooH323EpCapability* jointCaps;
206 int jointDtmfMode;
207 DList remoteFastStartOLCs;
208 ASN1UINT8 remoteTermCapSeqNo;
209 ASN1UINT8 localTermCapSeqNo;
210 OOCapPrefs capPrefs;
211 OOLogicalChannel* logicalChans;
212 int noOfLogicalChannels;
213 int logicalChanNoBase;
214 int logicalChanNoMax;
215 int logicalChanNoCur;
216 unsigned nextSessionID; /* Note by default 1 is audio session, 2 is video and 3 is data, from 3 onwards master decides*/
217 DList timerList;
218 ASN1UINT msdRetries;
219 ASN1UINT8 requestSequence;
220 ASN1UINT reqFlags;
221 ASN1UINT t38sides;
222 int T38FarMaxDatagram;
223 int T38Version;
224 H235TimeStamp alertingTime, connectTime, endTime; /* time data for gatekeeper */
225 FastStartResponse *pFastStartRes; /* fast start response */
226 struct OOH323Regex* rtpMask;
227 char rtpMaskStr[120];
228 char lastDTMF;
229 ASN1UINT nextDTMFstamp;
230 int rtdrInterval, rtdrCount; /* roundTripDelay interval and unreplied count */
231 ASN1UINT8 rtdrSend, rtdrRecv; /* last sended/replied RTD request */
232 void *usrData; /*!<User can set this to user specific data*/
233 struct OOH323CallData* next;
234 struct OOH323CallData* prev;
235 } OOH323CallData;
236
237 #define ooCallData OOH323CallData
238
239 /**
240 * This callback function is triggered when a new call structure is
241 * created inside the stack for an incoming or outgoing call.
242 *
243 * @param call H.323 call data structure
244 * @return 0 if callback was successful, non-zero error code if failure.
245 */
246 typedef int (*cb_OnNewCallCreated)(OOH323CallData* call);
247
248 /**
249 * This callback function is triggered when a Q.931 alerting message is
250 * received for an outgoing call or when a Q.931 alerting message is sent
251 * for an incoming call.
252 *
253 * @param call H.323 call data structure
254 * @return 0 if callback was successful, non-zero error code if failure.
255 */
256 typedef int (*cb_OnAlerting)(OOH323CallData * call);
257
258 /**
259 * This callback function is triggered when there is an incoming call.
260 * In the case where a gatekeeper is in use, the call must first be
261 * admitted by the gatekeeper before this callback is triggered.
262 *
263 * @param call H.323 call data structure
264 * @return 0 if callback was successful, non-zero error code if failure.
265 */
266 typedef int (*cb_OnIncomingCall)(OOH323CallData* call );
267
268 /**
269 * This callback function is triggered after a Q.931 setup message
270 * is sent for an outgoing call.
271 *
272 * @param call H.323 call data structure
273 * @return 0 if callback was successful, non-zero error code if failure.
274 */
275 typedef int (*cb_OnOutgoingCall)(OOH323CallData* call );
276
277 /**
278 * This callback function is triggered when a Q.931 connect message is
279 * sent in case of incoming call. In case of outgoing call, this is invoked
280 * when a Q.931 connect message is received. It is not invoked until after
281 * fast start and H.245 tunneling messages within the connect message are
282 * processed.
283 *
284 * @param call H.323 call data structure
285 * @return 0 if callback was successful, non-zero error code if failure.
286 */
287 typedef int (*cb_OnCallEstablished)(struct OOH323CallData* call);
288
289 /**
290 * This callback function is triggered when a call is cleared.
291 *
292 * @param call H.323 call data structure
293 * @return 0 if callback was successful, non-zero error code if failure.
294 */
295 typedef int (*cb_OnCallCleared)(struct OOH323CallData* call);
296
297 /**
298 * This callback function is triggered when master-slave determination
299 * and capabilities negotiation procedures are successfully completed
300 * for a call.
301 *
302 * @param call H.323 call data structure
303 * @return 0 if callback was successful, non-zero error code if failure.
304 */
305 typedef int (*cb_OpenLogicalChannels)(struct OOH323CallData* call);
306
307 /**
308 * This callback function is triggered when a call is forwarded by
309 * a remote endpoint to another remote destination.
310 * @param call Associated H.323 call data structure
311 * @return 0 if callback was successful, non-zero error code if failure
312 */
313 typedef int (*cb_OnCallForwarded)(struct OOH323CallData* call);
314
315 /**
316 * This callback function is triggered when dtmf is received over Q.931(keypad)
317 * or H.245(alphanumeric) or H.245(signal). This is not triggered when rfc
318 * 2833 based dtmf is received.
319 */
320 typedef int (*cb_OnReceivedDTMF)
321 (struct OOH323CallData *call, const char *dtmf);
322
323 /**
324 * This callback function is triggered when dtmf is received over Q.931(keypad)
325 * or H.245(alphanumeric) or H.245(signal). This is not triggered when rfc
326 * 2833 based dtmf is received.
327 */
328 typedef void (*cb_OnModeChanged)
329 (struct OOH323CallData *call, int isT38Mode);
330
331 typedef void (*cb_OnMediaChanged)
332 (struct OOH323CallData *call, char* remoteIP, int remotePort);
333
334 /**
335 * This structure holds all of the H.323 signaling callback function
336 * addresses.
337 * @see ooH323EpSetH323Callbacks
338 */
339 typedef struct OOH323CALLBACKS {
340 cb_OnAlerting onNewCallCreated;
341 cb_OnAlerting onAlerting;
342 cb_OnAlerting onProgress;
343 cb_OnIncomingCall onIncomingCall;
344 cb_OnOutgoingCall onOutgoingCall;
345 cb_OnCallEstablished onCallEstablished;
346 cb_OnCallForwarded onCallForwarded;
347 cb_OnCallCleared onCallCleared;
348 cb_OpenLogicalChannels openLogicalChannels;
349 cb_OnReceivedDTMF onReceivedDTMF;
350 cb_OnModeChanged onModeChanged;
351 cb_OnMediaChanged onMediaChanged;
352 } OOH323CALLBACKS;
353
354 /**
355 * This function is used to create a new call entry.
356 * @param type Type of the call (incoming/outgoing)
357 * @param callToken Call Token, an uniques identifier for the call
358 *
359 * @return Pointer to a newly created call
360 */
361 EXTERN OOH323CallData* ooCreateCall(char *type, char *callToken);
362
363 /**
364 * This function is used to add a call to the list of existing calls.
365 * @param call Pointer to the call to be added.
366 * @return OO_OK, on success. OO_FAILED, on failure
367 */
368 EXTERN int ooAddCallToList (OOH323CallData *call);
369
370 /**
371 * This function is used to set the caller ID for a call.
372 *
373 * @param call Handle to the call
374 * @param callerid caller ID value
375 * @return OO_OK, on success. OO_FAILED, otherwise.
376 */
377 EXTERN int ooCallSetCallerId
378 (OOH323CallData* call, const char* callerid);
379
380 /**
381 * This function is used to set calling party number for a particular call.
382 * @param call Handle to the call.
383 * @param number Calling Party number value.
384 *
385 * @return OO_OK, on success. OO_FAILED, on failure.
386 */
387 EXTERN int ooCallSetCallingPartyNumber
388 (OOH323CallData *call, const char *number);
389
390 /**
391 * This function is used to retrieve calling party number of a particular call.
392 * @param call Handle to the call.
393 * @param buffer Handle to the buffer in which value will be returned.
394 * @param len Length of the supplied buffer.
395 *
396 * @return OO_OK, on success. OO_FAILED, on failure.
397 */
398 EXTERN int ooCallGetCallingPartyNumber
399 (OOH323CallData *call, char *buffer, int len);
400
401 /**
402 * This function is used to retrieve called party number of a particular call.
403 * @param call Handle to the call.
404 * @param buffer Handle to the buffer in which value will be returned.
405 * @param len Length of the supplied buffer.
406 *
407 * @return OO_OK, on success. OO_FAILED, on failure.
408 */
409 EXTERN int ooCallGetCalledPartyNumber
410 (OOH323CallData *call, char *buffer, int len);
411
412 /**
413 * This function is used to set called party number for a particular call.
414 * @param call Handle to the call.
415 * @param number Called Party number value.
416 *
417 * @return OO_OK, on success. OO_FAILED, on failure.
418 */
419 EXTERN int ooCallSetCalledPartyNumber
420 (OOH323CallData *call, const char *number);
421
422 /**
423 * This function is used to clear the local aliases used by this call.
424 * @param call Handle to the call.
425 *
426 * @return OO_OK, on success. OO_FAILED, on failure.
427 */
428 EXTERN int ooCallClearAliases(OOH323CallData *call);
429
430 /**
431 * This function is used to add an H323ID alias to be used by local endpoint
432 * for a particular call.
433 * @param call Handle to the call
434 * @param h323id H323ID to add for the local endpoint for the call.
435 *
436 * @return OO_OK, on success. OO_FAILED, on failure.
437 */
438 EXTERN int ooCallAddAliasH323ID(OOH323CallData *call, const char* h323id);
439
440 /**
441 * This function is used to add an dialedDigits alias to be used by local
442 * endpoint for a particular call.
443 * @param call Handle to the call
444 * @param dialedDigits DialedDigits to add for the local endpoint for call.
445 *
446 * @return OO_OK, on success. OO_FAILED, on failure.
447 */
448 EXTERN int ooCallAddAliasDialedDigits
449 (OOH323CallData *call, const char* dialedDigits);
450
451 /**
452 * This function is used to add an email-id alias to be used by local
453 * endpoint for a particular call.
454 * @param call Handle to the call
455 * @param email Email-id to add for the local endpoint for call.
456 *
457 * @return OO_OK, on success. OO_FAILED, on failure.
458 */
459 EXTERN int ooCallAddAliasEmailID(OOH323CallData *call, const char* email);
460
461
462 /**
463 * This function is used to add an email-id alias to be used by local
464 * endpoint for a particular call.
465 * @param call Handle to the call
466 * @param url URL-id to add for the local endpoint for call.
467 *
468 * @return OO_OK, on success. OO_FAILED, on failure.
469 */
470 EXTERN int ooCallAddAliasURLID(OOH323CallData *call, const char* url);
471
472
473 /**
474 * This is a helper function used by other call related add aliases functions
475 * to add a particular alias. This function is not supposed to be called
476 * directly.
477 * @param call Handle to the call
478 * @param aliasType Type of alias being added
479 * @param value Alias value
480 * @param local Whether alias is for local party or remote party
481 *
482 * @return OO_OK, on success. OO_FAILED, on failure.
483 */
484 int ooCallAddAlias
485 (OOH323CallData *call, int aliasType, const char *value, OOBOOL local);
486
487
488 /**
489 * This function is used to add an dialed digits alias for the remote endpoint
490 * involved in a particular call.
491 * @param call Handle to the call
492 * @param dialedDigits dialedDigits alias to add for the remote endpoint.
493 *
494 * @return OO_OK, on success. OO_FAILED, on failure.
495 */
496 EXTERN int ooCallAddRemoteAliasDialedDigits
497 (OOH323CallData *call, const char* dialedDigits);
498
499 /**
500 * This function is used to add an H323ID alias for the remote endpoint
501 * involved in a particular call.
502 * @param call Handle to the call
503 * @param h323id H323ID to add for the remote endpoint.
504 *
505 * @return OO_OK, on success. OO_FAILED, on failure.
506 */
507 EXTERN int ooCallAddRemoteAliasH323ID(OOH323CallData *call, const char* h323id);
508
509
510 /**
511 * This function is used to add G7231 capability for the call. The
512 * "ooCallAdd...Capability" functions allow to override the global endpoint
513 * capabilities and use specific capabilities for specific calls.
514 * @param call Call for which capability has to be added.
515 * @param cap Capability to be added.
516 * @param txframes Number of frames per packet for transmission.
517 * @param rxframes Number of frames per packet for reception.
518 * @param silenceSuppression Indicates support for silenceSuppression.
519 * @param dir Direction of capability.OORX, OOTX, OORXANDTX
520 * @param startReceiveChannel Callback function to start receive channel.
521 * @param startTransmitChannel Callback function to start transmit channel.
522 * @param stopReceiveChannel Callback function to stop receive channel.
523 * @param stopTransmitChannel Callback function to stop transmit channel.
524 *
525 * @return OO_OK, on success. OO_FAILED, on failure.
526 */
527 EXTERN int ooCallAddG7231Capability(OOH323CallData *call, int cap, int txframes,
528 int rxframes, OOBOOL silenceSuppression, int dir,
529 cb_StartReceiveChannel startReceiveChannel,
530 cb_StartTransmitChannel startTransmitChannel,
531 cb_StopReceiveChannel stopReceiveChannel,
532 cb_StopTransmitChannel stopTransmitChannel);
533
534 /**
535 * This function is used to add G728 capability for the call. The
536 * "ooCallAdd...Capability" functions allow to override the global endpoint
537 * capabilities and use specific capabilities for specific calls.
538 * @param call Call for which capability has to be added.
539 * @param cap Capability to be added.
540 * @param txframes Number of frames per packet for transmission.
541 * @param rxframes Number of frames per packet for reception.
542 * @param dir Direction of capability.OORX, OOTX, OORXANDTX
543 * @param startReceiveChannel Callback function to start receive channel.
544 * @param startTransmitChannel Callback function to start transmit channel.
545 * @param stopReceiveChannel Callback function to stop receive channel.
546 * @param stopTransmitChannel Callback function to stop transmit channel.
547 *
548 * @return OO_OK, on success. OO_FAILED, on failure.
549 */
550 EXTERN int ooCallAddG728Capability(OOH323CallData *call, int cap, int txframes,
551 int rxframes, int dir,
552 cb_StartReceiveChannel startReceiveChannel,
553 cb_StartTransmitChannel startTransmitChannel,
554 cb_StopReceiveChannel stopReceiveChannel,
555 cb_StopTransmitChannel stopTransmitChannel);
556
557 /**
558 * This function is used to add G729 capability for the call. The
559 * "ooCallAdd...Capability" functions allow to override the global endpoint
560 * capabilities and use specific capabilities for specific calls.
561 * @param call Call for which capability has to be added.
562 * @param cap Capability to be added.
563 * @param txframes Number of frames per packet for transmission.
564 * @param rxframes Number of frames per packet for reception.
565 * @param dir Direction of capability.OORX, OOTX, OORXANDTX
566 * @param startReceiveChannel Callback function to start receive channel.
567 * @param startTransmitChannel Callback function to start transmit channel.
568 * @param stopReceiveChannel Callback function to stop receive channel.
569 * @param stopTransmitChannel Callback function to stop transmit channel.
570 *
571 * @return OO_OK, on success. OO_FAILED, on failure.
572 */
573 EXTERN int ooCallAddG729Capability(OOH323CallData *call, int cap, int txframes,
574 int rxframes, int dir,
575 cb_StartReceiveChannel startReceiveChannel,
576 cb_StartTransmitChannel startTransmitChannel,
577 cb_StopReceiveChannel stopReceiveChannel,
578 cb_StopTransmitChannel stopTransmitChannel);
579
580 /**
581 * This function is used to add G711 capability for the call. The
582 * "ooCallAdd...Capability" functions allow to override the global endpoint
583 * capabilities and use specific capabilities for specific calls.
584 * @param call Call for which capability has to be added.
585 * @param cap Capability to be added.
586 * @param txframes Number of frames per packet for transmission.
587 * @param rxframes Number of frames per packet for reception.
588 * @param dir Direction of capability.OORX, OOTX, OORXANDTX
589 * @param startReceiveChannel Callback function to start receive channel.
590 * @param startTransmitChannel Callback function to start transmit channel.
591 * @param stopReceiveChannel Callback function to stop receive channel.
592 * @param stopTransmitChannel Callback function to stop transmit channel.
593 *
594 * @return OO_OK, on success. OO_FAILED, on failure.
595 */
596 EXTERN int ooCallAddG711Capability(OOH323CallData *call, int cap, int txframes,
597 int rxframes, int dir,
598 cb_StartReceiveChannel startReceiveChannel,
599 cb_StartTransmitChannel startTransmitChannel,
600 cb_StopReceiveChannel stopReceiveChannel,
601 cb_StopTransmitChannel stopTransmitChannel);
602
603
604 /**
605 * This function is used to add GSM capability for the call. The
606 * "ooCallAdd...Capability" functions allow to override the global endpoint
607 * capabilities and use specific capabilities for specific calls.
608 * @param call Call for which capability has to be added.
609 * @param cap Type of GSM capability to be added.
610 * @param framesPerPkt Number of GSM frames pre packet.
611 * @param comfortNoise Comfort noise spec for the capability.
612 * @param scrambled Scrambled enabled/disabled for the capability.
613 * @param dir Direction of capability.OORX, OOTX, OORXANDTX
614 * @param startReceiveChannel Callback function to start receive channel.
615 * @param startTransmitChannel Callback function to start transmit channel.
616 * @param stopReceiveChannel Callback function to stop receive channel.
617 * @param stopTransmitChannel Callback function to stop transmit channel.
618 *
619 * @return OO_OK, on success. OO_FAILED, on failure.
620 */
621 EXTERN int ooCallAddGSMCapability(OOH323CallData* call, int cap,
622 ASN1USINT framesPerPkt, OOBOOL comfortNoise,
623 OOBOOL scrambled, int dir,
624 cb_StartReceiveChannel startReceiveChannel,
625 cb_StartTransmitChannel startTransmitChannel,
626 cb_StopReceiveChannel stopReceiveChannel,
627 cb_StopTransmitChannel stopTransmitChannel);
628
629
630
631
632 /**
633 * This function is used to add H263 video capability for the call. The
634 * "ooCallAdd...Capability" functions allow to override the global endpoint
635 * capabilities and use specific capabilities for specific calls.
636 * @param call Call for which capability has to be added.
637 * @param cap Capability type - OO_H263VIDEO
638 * @param sqcifMPI Minimum picture interval for encoding/decoding
639 * of SQCIF pictures.
640 * @param qcifMPI Minimum picture interval for encoding/decoding
641 * of QCIF pictures.
642 * @param cifMPI Minimum picture interval for encoding/decoding
643 * of CIF pictures.
644 * @param cif4MPI Minimum picture interval for encoding/decoding
645 * of CIF4 pictures.
646 * @param cif16MPI Minimum picture interval for encoding/decoding
647 * of CIF16 pictures.
648 * @param maxBitRate Maximum bit rate in units of 100 bits/s at
649 * which a transmitter can transmit video or a
650 * receiver can receive video.
651 * @param dir Direction of capability.OORX, OOTX, OORXANDTX
652 * @param startReceiveChannel Callback function to start receive channel.
653 * @param startTransmitChannel Callback function to start transmit channel.
654 * @param stopReceiveChannel Callback function to stop receive channel.
655 * @param stopTransmitChannel Callback function to stop transmit channel.
656 *
657 * @return OO_OK, on success. OO_FAILED, on failure.
658 */
659 EXTERN int ooCallAddH263VideoCapability(OOH323CallData *call, int cap,
660 unsigned sqcifMPI, unsigned qcifMPI,
661 unsigned cifMPI, unsigned cif4MPI,
662 unsigned cif16MPI, unsigned maxBitRate,
663 int dir,
664 cb_StartReceiveChannel startReceiveChannel,
665 cb_StartTransmitChannel startTransmitChannel,
666 cb_StopReceiveChannel stopReceiveChannel,
667 cb_StopTransmitChannel stopTransmitChannel);
668
669
670 /**
671 * This function is used to enable rfc 2833 capability for the call. By default
672 * the stack uses the dtmf settings for the endpoint. But if you want to
673 * enable/disable dtmf for a specific call, then you can override end-point
674 * settings using this function
675 * @param call Call for which rfc2833 has to be enabled.
676 * @param dynamicRTPPayloadType dynamicRTPPayloadType to be used.
677 *
678 * @return OO_OK, on success. OO_FAILED, on failure
679 */
680 EXTERN int ooCallEnableDTMFRFC2833
681 (OOH323CallData *call, int dynamicRTPPayloadType);
682
683
684 /**
685 * This function is used to disable rfc 2833 capability for the call.
686 * By default the stack uses the dtmf settings for the endpoint. But if you
687 * want to enable/disable dtmf for a specific call, then you can override
688 * end-point settings using this function
689 * @param call Call for which rfc2833 has to be disabled.
690 *
691 * @return OO_OK, on success. OO_FAILED, on failure
692 */
693 EXTERN int ooCallDisableDTMFRFC2833(OOH323CallData *call);
694
695
696 /**
697 * This function is used to enable H.245(alphanumeric) dtmf support for the
698 * call. By default the stack uses the dtmf settings for the endpoint. But if
699 * you want to enable H.245(alphanumeric) dtmf for a specific call, then you
700 * can override end-point settings using this function
701 * @param call Call for which H.245(alphanumeric) dtmf support
702 * has to be enabled.
703 *
704 * @return OO_OK, on success. OO_FAILED, on failure
705 */
706 EXTERN int ooCallEnableDTMFH245Alphanumeric(OOH323CallData *call);
707
708 /**
709 * This function is used to disable H.245(alphanumeric) dtmf support for the
710 * call. By default the stack uses the dtmf settings for the endpoint. But if
711 * you want to disable H.245(alphanumeric) dtmf for a specific call, then you
712 * can override end-point settings using this function
713 * @param call Call for which H.245(alphanumeric) dtmf support
714 * has to be disabled.
715 *
716 * @return OO_OK, on success. OO_FAILED, on failure
717 */
718 EXTERN int ooCallDisableDTMFH245Alphanumeric(OOH323CallData *call);
719
720 /**
721 * This function is used to enable H.245(signal) dtmf support for the call.
722 * By default the stack uses the dtmf settings for the endpoint. But if you
723 * want to enable H.245(signal) dtmf for a specific call, then you can override
724 * end-point settings using this function
725 * @param call Call for which H.245(signal) dtmf support
726 * has to be enabled.
727 *
728 * @return OO_OK, on success. OO_FAILED, on failure
729 */
730 EXTERN int ooCallEnableDTMFH245Signal(OOH323CallData *call);
731
732
733 /**
734 * This function is used to disable H.245(signal) dtmf support for the call.
735 * By default the stack uses the dtmf settings for the endpoint. But if you
736 * want to disable H.245(signal) dtmf for a specific call, then you can
737 * override end-point settings using this function
738 * @param call Call for which H.245(signal) dtmf support
739 * has to be disabled.
740 *
741 * @return OO_OK, on success. OO_FAILED, on failure
742 */
743 EXTERN int ooCallDisableDTMFH245Signal(OOH323CallData *call);
744
745
746 /**
747 * This function is used to enable Q.931(keypad) dtmf support for the call.
748 * By default the stack uses the dtmf settings for the endpoint. But if you
749 * want to enable Q.931(keypad) dtmf support for a specific call, then you can
750 * override end-point settings using this function
751 * @param call Call for which Q.931(keypad) dtmf support
752 * has to be enabled.
753 *
754 * @return OO_OK, on success. OO_FAILED, on failure
755 */
756 EXTERN int ooCallEnableDTMFQ931Keypad(OOH323CallData *call);
757
758 /**
759 * This function is used to disable Q.931(keypad) dtmf support for the call.
760 * By default the stack uses the dtmf settings for the endpoint. But if you
761 * want to disable Q.931(keypad) dtmf support for a specific call, then you can
762 * override end-point settings using this function
763 * @param call Call for which Q.931(keypad) dtmf support
764 * has to be disabled.
765 *
766 * @return OO_OK, on success. OO_FAILED, on failure
767 */
768 EXTERN int ooCallDisableDTMFQ931Keypad(OOH323CallData *call);
769
770
771 /**
772 * This function is used to find a call by using the unique token for the call.
773 * @param callToken The unique token for the call.
774 *
775 * @return Pointer to the call if found, NULL otherwise.
776 */
777 EXTERN OOH323CallData* ooFindCallByToken(const char *callToken);
778
779 /**
780 * This function is used to end a call. Based on what stage of clearance the
781 * call is it takes appropriate action.
782 *
783 * @param call Handle to the call which has to be cleared.
784 * @return OO_OK, on success. OO_FAILED, on failure.
785 */
786 EXTERN int ooEndCall(OOH323CallData *call);
787
788 /**
789 * This function is used to remove a call from the list of existing calls.
790 *
791 * @param call Pointer to the call to be removed.
792 * @return OO_OK, on success. OO_FAILED, on failure.
793 */
794 EXTERN int ooRemoveCallFromList (OOH323CallData *call);
795
796 /**
797 * This function is used to clean up a call. It closes all associated sockets,
798 * removes the call from the global list and frees up associated memory.
799 *
800 * @param call Pointer to the call to be cleared.
801 * @return OO_OK, on success. OO_FAILED, on failure.
802 */
803 EXTERN int ooCleanCall(OOH323CallData *call);
804
805 /**
806 * This function is used to check whether a specified session in specified
807 * direction is active for the call.
808 * @param call Handle to call for which session has to be queried.
809 * @param sessionID Session id to identify the type of session(1 for audio,
810 * 2 for voice and 3 for data)
811 * @param dir Direction of the session(transmit/receive)
812 *
813 * @return 1, if session active. 0, otherwise.
814 */
815 EXTERN ASN1BOOL ooIsSessionEstablished
816 (OOH323CallData *call, int sessionID, char* dir);
817
818 /**
819 * This function can be used by an application to specify media endpoint
820 * information for different types of media. The stack by default uses local IP
821 * and port for media. An application can provide mediainfo if it wants to
822 * override default.
823 * @param call Handle to the call
824 * @param mediaInfo Structure which defines the media endpoint to be
825 * used.
826 *
827 * @return OO_OK, on success. OO_FAILED, on failure.
828 */
829 EXTERN int ooAddMediaInfo(OOH323CallData *call, OOMediaInfo mediaInfo);
830
831 /**
832 * This function is used to generate a media session id for the new media
833 * session for the call.
834 * @param call Handle to the call.
835 * @param type Type of media session.
836 * @param dir Direction of session
837 *
838 * @return Generated session id.
839 */
840 EXTERN unsigned ooCallGenerateSessionID
841 (OOH323CallData *call, OOCapType type, char *dir);
842
843 /**
844 * This is an handler for H245 connection retry timer. When remote end is not
845 * yet listening for H245 connections, this timer provides a wait and retry
846 * mechanism to establish H245 connection.
847 * @param data Timer callback data.
848 *
849 * @return OO_OK, on success. OO_FAILED, on failure
850 */
851 EXTERN int ooCallH245ConnectionRetryTimerExpired(void *data);
852
853 /**
854 * This function is used to retrieve the description text for a reason
855 * code.
856 *
857 * @param code Reason code.
858 * @return The text description string.
859 */
860 EXTERN const char* ooGetReasonCodeText (OOUINT32 code);
861
862 /**
863 * This function is used to retrieve the description text for a call
864 * state.
865 *
866 * @param callState Call state.
867 * @return The text description string.
868 */
869 EXTERN const char* ooGetCallStateText (OOCallState callState);
870
871 /**
872 * @}
873 */
874
875 int isRunning(char *callToken);
876
877 int ooCallAddG726Capability(struct OOH323CallData *call, int cap, int txframes,
878 int rxframes, OOBOOL silenceSuppression, int dir,
879 cb_StartReceiveChannel startReceiveChannel,
880 cb_StartTransmitChannel startTransmitChannel,
881 cb_StopReceiveChannel stopReceiveChannel,
882 cb_StopTransmitChannel stopTransmitChannel);
883 int ooCallAddAMRNBCapability(struct OOH323CallData *call, int cap, int txframes,
884 int rxframes, OOBOOL silenceSuppression, int dir,
885 cb_StartReceiveChannel startReceiveChannel,
886 cb_StartTransmitChannel startTransmitChannel,
887 cb_StopReceiveChannel stopReceiveChannel,
888 cb_StopTransmitChannel stopTransmitChannel);
889 int ooCallAddSpeexCapability(struct OOH323CallData *call, int cap, int txframes,
890 int rxframes, OOBOOL silenceSuppression, int dir,
891 cb_StartReceiveChannel startReceiveChannel,
892 cb_StartTransmitChannel startTransmitChannel,
893 cb_StopReceiveChannel stopReceiveChannel,
894 cb_StopTransmitChannel stopTransmitChannel);
895 int ooCallEnableDTMFCISCO(struct OOH323CallData *call, int dynamicRTPPayloadType);
896 int ooCallDisableDTMFCISCO(struct OOH323CallData *call);
897
898 #ifdef __cplusplus
899 }
900 #endif
901
902 #endif