aboutsummaryrefslogtreecommitdiffstats
path: root/addons/ooh323c/src/ooCapability.h
blob: 4e108cfd84a6693da813e0861b3d075009836dc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
/*
 * Copyright (C) 2004-2005 by Objective Systems, Inc.
 *
 * This software is furnished under an open source license and may be 
 * used and copied only in accordance with the terms of this license. 
 * The text of the license may generally be found in the root 
 * directory of this installation in the COPYING file.  It 
 * can also be viewed online at the following URL:
 *
 *   http://www.obj-sys.com/open/license.html
 *
 * Any redistributions of this file including modified versions must 
 * maintain this copyright notice.
 *
 *****************************************************************************/
/**
 * @file ooCapability.h 
 * This file contains Capability management functions. 
 */
#ifndef OO_CAPABILITY_H_
#define OO_CAPABILITY_H_
#include "ootypes.h"
#include "ooasn1.h"


#define OO_GSMFRAMESIZE 33 /* standard frame size for gsm is 33 bytes */

#define OORX      (1<<0)
#define OOTX      (1<<1)
#define OORXANDTX (1<<2)
#define OORXTX    (1<<3) /* For symmetric capabilities */
/* Various types of caps. Note that not all 
   supported */
typedef enum OOCapabilities{
   OO_CAP_AUDIO_BASE      = 0,
   OO_G726		  = 1,
   OO_G711ALAW64K         = 2,
   OO_G711ALAW56K         = 3,
   OO_G711ULAW64K         = 4,
   OO_G711ULAW56K         = 5,
   OO_G722_64k            = 6,
   OO_G722_56k            = 7,
   OO_G722_48k            = 8,
   OO_G7231               = 9,
   OO_G728                = 10,
   OO_G729                = 11,
   OO_G729A               = 12,
#if 0
   OO_IS11172_AUDIO       = 13,
   OO_IS13818_AUDIO       = 14,
#else
   OO_AMRNB		  = 13,
   OO_G726AAL2		  = 14,
#endif
   OO_G729B               = 15,
   OO_G729AB              = 16,
   OO_G7231C              = 17,
   OO_GSMFULLRATE         = 18,
   OO_GSMHALFRATE         = 19,
   OO_GSMENHANCEDFULLRATE = 20,
   OO_GENERICAUDIO        = 21,
   OO_G729EXT             = 22,
#if 0
   OO_AUDIO_VBD           = 23,
#else
   OO_SPEEX		  = 23,
#endif
   OO_AUDIOTELEPHONYEVENT = 24,
   OO_AUDIO_TONE          = 25,
   OO_EXTELEM1            = 26,
   OO_CAP_VIDEO_BASE      = 27,
   OO_NONSTDVIDEO         = 28,
   OO_H261VIDEO           = 29,
   OO_H262VIDEO           = 30,
   OO_H263VIDEO           = 31,
   OO_IS11172VIDEO        = 32,  /* mpeg */
   OO_GENERICVIDEO        = 33,
   OO_EXTELEMVIDEO        = 34,
   OO_T38		  = 35
} OOCapabilities;


/*DTMF capabilities*/
#define OO_CAP_DTMF_RFC2833              (1<<0)
#define OO_CAP_DTMF_Q931                 (1<<1)
#define OO_CAP_DTMF_H245_alphanumeric    (1<<2)
#define OO_CAP_DTMF_H245_signal          (1<<3)
#define OO_CAP_DTMF_CISCO		 (1<<4)

/**
 * This structure defines the preference order for capabilities.
 * 
 */
typedef struct OOCapPrefs {
  int order[20];
  int index;
}OOCapPrefs;

typedef struct OOCapParams {
   int txframes;  /*!< Number of frames per packet for transmission */
   int rxframes;  /*!< Number of frames per packet for reception */
   OOBOOL silenceSuppression; 
} OOCapParams;

typedef struct OOGSMCapParams {
   unsigned txframes; 
   unsigned rxframes;
   OOBOOL scrambled;
   OOBOOL comfortNoise;
} OOGSMCapParams;

typedef enum OOPictureFormat{
   OO_PICFORMAT_SQCIF,
   OO_PICFORMAT_QCIF,
   OO_PICFORMAT_CIF,
   OO_PICFORMAT_CIF4,
   OO_PICFORMAT_CIF16
}OOPictureFormat;

typedef struct OOH263CapParams {
   enum OOPictureFormat picFormat; /* !< One of sqcif, qcif, cif, cif4, cif16*/
   unsigned MPI; /* !< Minimum Picture Interval */
  unsigned maxBitRate; /* !< Maximum bit rate for transmission/reception in units of 100 bits/sec */
} OOH263CapParams;

struct OOH323CallData;
struct OOLogicalChannel;

#ifdef __cplusplus
extern "C" {
#endif

/** 
 * This callback is used for starting media receive channel. This callback
 * function is triggered when receive media channel has to be started.
 * @param call     Call for which receive media channel has to be started.
 * @param pChannel Channel details. This structure has important information
 *                 such as rtp ip:port and capability describing media type
 *                 to be received.
 * @return         OO_OK, on success. OO_FAILED, on failure
 */
typedef int (*cb_StartReceiveChannel)
     (struct OOH323CallData *call, struct OOLogicalChannel *pChannel);


/** 
 * This callback is used for starting media transmit channel. This callback
 * function is triggered when transmit media channel has to be started.
 * @param call     Call for which transmit media channel has to be started.
 * @param pChannel Channel details. This structure has important information
 *                 such as rtp ip:port and capability describing media type
 *                 to be transmitted.
 * @return         OO_OK, on success. OO_FAILED, on failure
 */
typedef int (*cb_StartTransmitChannel)
     (struct OOH323CallData *call, struct OOLogicalChannel *pChannel);

/** 
 * This callback is used for stopping media receive channel. This callback
 * function is triggered when receive media channel has to be stopped.
 * @param call     Call for which receive media channel has to be stopped.
 * @param pChannel Channel details. This structure has important information
 *                 such as rtp ip:port and capability describing media type
 *                 being received.
 * @return         OO_OK, on success. OO_FAILED, on failure
 */
typedef int (*cb_StopReceiveChannel)
     (struct OOH323CallData *call, struct OOLogicalChannel *pChannel);

/** 
 * This callback is used for stopping media transmit channel. This callback
 * function is triggered when transmit media channel has to be stopped.
 * @param call     Call for which transmit media channel has to be stopped.
 * @param pChannel Channel details. This structure has important information
 *                 such as rtp ip:port and capability describing media type
 *                 being transmitted.
 * @return         OO_OK, on success. OO_FAILED, on failure
 */
typedef int (*cb_StopTransmitChannel)
     (struct OOH323CallData *call, struct OOLogicalChannel *pChannel);

typedef enum OOCapType {
   OO_CAP_TYPE_AUDIO,
   OO_CAP_TYPE_VIDEO,
   OO_CAP_TYPE_DATA
} OOCapType;

/**
 * Structure to store information related to end point
 * capability
 */
typedef struct ooH323EpCapability {
   int dir; 
   int cap;
   OOCapType capType;
   void *params;
   cb_StartReceiveChannel startReceiveChannel;
   cb_StartTransmitChannel startTransmitChannel;
   cb_StopReceiveChannel stopReceiveChannel;
   cb_StopTransmitChannel stopTransmitChannel;
   struct ooH323EpCapability *next;
} ooH323EpCapability;




#ifndef EXTERN
#if defined (MAKE_DLL)
#define EXTERN __declspec(dllexport)
#else
#define EXTERN
#endif /* MAKE_DLL */
#endif /* EXTERN */

/** 
 * @defgroup capmgmt  Capability Management
 * @{
 */

/**
 * This function is used to add rfc2833 based dtmf detection capability
 * @param call                   Call if enabling for call, else null for 
 *                               endpoint.
 * @param dynamicRTPPayloadType  dynamicRTPPayloadType to be used.
 * @return                       OO_OK, on success. OO_FAILED, on failure.
 */
EXTERN int ooCapabilityEnableDTMFRFC2833
   (struct OOH323CallData *call, int dynamicRTPPayloadType);

/**
 * This function is used to remove rfc2833 dtmf detection capability.
 * @param call             Handle to call, if disabling for the call, else NULL
 *                         for end-point.
 * @return                 OO_OK, on success. OO_FAILED, on failure.
 */
EXTERN int ooCapabilityDisableDTMFRFC2833(struct OOH323CallData *call);


/**
 * This function is used to enable support for H.245 based alphanumeric dtmf 
 * capability.
 * @param call             Handle to call, if enabling for the call, else NULL
 *                         for end-point.
 * @return                 OO_OK, on success. OO_FAILED, on failure.
 */
EXTERN int ooCapabilityEnableDTMFH245Alphanumeric(struct OOH323CallData *call);

/**
 * This function is used to disable support for H.245 based alphanumeric dtmf 
 * capability.
 * @param call             Handle to call, if disabling for the call, else NULL
 *                         for end-point.
 * @return                 OO_OK, on success. OO_FAILED, on failure.
 */
EXTERN int ooCapabilityDisableDTMFH245Alphanumeric
                                             (struct OOH323CallData *call);

/**
 * This function is used to enable support for H.245 based signal dtmf 
 * capability.
 * @param call             Handle to call, if enabling for the call, else NULL
 *                         for end-point.
 * @return                 OO_OK, on success. OO_FAILED, on failure.
 */
EXTERN int ooCapabilityEnableDTMFH245Signal(struct OOH323CallData *call);

/**
 * This function is used to disable support for H.245 based signal dtmf 
 * capability.
 * @param call             Handle to call, if disabling for the call, else NULL
 *                         for end-point.
 * @return                 OO_OK, on success. OO_FAILED, on failure.
 */
EXTERN int ooCapabilityDisableDTMFH245Signal(struct OOH323CallData *call);

/**
 * This function is used to enable support for dtmf using Q.931 Keypad IE.
 * @param call             Handle to call, if enabling for the call, else NULL
 *                         for end-point.
 * @return                 OO_OK, on success. OO_FAILED, on failure.
 */
EXTERN int ooCapabilityEnableDTMFQ931Keypad(struct OOH323CallData *call);

/**
 * This function is used to disable support for dtmf using Q.931 Keypad IE.
 * @param call             Handle to call, if disabling for the call, else NULL
 *                         for end-point.
 * @return                 OO_OK, on success. OO_FAILED, on failure.
 */
EXTERN int ooCapabilityDisableDTMFQ931Keypad(struct OOH323CallData *call);

/**
 * This function is used to add simple capabilities which have only rxframes
 * and txframes parameters to the endpoint or call.(ex. G711, G728, G723.1, 
 * G729)
 * @param call                 Handle to a call. If this is not Null, then 
 *                             capability is added to call's remote enpoint 
 *                             capability list, else it is added to local H323 
 *                             endpoint list.
 * @param cap                  Type of G711 capability to be added.
 * @param txframes             Number of frames per packet for transmission. 
 * @param rxframes             Number of frames per packet for reception.
 * @param silenceSuppression   Indicates support for silence suppression.
 *                             Used only in case of g7231, otherwise ignored.
 * @param dir                  Direction of capability.OORX, OOTX, OORXANDTX
 * @param startReceiveChannel  Callback function to start receive channel.
 * @param startTransmitChannel Callback function to start transmit channel.
 * @param stopReceiveChannel   Callback function to stop receive channel.
 * @param stopTransmitChannel  Callback function to stop transmit channel.
 * @param remote               TRUE, if adding call's remote capability.
 *
 * @return                     OO_OK, on success. OO_FAILED, on failure.
 */
EXTERN int ooCapabilityAddSimpleCapability
   (struct OOH323CallData *call, int cap, int txframes, int rxframes, 
    OOBOOL silenceSuppression, int dir, 
    cb_StartReceiveChannel startReceiveChannel,
    cb_StartTransmitChannel startTransmitChannel,
    cb_StopReceiveChannel stopReceiveChannel,
    cb_StopTransmitChannel stopTransmitChannel,
    OOBOOL remote);


/**
 * This is an internal helper function which is used to add a GSM capability
 * to local endpoints capability list or to remote endpoints capability list or
 * to a call's capability list.
 * @param call                 Handle to a call. If this is not Null, then 
 *                             capability is added to call's remote enpoint 
 *                             capability list, else it is added to local H323 
 *                             endpoint list.
 * @param cap                  Type of GSM capability to be added.
 * @param framesPerPkt         Number of GSM frames per packet. 
 * @param comfortNoise         Comfort noise spec for the capability. 
 * @param scrambled            Scrambled enabled/disabled for the capability.
 * @param dir                  Direction of capability.OORX, OOTX, OORXANDTX
 * @param startReceiveChannel  Callback function to start receive channel.
 * @param startTransmitChannel Callback function to start transmit channel.
 * @param stopReceiveChannel   Callback function to stop receive channel.
 * @param stopTransmitChannel  Callback function to stop transmit channel.
 * @param remote               TRUE, if adding call's remote capabilities.
 *
 * @return                     OO_OK, on success. OO_FAILED, on failure. 
 */
int ooCapabilityAddGSMCapability(struct OOH323CallData *call, int cap, 
                                unsigned framesPerPkt, OOBOOL comfortNoise,
                                OOBOOL scrambled, int dir, 
                                cb_StartReceiveChannel startReceiveChannel,
                                cb_StartTransmitChannel startTransmitChannel,
                                cb_StopReceiveChannel stopReceiveChannel,
                                cb_StopTransmitChannel stopTransmitChannel, 
                                OOBOOL remote);


/**
 * This function is used to add H263 video capability to local endpoints 
 * capability list or to remote endpoints capability list or to a call's 
 * capability list.
 * @param call                 Handle to a call. If this is not Null, then 
 *                             capability is added to call's remote enpoint 
 *                             capability list, else it is added to local H323 
 *                             endpoint list.
 * @param sqcifMPI             Minimum picture interval for encoding/decoding 
 *                             of SQCIF pictures.
 * @param qcifMPI              Minimum picture interval for encoding/decoding 
 *                             of QCIF pictures.
 * @param cifMPI               Minimum picture interval for encoding/decoding 
 *                             of CIF pictures.
 * @param cif4MPI              Minimum picture interval for encoding/decoding 
 *                             of CIF4 pictures.
 * @param cif16MPI             Minimum picture interval for encoding/decoding 
 *                             of CIF16 pictures.
 * @param maxBitRate           Maximum bit rate in units of 100 bits/s at
 *                             which a transmitter can transmit video or a 
 *                             receiver can receive video.
 * @param dir                  Direction of capability.OORX, OOTX, OORXANDTX
 * @param startReceiveChannel  Callback function to start receive channel.
 * @param startTransmitChannel Callback function to start transmit channel.
 * @param stopReceiveChannel   Callback function to stop receive channel.
 * @param stopTransmitChannel  Callback function to stop transmit channel.
 * @param remote               TRUE, if adding call's remote capabilities.
 *
 * @return                     OO_OK, on success. OO_FAILED, on failure. 
 */
EXTERN int ooCapabilityAddH263VideoCapability(struct OOH323CallData *call, 
                               unsigned sqcifMPI, unsigned qcifMPI, 
                               unsigned cifMPI, unsigned cif4MPI, 
                               unsigned cif16MPI, unsigned maxBitRate, int dir,
                               cb_StartReceiveChannel startReceiveChannel,
                               cb_StartTransmitChannel startTransmitChannel,
                               cb_StopReceiveChannel stopReceiveChannel,
                               cb_StopTransmitChannel stopTransmitChannel, 
                               OOBOOL remote);


/**
 * This function is an helper function to ooCapabilityAddH263VideoCapability.
 * @param call                 Handle to a call. If this is not Null, then 
 *                             capability is added to call's remote enpoint 
 *                             capability list, else it is added to local H323 
 *                             endpoint list.
 * @param sqcifMPI             Minimum picture interval for encoding/decoding 
 *                             of SQCIF pictures.
 * @param qcifMPI              Minimum picture interval for encoding/decoding 
 *                             of QCIF pictures.
 * @param cifMPI               Minimum picture interval for encoding/decoding 
 *                             of CIF pictures.
 * @param cif4MPI              Minimum picture interval for encoding/decoding 
 *                             of CIF4 pictures.
 * @param cif16MPI             Minimum picture interval for encoding/decoding 
 *                             of CIF16 pictures.
 * @param maxBitRate           Maximum bit rate in units of 100 bits/s at
 *                             which a transmitter can transmit video or a 
 *                             receiver can receive video.
 * @param dir                  Direction of capability.OORX, OOTX, OORXANDTX
 * @param startReceiveChannel  Callback function to start receive channel.
 * @param startTransmitChannel Callback function to start transmit channel.
 * @param stopReceiveChannel   Callback function to stop receive channel.
 * @param stopTransmitChannel  Callback function to stop transmit channel.
 * @param remote               TRUE, if adding call's remote capabilities.
 *
 * @return                     OO_OK, on success. OO_FAILED, on failure. 
 */
int ooCapabilityAddH263VideoCapability_helper(struct OOH323CallData *call, 
                              unsigned sqcifMPI, unsigned qcifMPI, 
                              unsigned cifMPI, unsigned cif4MPI, 
                              unsigned cif16MPI, unsigned maxBitRate, int dir, 
                              cb_StartReceiveChannel startReceiveChannel,
                              cb_StartTransmitChannel startTransmitChannel,
                              cb_StopReceiveChannel stopReceiveChannel,
                              cb_StopTransmitChannel stopTransmitChannel, 
                              OOBOOL remote);

/**
 * This function is used to add a audio capability to calls remote  
 * capability list.
 * @param call                Handle to the call.
 * @param audioCap            Handle to the remote endpoint's audio capability.
 * @param dir                 Direction in which capability is supported by 
 *                            remote endpoint.
 *
 * @return                    OO_OK, on success. OO_FAILED, otherwise.
 */
int ooAddRemoteAudioCapability(struct OOH323CallData *call,
                               H245AudioCapability *audioCap, int dir);


/**
 * This function is used to add a capability to call's remote  capability list.
 * The capabilities to be added are extracted from received TCS message.
 * @param call           Handle to the call.
 * @param cap            Handle to the remote endpoint's H245 capability.
 *
 * @return               OO_OK, on success. OO_FAILED, otherwise.
 */
int ooAddRemoteCapability(struct OOH323CallData *call, H245Capability *cap);

/**
 * This function is used to update joint capabilities for call. It checks
 * whether remote capability can be supported by local capabilities for the
 * call and if supported makes entry into the joint capability list for the 
 * call.
 * @param call           Handle to the call
 * @param cap            Remote cap which will be tested for compatibility.
 *
 * @return               returns OO_OK, if updated else OO_FAILED;  
 */
EXTERN int ooCapabilityUpdateJointCapabilities
   (struct OOH323CallData* call, H245Capability *cap);


/**
 * This function is used to update joint video capabilities for call. It checks
 * whether remote capability can be supported by local capabilities for the
 * call and if supported makes entry into the joint capability list for the 
 * call.
 * @param call           Handle to the call
 * @param videoCap       Remote video capability which will be tested for 
 *                       compatibility.
 * @param dir            Direction of the capability
 *
 * @return               returns OO_OK, if updated else OO_FAILED;  
 */
EXTERN int ooCapabilityUpdateJointCapabilitiesVideo
   (struct OOH323CallData *call, H245VideoCapability *videoCap, int dir);


/**
 * This function is used to update joint video H263 capabilities for call. It 
 * checks whether remote capability can be supported by local capabilities for 
 * the call and if supported makes entry into the joint capability list for the
 * call.
 * @param call           Handle to the call
 * @param pH263Cap       Remote H263 video capability which will be tested for 
 *                       compatibility.
 * @param dir            Direction of the H263 capability
 *
 * @return               returns OO_OK, if updated else OO_FAILED;  
 */
EXTERN int ooCapabilityUpdateJointCapabilitiesVideoH263
   (struct OOH323CallData *call, H245H263VideoCapability *pH263Cap, int dir);


/**
 * This function is used to test whether the endpoint capability in the 
 * specified direction can be supported by the audio capability.
 * @param call               Handle to the call.
 * @param epCap              Endpoint capability.
 * @param dataType           Data type with which compatibility has to 
 *                           be tested.
 * @param dir                Direction indicating whether endpoint capability
 *                           will be used for transmission or reception.
 *
 * @return                   TRUE, if compatible. FALSE, otherwise. 
 */

ASN1BOOL ooCapabilityCheckCompatibility(struct OOH323CallData *call, 
                                        ooH323EpCapability *epCap, 
                                        H245DataType *dataType, int dir);


/**
 * This function is used to create a audio capability structure using the
 * capability type.
 * @param epCap       Capability.
 * @param pctxt       Handle to OOCTXT which will be used to allocate memory 
 *                    for new audio capability.
 * @param dir         Direction in which the newly created capability will be 
 *                    used.
 *
 * @return            Newly created audio capability on success, NULL on 
 *                    failure.
 */
struct H245AudioCapability* ooCapabilityCreateAudioCapability 
(ooH323EpCapability* epCap, OOCTXT *pctxt, int dir);

/**
 * This function is used to create a video capability structure using the
 * capability type.
 * @param epCap       Capability.
 * @param pctxt       Handle to OOCTXT which will be used to allocate memory 
 *                    for new video capability.
 * @param dir         Direction in which the newly created capability will be 
 *                    used.
 *
 * @return            Newly created video capability on success, NULL on 
 *                    failure.
 */
struct H245VideoCapability* ooCapabilityCreateVideoCapability
   (ooH323EpCapability *epCap, OOCTXT *pctxt, int dir);


/**
 * This function is used to create a dtmf capability which can be added to
 * a TCS message.
 * @param cap         Type of dtmf capability to be created.
 * @param pctxt       Pointer to OOCTXT structure to be used for memory 
 *                    allocation.
 *
 * @return            Pointer to the created DTMF capability, NULL in case of
 *                    failure.
 */
void * ooCapabilityCreateDTMFCapability(int cap, int dtmfcodec, OOCTXT *pctxt);


/**
 * This function is used to create a GSM Full Rate capability structure.
 * @param epCap       Handle to the endpoint capability.
 * @param pctxt       Handle to OOCTXT which will be used to allocate memory
 *                    for new audio capability.
 * @param dir         Direction for the newly created capability.
 *
 * @return            Newly created audio capability on success, NULL on 
 *                    failure.
 */
struct H245AudioCapability* ooCapabilityCreateGSMFullRateCapability
   (ooH323EpCapability *epCap, OOCTXT* pctxt, int dir);

/**
 * This function is used to create a simple(g711, g728, g723.1, g729) audio 
 * capability structure.
 *
 * @param epCap       Handle to the endpoint capability
 * @param pctxt       Handle to OOCTXT which will be used to allocate memory 
 *                    for new audio capability.
 * @param dir         Direction in which the newly created capability will be 
 *                    used.
 *
 * @return            Newly created audio capability on success, NULL on 
 *                    failure.
 */
struct H245AudioCapability* ooCapabilityCreateSimpleCapability
   (ooH323EpCapability *epCap, OOCTXT* pctxt, int dir);
struct H245AudioCapability* ooCapabilityCreateNonStandardCapability
   (ooH323EpCapability *epCap, OOCTXT* pctxt, int dir);


/**
 * This function is used to create a H263 video capability 
 * structure.
 * @param epCap       Handle to the endpoint capability
 * @param pctxt       Handle to OOCTXT which will be used to allocate memory 
 *                    for new video capability.
 * @param dir         Direction in which the newly created capability will be 
 *                    used.
 *
 * @return            Newly created video capability on success, NULL on 
 *                    failure.
 */
struct H245VideoCapability* ooCapabilityCreateH263VideoCapability
(ooH323EpCapability *epCap, OOCTXT* pctxt, int dir);


/**
 * This function is used to determine whether a particular capability
 * can be supported by the endpoint.
 * @param call       Handle to the call.
 * @param audioCap   Handle to the audio capability.
 * @param dir        Direction in which support is desired. 
 *
 * @return          Handle to the copyof capability which supports audioCap, 
 *                  Null if none found
 */
ooH323EpCapability* ooIsAudioDataTypeSupported
(struct OOH323CallData *call, H245AudioCapability* audioCap, int dir);

/**
 * This function is used to determine whether a particular video capability
 * can be supported by the endpoint.
 * @param call       Handle to the call.
 * @param pVideoCap  Handle to the  video capability.
 * @param dir        Direction in which support is desired. 
 *
 * @return          Handle to the copy of capability which supports video 
 *                  capability, Null if none found
 */
ooH323EpCapability* ooIsVideoDataTypeSupported
   (struct OOH323CallData *call, H245VideoCapability* pVideoCap, int dir);

/**
 * This function is used to determine whether a particular H263 capability
 * can be supported by the endpoint.
 * @param call       Handle to the call.
 * @param pH263Cap   Handle to the H263 video capability.
 * @param dir        Direction in which support is desired. 
 * @param picFormat  Picture type(cif, qcif etc.)
 *
 * @return          Handle to the copy of capability which supports H263 
 *                  capability, Null if none found
 */
ooH323EpCapability* ooIsVideoDataTypeH263Supported
   (struct OOH323CallData *call, H245H263VideoCapability* pH263Cap, int dir, 
    OOPictureFormat picFormat);

/**
 * This function is used to determine whether a particular capability type
 * can be supported by the endpoint.
 * @param call       Handle to the call.
 * @param data       Handle to the capability type.
 * @param dir        Direction in which support is desired. 
 *
 * @return          Handle to the copy of capability which supports specified 
 *                  capability type, Null if none found
 */
ooH323EpCapability* ooIsDataTypeSupported
(struct OOH323CallData *call, H245DataType *data, int dir);

/* fill t.38 application data */
H245DataMode_application* ooCreateT38ApplicationData
                                (OOCTXT* pctxt, H245DataMode_application *app);

H245DataApplicationCapability* ooCapabilityCreateT38Capability
   (ooH323EpCapability *epCap, OOCTXT* pctxt, int dir);


/**
 * This function is used to clear the capability preference order.
 * @param call      Handle to call, if capability preference order for call
 *                  has to be cleared, NULL for endpoint.
 *
 * @return          OO_OK, on success. OO_FAILED, on failure
 */
EXTERN  int ooResetCapPrefs(struct OOH323CallData *call);

/**
 * This function is used to remove a particular capability from preference
 * list.
 * @param call     Handle to call, if call's preference list has to be modified
 *                 else NULL, to modify endpoint's preference list.
 * @param cap      Capability to be removed
 *
 * @return         OO_OK, on success. OO_FAILED, otherwise.
 */
EXTERN  int ooRemoveCapFromCapPrefs(struct OOH323CallData *call, int cap);

/**
 * This function is used to append a particular capability to preference
 * list.
 * @param call     Handle to call, if call's preference list has to be modified
 *                 else NULL, to modify endpoint's preference list.
 * @param cap      Capability to be appended.
 *
 * @return         OO_OK, on success. OO_FAILED, otherwise.
 */
EXTERN int ooAppendCapToCapPrefs(struct OOH323CallData *call, int cap);

/**
 * This function is used to change preference order of a particular capability 
 * in the preference list.
 * @param call     Handle to call, if call's preference list has to be modified
 *                 else NULL, to modify endpoint's preference list.
 * @param cap      Capability concerned
 * @param pos      New position in the preference order
 *
 * @return         OO_OK, on success. OO_FAILED, otherwise.
 */
EXTERN int ooChangeCapPrefOrder(struct OOH323CallData *call, int cap, int pos);

/**
 * This function is used to preppend a particular capability to preference
 * list.
 * @param call     Handle to call, if call's preference list has to be modified
 *                 else NULL, to modify endpoint's preference list.
 * @param cap      Capability to be preppended.
 *
 * @return         OO_OK, on success. OO_FAILED, otherwise.
 */
EXTERN int ooPreppendCapToCapPrefs(struct OOH323CallData *call, int cap);

/**
 * This function is used to retrieve the text description for a capability
 * type.
 * @param cap     Capability
 * @return        The text description string.
 */
EXTERN const char* ooGetCapTypeText (OOCapabilities cap);


EXTERN int epCapIsPreferred(struct OOH323CallData *call, ooH323EpCapability *epCap);

/**/
ASN1BOOL ooCapabilityCheckCompatibility_Simple
   (struct OOH323CallData *call, ooH323EpCapability* epCap,
    H245AudioCapability* audioCap, int dir);
ASN1BOOL ooCapabilityCheckCompatibility_NonStandard
   (struct OOH323CallData *call, ooH323EpCapability* epCap,
    H245AudioCapability* audioCap, int dir);
OOBOOL ooCapabilityCheckCompatibility_GSM
   (struct OOH323CallData *call, ooH323EpCapability* epCap,
    H245AudioCapability* audioCap, int dir);
OOBOOL ooCapabilityCheckCompatibility_T38
   (struct OOH323CallData *call, ooH323EpCapability* epCap,
    H245DataApplicationCapability* t38Cap, int dir);
OOBOOL ooCapabilityCheckCompatibility_H263Video
   (struct OOH323CallData *call, ooH323EpCapability *epCap,
    H245VideoCapability *pVideoCap, int dir);
OOBOOL ooCapabilityCheckCompatibility_Audio
   (struct OOH323CallData *call, ooH323EpCapability* epCap,
    H245AudioCapability* audioCap, int dir);
OOBOOL ooCapabilityCheckCompatibility_Video
   (struct OOH323CallData *call, ooH323EpCapability* epCap,
    H245VideoCapability* videoCap, int dir);
ooH323EpCapability* ooIsAudioDataTypeGSMSupported
   (struct OOH323CallData *call, H245AudioCapability* audioCap, int dir);
ooH323EpCapability* ooIsAudioDataTypeSimpleSupported
   (struct OOH323CallData *call, H245AudioCapability* audioCap, int dir);
ooH323EpCapability* ooIsT38Supported
   (struct OOH323CallData *call, H245DataApplicationCapability* t38Cap, int dir);
ooH323EpCapability* ooIsAudioDataTypeNonStandardSupported
   (struct OOH323CallData *call, H245AudioCapability* audioCap, int dir);
int ooAddRemoteDataApplicationCapability(struct OOH323CallData *call,
                               H245DataApplicationCapability *dataCap,
                               int dir);
int ooCapabilityEnableDTMFCISCO
   (struct OOH323CallData *call, int dynamicRTPPayloadType);
int ooCapabilityDisableDTMFCISCO(struct OOH323CallData *call);
int ooCapabilityAddT38Capability
   (struct OOH323CallData *call, int cap, int dir,
    cb_StartReceiveChannel startReceiveChannel,
    cb_StartTransmitChannel startTransmitChannel,
    cb_StopReceiveChannel stopReceiveChannel,
    cb_StopTransmitChannel stopTransmitChannel,
    OOBOOL remote);


/**/


/** 
 * @} 
 */
#ifdef __cplusplus
}
#endif

#endif