Changeset 5923 for pjproject


Ignore:
Timestamp:
Dec 13, 2018 6:57:23 AM (6 months ago)
Author:
nanang
Message:

Re #2168:

  • Added a new PJSUA callback on_media_event().
  • Added audio device error handling into PJSUA2.
Location:
pjproject/trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/include/pjmedia/event.h

    r5920 r5923  
    2424 * @brief Event framework 
    2525 */ 
     26#include <pjmedia/audiodev.h> 
    2627#include <pjmedia/format.h> 
    2728#include <pjmedia/signatures.h> 
  • pjproject/trunk/pjsip-apps/src/swig/symbols.i

    r5834 r5923  
    33typedef int pj_status_t; 
    44 
    5 enum pj_constants_ {PJ_SUCCESS = 0, PJ_TRUE = 1, PJ_FALSE = 0}; 
     5enum pj_constants_ 
     6{ 
     7  PJ_SUCCESS = 0, 
     8  PJ_TRUE = 1, 
     9  PJ_FALSE = 0 
     10}; 
    611 
    712typedef unsigned char pj_uint8_t; 
     
    1318typedef unsigned short pj_uint16_t; 
    1419 
    15 enum pj_file_access {PJ_O_RDONLY = 0x1101, PJ_O_WRONLY = 0x1102, PJ_O_RDWR = 0x1103, PJ_O_APPEND = 0x1108}; 
    16  
    17 enum pj_log_decoration {PJ_LOG_HAS_DAY_NAME = 1, PJ_LOG_HAS_YEAR = 2, PJ_LOG_HAS_MONTH = 4, PJ_LOG_HAS_DAY_OF_MON = 8, PJ_LOG_HAS_TIME = 16, PJ_LOG_HAS_MICRO_SEC = 32, PJ_LOG_HAS_SENDER = 64, PJ_LOG_HAS_NEWLINE = 128, PJ_LOG_HAS_CR = 256, PJ_LOG_HAS_SPACE = 512, PJ_LOG_HAS_COLOR = 1024, PJ_LOG_HAS_LEVEL_TEXT = 2048, PJ_LOG_HAS_THREAD_ID = 4096, PJ_LOG_HAS_THREAD_SWC = 8192, PJ_LOG_HAS_INDENT = 16384}; 
    18  
    19 typedef enum pj_qos_type {PJ_QOS_TYPE_BEST_EFFORT, PJ_QOS_TYPE_BACKGROUND, PJ_QOS_TYPE_VIDEO, PJ_QOS_TYPE_VOICE, PJ_QOS_TYPE_CONTROL, PJ_QOS_TYPE_SIGNALLING} pj_qos_type; 
    20  
    21 typedef enum pj_qos_flag {PJ_QOS_PARAM_HAS_DSCP = 1, PJ_QOS_PARAM_HAS_SO_PRIO = 2, PJ_QOS_PARAM_HAS_WMM = 4} pj_qos_flag; 
    22  
    23 typedef enum pj_qos_wmm_prio {PJ_QOS_WMM_PRIO_BULK_EFFORT, PJ_QOS_WMM_PRIO_BULK, PJ_QOS_WMM_PRIO_VIDEO, PJ_QOS_WMM_PRIO_VOICE} pj_qos_wmm_prio; 
     20enum pj_file_access 
     21{ 
     22  PJ_O_RDONLY = 0x1101, 
     23  PJ_O_WRONLY = 0x1102, 
     24  PJ_O_RDWR = 0x1103, 
     25  PJ_O_APPEND = 0x1108 
     26}; 
     27 
     28enum pj_log_decoration 
     29{ 
     30  PJ_LOG_HAS_DAY_NAME = 1, 
     31  PJ_LOG_HAS_YEAR = 2, 
     32  PJ_LOG_HAS_MONTH = 4, 
     33  PJ_LOG_HAS_DAY_OF_MON = 8, 
     34  PJ_LOG_HAS_TIME = 16, 
     35  PJ_LOG_HAS_MICRO_SEC = 32, 
     36  PJ_LOG_HAS_SENDER = 64, 
     37  PJ_LOG_HAS_NEWLINE = 128, 
     38  PJ_LOG_HAS_CR = 256, 
     39  PJ_LOG_HAS_SPACE = 512, 
     40  PJ_LOG_HAS_COLOR = 1024, 
     41  PJ_LOG_HAS_LEVEL_TEXT = 2048, 
     42  PJ_LOG_HAS_THREAD_ID = 4096, 
     43  PJ_LOG_HAS_THREAD_SWC = 8192, 
     44  PJ_LOG_HAS_INDENT = 16384 
     45}; 
     46 
     47typedef enum pj_qos_type 
     48{ 
     49  PJ_QOS_TYPE_BEST_EFFORT, 
     50  PJ_QOS_TYPE_BACKGROUND, 
     51  PJ_QOS_TYPE_VIDEO, 
     52  PJ_QOS_TYPE_VOICE, 
     53  PJ_QOS_TYPE_CONTROL, 
     54  PJ_QOS_TYPE_SIGNALLING 
     55} pj_qos_type; 
     56 
     57typedef enum pj_qos_flag 
     58{ 
     59  PJ_QOS_PARAM_HAS_DSCP = 1, 
     60  PJ_QOS_PARAM_HAS_SO_PRIO = 2, 
     61  PJ_QOS_PARAM_HAS_WMM = 4 
     62} pj_qos_flag; 
     63 
     64typedef enum pj_qos_wmm_prio 
     65{ 
     66  PJ_QOS_WMM_PRIO_BULK_EFFORT, 
     67  PJ_QOS_WMM_PRIO_BULK, 
     68  PJ_QOS_WMM_PRIO_VIDEO, 
     69  PJ_QOS_WMM_PRIO_VOICE 
     70} pj_qos_wmm_prio; 
    2471 
    2572typedef struct pj_qos_params 
     
    3178} pj_qos_params; 
    3279 
    33 typedef enum pj_ssl_cipher {PJ_TLS_UNKNOWN_CIPHER = -1, PJ_TLS_NULL_WITH_NULL_NULL = 0x00000000, PJ_TLS_RSA_WITH_NULL_MD5 = 0x00000001, PJ_TLS_RSA_WITH_NULL_SHA = 0x00000002, PJ_TLS_RSA_WITH_NULL_SHA256 = 0x0000003B, PJ_TLS_RSA_WITH_RC4_128_MD5 = 0x00000004, PJ_TLS_RSA_WITH_RC4_128_SHA = 0x00000005, PJ_TLS_RSA_WITH_3DES_EDE_CBC_SHA = 0x0000000A, PJ_TLS_RSA_WITH_AES_128_CBC_SHA = 0x0000002F, PJ_TLS_RSA_WITH_AES_256_CBC_SHA = 0x00000035, PJ_TLS_RSA_WITH_AES_128_CBC_SHA256 = 0x0000003C, PJ_TLS_RSA_WITH_AES_256_CBC_SHA256 = 0x0000003D, PJ_TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA = 0x0000000D, PJ_TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA = 0x00000010, PJ_TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA = 0x00000013, PJ_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 0x00000016, PJ_TLS_DH_DSS_WITH_AES_128_CBC_SHA = 0x00000030, PJ_TLS_DH_RSA_WITH_AES_128_CBC_SHA = 0x00000031, PJ_TLS_DHE_DSS_WITH_AES_128_CBC_SHA = 0x00000032, PJ_TLS_DHE_RSA_WITH_AES_128_CBC_SHA = 0x00000033, PJ_TLS_DH_DSS_WITH_AES_256_CBC_SHA = 0x00000036, PJ_TLS_DH_RSA_WITH_AES_256_CBC_SHA = 0x00000037, PJ_TLS_DHE_DSS_WITH_AES_256_CBC_SHA = 0x00000038, PJ_TLS_DHE_RSA_WITH_AES_256_CBC_SHA = 0x00000039, PJ_TLS_DH_DSS_WITH_AES_128_CBC_SHA256 = 0x0000003E, PJ_TLS_DH_RSA_WITH_AES_128_CBC_SHA256 = 0x0000003F, PJ_TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 = 0x00000040, PJ_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 = 0x00000067, PJ_TLS_DH_DSS_WITH_AES_256_CBC_SHA256 = 0x00000068, PJ_TLS_DH_RSA_WITH_AES_256_CBC_SHA256 = 0x00000069, PJ_TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 = 0x0000006A, PJ_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 = 0x0000006B, PJ_TLS_DH_anon_WITH_RC4_128_MD5 = 0x00000018, PJ_TLS_DH_anon_WITH_3DES_EDE_CBC_SHA = 0x0000001B, PJ_TLS_DH_anon_WITH_AES_128_CBC_SHA = 0x00000034, PJ_TLS_DH_anon_WITH_AES_256_CBC_SHA = 0x0000003A, PJ_TLS_DH_anon_WITH_AES_128_CBC_SHA256 = 0x0000006C, PJ_TLS_DH_anon_WITH_AES_256_CBC_SHA256 = 0x0000006D, PJ_TLS_RSA_EXPORT_WITH_RC4_40_MD5 = 0x00000003, PJ_TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 = 0x00000006, PJ_TLS_RSA_WITH_IDEA_CBC_SHA = 0x00000007, PJ_TLS_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x00000008, PJ_TLS_RSA_WITH_DES_CBC_SHA = 0x00000009, PJ_TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA = 0x0000000B, PJ_TLS_DH_DSS_WITH_DES_CBC_SHA = 0x0000000C, PJ_TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x0000000E, PJ_TLS_DH_RSA_WITH_DES_CBC_SHA = 0x0000000F, PJ_TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA = 0x00000011, PJ_TLS_DHE_DSS_WITH_DES_CBC_SHA = 0x00000012, PJ_TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x00000014, PJ_TLS_DHE_RSA_WITH_DES_CBC_SHA = 0x00000015, PJ_TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 = 0x00000017, PJ_TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA = 0x00000019, PJ_TLS_DH_anon_WITH_DES_CBC_SHA = 0x0000001A, PJ_SSL_FORTEZZA_KEA_WITH_NULL_SHA = 0x0000001C, PJ_SSL_FORTEZZA_KEA_WITH_FORTEZZA_CBC_SHA = 0x0000001D, PJ_SSL_FORTEZZA_KEA_WITH_RC4_128_SHA = 0x0000001E, PJ_SSL_CK_RC4_128_WITH_MD5 = 0x00010080, PJ_SSL_CK_RC4_128_EXPORT40_WITH_MD5 = 0x00020080, PJ_SSL_CK_RC2_128_CBC_WITH_MD5 = 0x00030080, PJ_SSL_CK_RC2_128_CBC_EXPORT40_WITH_MD5 = 0x00040080, PJ_SSL_CK_IDEA_128_CBC_WITH_MD5 = 0x00050080, PJ_SSL_CK_DES_64_CBC_WITH_MD5 = 0x00060040, PJ_SSL_CK_DES_192_EDE3_CBC_WITH_MD5 = 0x000700C0} pj_ssl_cipher; 
    34  
    35 typedef enum pj_ssl_sock_proto {PJ_SSL_SOCK_PROTO_DEFAULT = 0, PJ_SSL_SOCK_PROTO_SSL2 = 1 << 0, PJ_SSL_SOCK_PROTO_SSL3 = 1 << 1, PJ_SSL_SOCK_PROTO_TLS1 = 1 << 2, PJ_SSL_SOCK_PROTO_TLS1_1 = 1 << 3, PJ_SSL_SOCK_PROTO_TLS1_2 = 1 << 4, PJ_SSL_SOCK_PROTO_SSL23 = (1 << 16) - 1, PJ_SSL_SOCK_PROTO_DTLS1 = 1 << 16} pj_ssl_sock_proto; 
    36  
    37 typedef enum pj_ssl_cert_name_type {PJ_SSL_CERT_NAME_UNKNOWN = 0, PJ_SSL_CERT_NAME_RFC822, PJ_SSL_CERT_NAME_DNS, PJ_SSL_CERT_NAME_URI, PJ_SSL_CERT_NAME_IP} pj_ssl_cert_name_type; 
    38  
    39 typedef enum pj_ssl_cert_verify_flag_t {PJ_SSL_CERT_ESUCCESS = 0, PJ_SSL_CERT_EISSUER_NOT_FOUND = 1 << 0, PJ_SSL_CERT_EUNTRUSTED = 1 << 1, PJ_SSL_CERT_EVALIDITY_PERIOD = 1 << 2, PJ_SSL_CERT_EINVALID_FORMAT = 1 << 3, PJ_SSL_CERT_EINVALID_PURPOSE = 1 << 4, PJ_SSL_CERT_EISSUER_MISMATCH = 1 << 5, PJ_SSL_CERT_ECRL_FAILURE = 1 << 6, PJ_SSL_CERT_EREVOKED = 1 << 7, PJ_SSL_CERT_ECHAIN_TOO_LONG = 1 << 8, PJ_SSL_CERT_EIDENTITY_NOT_MATCH = 1 << 30, PJ_SSL_CERT_EUNKNOWN = 1 << 31} pj_ssl_cert_verify_flag_t; 
    40  
    41 typedef enum pj_stun_nat_type {PJ_STUN_NAT_TYPE_UNKNOWN, PJ_STUN_NAT_TYPE_ERR_UNKNOWN, PJ_STUN_NAT_TYPE_OPEN, PJ_STUN_NAT_TYPE_BLOCKED, PJ_STUN_NAT_TYPE_SYMMETRIC_UDP, PJ_STUN_NAT_TYPE_FULL_CONE, PJ_STUN_NAT_TYPE_SYMMETRIC, PJ_STUN_NAT_TYPE_RESTRICTED, PJ_STUN_NAT_TYPE_PORT_RESTRICTED} pj_stun_nat_type; 
    42  
    43 typedef enum pj_turn_tp_type {PJ_TURN_TP_UDP = 17, PJ_TURN_TP_TCP = 6, PJ_TURN_TP_TLS = 255} pj_turn_tp_type; 
    44  
    45 typedef enum pjmedia_event_type {PJMEDIA_EVENT_NONE, PJMEDIA_EVENT_FMT_CHANGED = ((('H' << 24) | ('C' << 16)) | ('M' << 8)) | 'F', PJMEDIA_EVENT_WND_CLOSING = ((('L' << 24) | ('C' << 16)) | ('N' << 8)) | 'W', PJMEDIA_EVENT_WND_CLOSED = ((('O' << 24) | ('C' << 16)) | ('N' << 8)) | 'W', PJMEDIA_EVENT_WND_RESIZED = ((('Z' << 24) | ('R' << 16)) | ('N' << 8)) | 'W', PJMEDIA_EVENT_MOUSE_BTN_DOWN = ((('N' << 24) | ('D' << 16)) | ('S' << 8)) | 'M', PJMEDIA_EVENT_KEYFRAME_FOUND = ((('F' << 24) | ('R' << 16)) | ('F' << 8)) | 'I', PJMEDIA_EVENT_KEYFRAME_MISSING = ((('M' << 24) | ('R' << 16)) | ('F' << 8)) | 'I', PJMEDIA_EVENT_ORIENT_CHANGED = ((('T' << 24) | ('N' << 16)) | ('R' << 8)) | 'O'} pjmedia_event_type; 
    46  
    47 typedef enum pjmedia_srtp_use {PJMEDIA_SRTP_DISABLED, PJMEDIA_SRTP_OPTIONAL, PJMEDIA_SRTP_MANDATORY} pjmedia_srtp_use; 
    48  
    49 typedef enum pjmedia_srtp_crypto_option {PJMEDIA_SRTP_NO_ENCRYPTION = 1, PJMEDIA_SRTP_NO_AUTHENTICATION = 2} pjmedia_srtp_crypto_option; 
    50  
    51 typedef enum pjmedia_srtp_keying_method {PJMEDIA_SRTP_KEYING_SDES, PJMEDIA_SRTP_KEYING_DTLS_SRTP, PJMEDIA_SRTP_KEYINGS_COUNT} pjmedia_srtp_keying_method; 
    52  
    53 typedef enum pjmedia_vid_stream_rc_method {PJMEDIA_VID_STREAM_RC_NONE = 0, PJMEDIA_VID_STREAM_RC_SIMPLE_BLOCKING = 1} pjmedia_vid_stream_rc_method; 
     80typedef enum pj_ssl_cipher 
     81{ 
     82  PJ_TLS_UNKNOWN_CIPHER = -1, 
     83  PJ_TLS_NULL_WITH_NULL_NULL = 0x00000000, 
     84  PJ_TLS_RSA_WITH_NULL_MD5 = 0x00000001, 
     85  PJ_TLS_RSA_WITH_NULL_SHA = 0x00000002, 
     86  PJ_TLS_RSA_WITH_NULL_SHA256 = 0x0000003B, 
     87  PJ_TLS_RSA_WITH_RC4_128_MD5 = 0x00000004, 
     88  PJ_TLS_RSA_WITH_RC4_128_SHA = 0x00000005, 
     89  PJ_TLS_RSA_WITH_3DES_EDE_CBC_SHA = 0x0000000A, 
     90  PJ_TLS_RSA_WITH_AES_128_CBC_SHA = 0x0000002F, 
     91  PJ_TLS_RSA_WITH_AES_256_CBC_SHA = 0x00000035, 
     92  PJ_TLS_RSA_WITH_AES_128_CBC_SHA256 = 0x0000003C, 
     93  PJ_TLS_RSA_WITH_AES_256_CBC_SHA256 = 0x0000003D, 
     94  PJ_TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA = 0x0000000D, 
     95  PJ_TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA = 0x00000010, 
     96  PJ_TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA = 0x00000013, 
     97  PJ_TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA = 0x00000016, 
     98  PJ_TLS_DH_DSS_WITH_AES_128_CBC_SHA = 0x00000030, 
     99  PJ_TLS_DH_RSA_WITH_AES_128_CBC_SHA = 0x00000031, 
     100  PJ_TLS_DHE_DSS_WITH_AES_128_CBC_SHA = 0x00000032, 
     101  PJ_TLS_DHE_RSA_WITH_AES_128_CBC_SHA = 0x00000033, 
     102  PJ_TLS_DH_DSS_WITH_AES_256_CBC_SHA = 0x00000036, 
     103  PJ_TLS_DH_RSA_WITH_AES_256_CBC_SHA = 0x00000037, 
     104  PJ_TLS_DHE_DSS_WITH_AES_256_CBC_SHA = 0x00000038, 
     105  PJ_TLS_DHE_RSA_WITH_AES_256_CBC_SHA = 0x00000039, 
     106  PJ_TLS_DH_DSS_WITH_AES_128_CBC_SHA256 = 0x0000003E, 
     107  PJ_TLS_DH_RSA_WITH_AES_128_CBC_SHA256 = 0x0000003F, 
     108  PJ_TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 = 0x00000040, 
     109  PJ_TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 = 0x00000067, 
     110  PJ_TLS_DH_DSS_WITH_AES_256_CBC_SHA256 = 0x00000068, 
     111  PJ_TLS_DH_RSA_WITH_AES_256_CBC_SHA256 = 0x00000069, 
     112  PJ_TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 = 0x0000006A, 
     113  PJ_TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 = 0x0000006B, 
     114  PJ_TLS_DH_anon_WITH_RC4_128_MD5 = 0x00000018, 
     115  PJ_TLS_DH_anon_WITH_3DES_EDE_CBC_SHA = 0x0000001B, 
     116  PJ_TLS_DH_anon_WITH_AES_128_CBC_SHA = 0x00000034, 
     117  PJ_TLS_DH_anon_WITH_AES_256_CBC_SHA = 0x0000003A, 
     118  PJ_TLS_DH_anon_WITH_AES_128_CBC_SHA256 = 0x0000006C, 
     119  PJ_TLS_DH_anon_WITH_AES_256_CBC_SHA256 = 0x0000006D, 
     120  PJ_TLS_RSA_EXPORT_WITH_RC4_40_MD5 = 0x00000003, 
     121  PJ_TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 = 0x00000006, 
     122  PJ_TLS_RSA_WITH_IDEA_CBC_SHA = 0x00000007, 
     123  PJ_TLS_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x00000008, 
     124  PJ_TLS_RSA_WITH_DES_CBC_SHA = 0x00000009, 
     125  PJ_TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA = 0x0000000B, 
     126  PJ_TLS_DH_DSS_WITH_DES_CBC_SHA = 0x0000000C, 
     127  PJ_TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x0000000E, 
     128  PJ_TLS_DH_RSA_WITH_DES_CBC_SHA = 0x0000000F, 
     129  PJ_TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA = 0x00000011, 
     130  PJ_TLS_DHE_DSS_WITH_DES_CBC_SHA = 0x00000012, 
     131  PJ_TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA = 0x00000014, 
     132  PJ_TLS_DHE_RSA_WITH_DES_CBC_SHA = 0x00000015, 
     133  PJ_TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 = 0x00000017, 
     134  PJ_TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA = 0x00000019, 
     135  PJ_TLS_DH_anon_WITH_DES_CBC_SHA = 0x0000001A, 
     136  PJ_SSL_FORTEZZA_KEA_WITH_NULL_SHA = 0x0000001C, 
     137  PJ_SSL_FORTEZZA_KEA_WITH_FORTEZZA_CBC_SHA = 0x0000001D, 
     138  PJ_SSL_FORTEZZA_KEA_WITH_RC4_128_SHA = 0x0000001E, 
     139  PJ_SSL_CK_RC4_128_WITH_MD5 = 0x00010080, 
     140  PJ_SSL_CK_RC4_128_EXPORT40_WITH_MD5 = 0x00020080, 
     141  PJ_SSL_CK_RC2_128_CBC_WITH_MD5 = 0x00030080, 
     142  PJ_SSL_CK_RC2_128_CBC_EXPORT40_WITH_MD5 = 0x00040080, 
     143  PJ_SSL_CK_IDEA_128_CBC_WITH_MD5 = 0x00050080, 
     144  PJ_SSL_CK_DES_64_CBC_WITH_MD5 = 0x00060040, 
     145  PJ_SSL_CK_DES_192_EDE3_CBC_WITH_MD5 = 0x000700C0 
     146} pj_ssl_cipher; 
     147 
     148typedef enum pj_ssl_sock_proto 
     149{ 
     150  PJ_SSL_SOCK_PROTO_DEFAULT = 0, 
     151  PJ_SSL_SOCK_PROTO_SSL2 = 1 << 0, 
     152  PJ_SSL_SOCK_PROTO_SSL3 = 1 << 1, 
     153  PJ_SSL_SOCK_PROTO_TLS1 = 1 << 2, 
     154  PJ_SSL_SOCK_PROTO_TLS1_1 = 1 << 3, 
     155  PJ_SSL_SOCK_PROTO_TLS1_2 = 1 << 4, 
     156  PJ_SSL_SOCK_PROTO_SSL23 = (1 << 16) - 1, 
     157  PJ_SSL_SOCK_PROTO_DTLS1 = 1 << 16 
     158} pj_ssl_sock_proto; 
     159 
     160typedef enum pj_ssl_cert_name_type 
     161{ 
     162  PJ_SSL_CERT_NAME_UNKNOWN = 0, 
     163  PJ_SSL_CERT_NAME_RFC822, 
     164  PJ_SSL_CERT_NAME_DNS, 
     165  PJ_SSL_CERT_NAME_URI, 
     166  PJ_SSL_CERT_NAME_IP 
     167} pj_ssl_cert_name_type; 
     168 
     169typedef enum pj_ssl_cert_verify_flag_t 
     170{ 
     171  PJ_SSL_CERT_ESUCCESS = 0, 
     172  PJ_SSL_CERT_EISSUER_NOT_FOUND = 1 << 0, 
     173  PJ_SSL_CERT_EUNTRUSTED = 1 << 1, 
     174  PJ_SSL_CERT_EVALIDITY_PERIOD = 1 << 2, 
     175  PJ_SSL_CERT_EINVALID_FORMAT = 1 << 3, 
     176  PJ_SSL_CERT_EINVALID_PURPOSE = 1 << 4, 
     177  PJ_SSL_CERT_EISSUER_MISMATCH = 1 << 5, 
     178  PJ_SSL_CERT_ECRL_FAILURE = 1 << 6, 
     179  PJ_SSL_CERT_EREVOKED = 1 << 7, 
     180  PJ_SSL_CERT_ECHAIN_TOO_LONG = 1 << 8, 
     181  PJ_SSL_CERT_EIDENTITY_NOT_MATCH = 1 << 30, 
     182  PJ_SSL_CERT_EUNKNOWN = 1 << 31 
     183} pj_ssl_cert_verify_flag_t; 
     184 
     185typedef enum pj_stun_nat_type 
     186{ 
     187  PJ_STUN_NAT_TYPE_UNKNOWN, 
     188  PJ_STUN_NAT_TYPE_ERR_UNKNOWN, 
     189  PJ_STUN_NAT_TYPE_OPEN, 
     190  PJ_STUN_NAT_TYPE_BLOCKED, 
     191  PJ_STUN_NAT_TYPE_SYMMETRIC_UDP, 
     192  PJ_STUN_NAT_TYPE_FULL_CONE, 
     193  PJ_STUN_NAT_TYPE_SYMMETRIC, 
     194  PJ_STUN_NAT_TYPE_RESTRICTED, 
     195  PJ_STUN_NAT_TYPE_PORT_RESTRICTED 
     196} pj_stun_nat_type; 
     197 
     198typedef enum pj_turn_tp_type 
     199{ 
     200  PJ_TURN_TP_UDP = 17, 
     201  PJ_TURN_TP_TCP = 6, 
     202  PJ_TURN_TP_TLS = 255 
     203} pj_turn_tp_type; 
     204 
     205typedef enum pjmedia_event_type 
     206{ 
     207  PJMEDIA_EVENT_NONE, 
     208  PJMEDIA_EVENT_FMT_CHANGED = ((('H' << 24) | ('C' << 16)) | ('M' << 8)) | 'F', 
     209  PJMEDIA_EVENT_WND_CLOSING = ((('L' << 24) | ('C' << 16)) | ('N' << 8)) | 'W', 
     210  PJMEDIA_EVENT_WND_CLOSED = ((('O' << 24) | ('C' << 16)) | ('N' << 8)) | 'W', 
     211  PJMEDIA_EVENT_WND_RESIZED = ((('Z' << 24) | ('R' << 16)) | ('N' << 8)) | 'W', 
     212  PJMEDIA_EVENT_MOUSE_BTN_DOWN = ((('N' << 24) | ('D' << 16)) | ('S' << 8)) | 'M', 
     213  PJMEDIA_EVENT_KEYFRAME_FOUND = ((('F' << 24) | ('R' << 16)) | ('F' << 8)) | 'I', 
     214  PJMEDIA_EVENT_KEYFRAME_MISSING = ((('M' << 24) | ('R' << 16)) | ('F' << 8)) | 'I', 
     215  PJMEDIA_EVENT_ORIENT_CHANGED = ((('T' << 24) | ('N' << 16)) | ('R' << 8)) | 'O', 
     216  PJMEDIA_EVENT_RX_RTCP_FB = ((('B' << 24) | ('F' << 16)) | ('T' << 8)) | 'R', 
     217  PJMEDIA_EVENT_AUD_DEV_ERROR = ((('R' << 24) | ('R' << 16)) | ('E' << 8)) | 'A' 
     218} pjmedia_event_type; 
     219 
     220typedef enum pjmedia_srtp_use 
     221{ 
     222  PJMEDIA_SRTP_DISABLED, 
     223  PJMEDIA_SRTP_OPTIONAL, 
     224  PJMEDIA_SRTP_MANDATORY 
     225} pjmedia_srtp_use; 
     226 
     227typedef enum pjmedia_srtp_crypto_option 
     228{ 
     229  PJMEDIA_SRTP_NO_ENCRYPTION = 1, 
     230  PJMEDIA_SRTP_NO_AUTHENTICATION = 2 
     231} pjmedia_srtp_crypto_option; 
     232 
     233typedef enum pjmedia_srtp_keying_method 
     234{ 
     235  PJMEDIA_SRTP_KEYING_SDES, 
     236  PJMEDIA_SRTP_KEYING_DTLS_SRTP, 
     237  PJMEDIA_SRTP_KEYINGS_COUNT 
     238} pjmedia_srtp_keying_method; 
     239 
     240typedef enum pjmedia_vid_stream_rc_method 
     241{ 
     242  PJMEDIA_VID_STREAM_RC_NONE = 0, 
     243  PJMEDIA_VID_STREAM_RC_SIMPLE_BLOCKING = 1 
     244} pjmedia_vid_stream_rc_method; 
    54245 
    55246typedef pj_int32_t pjmedia_vid_dev_index; 
    56247 
    57 enum pjmedia_vid_dev_std_index {PJMEDIA_VID_DEFAULT_CAPTURE_DEV = -1, PJMEDIA_VID_DEFAULT_RENDER_DEV = -2, PJMEDIA_VID_INVALID_DEV = -3}; 
    58  
    59 typedef enum pjmedia_vid_dev_cap {PJMEDIA_VID_DEV_CAP_FORMAT = 1, PJMEDIA_VID_DEV_CAP_INPUT_SCALE = 2, PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW = 4, PJMEDIA_VID_DEV_CAP_OUTPUT_RESIZE = 8, PJMEDIA_VID_DEV_CAP_OUTPUT_POSITION = 16, PJMEDIA_VID_DEV_CAP_OUTPUT_HIDE = 32, PJMEDIA_VID_DEV_CAP_INPUT_PREVIEW = 64, PJMEDIA_VID_DEV_CAP_ORIENTATION = 128, PJMEDIA_VID_DEV_CAP_SWITCH = 256, PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW_FLAGS = 512, PJMEDIA_VID_DEV_CAP_MAX = 16384} pjmedia_vid_dev_cap; 
    60  
    61 typedef enum pjmedia_aud_dev_id {PJMEDIA_AUD_DEFAULT_CAPTURE_DEV = -1, PJMEDIA_AUD_DEFAULT_PLAYBACK_DEV = -2, PJMEDIA_AUD_INVALID_DEV = -3} pjmedia_aud_dev_id; 
    62  
    63 typedef enum pjmedia_aud_dev_route {PJMEDIA_AUD_DEV_ROUTE_DEFAULT = 0, PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER = 1, PJMEDIA_AUD_DEV_ROUTE_EARPIECE = 2, PJMEDIA_AUD_DEV_ROUTE_BLUETOOTH = 4, PJMEDIA_AUD_DEV_ROUTE_CUSTOM = 128} pjmedia_aud_dev_route; 
    64  
    65 typedef enum pjmedia_aud_dev_cap {PJMEDIA_AUD_DEV_CAP_EXT_FORMAT = 1, PJMEDIA_AUD_DEV_CAP_INPUT_LATENCY = 2, PJMEDIA_AUD_DEV_CAP_OUTPUT_LATENCY = 4, PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING = 8, PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING = 16, PJMEDIA_AUD_DEV_CAP_INPUT_SIGNAL_METER = 32, PJMEDIA_AUD_DEV_CAP_OUTPUT_SIGNAL_METER = 64, PJMEDIA_AUD_DEV_CAP_INPUT_ROUTE = 128, PJMEDIA_AUD_DEV_CAP_INPUT_SOURCE = 128, PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE = 256, PJMEDIA_AUD_DEV_CAP_EC = 512, PJMEDIA_AUD_DEV_CAP_EC_TAIL = 1024, PJMEDIA_AUD_DEV_CAP_VAD = 2048, PJMEDIA_AUD_DEV_CAP_CNG = 4096, PJMEDIA_AUD_DEV_CAP_PLC = 8192, PJMEDIA_AUD_DEV_CAP_MAX = 16384} pjmedia_aud_dev_cap; 
    66  
    67 enum pjmedia_file_writer_option {PJMEDIA_FILE_WRITE_PCM = 0, PJMEDIA_FILE_WRITE_ALAW = 1, PJMEDIA_FILE_WRITE_ULAW = 2}; 
    68  
    69 enum pjmedia_file_player_option {PJMEDIA_FILE_NO_LOOP = 1}; 
     248enum pjmedia_vid_dev_std_index 
     249{ 
     250  PJMEDIA_VID_DEFAULT_CAPTURE_DEV = -1, 
     251  PJMEDIA_VID_DEFAULT_RENDER_DEV = -2, 
     252  PJMEDIA_VID_INVALID_DEV = -3 
     253}; 
     254 
     255typedef enum pjmedia_vid_dev_cap 
     256{ 
     257  PJMEDIA_VID_DEV_CAP_FORMAT = 1, 
     258  PJMEDIA_VID_DEV_CAP_INPUT_SCALE = 2, 
     259  PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW = 4, 
     260  PJMEDIA_VID_DEV_CAP_OUTPUT_RESIZE = 8, 
     261  PJMEDIA_VID_DEV_CAP_OUTPUT_POSITION = 16, 
     262  PJMEDIA_VID_DEV_CAP_OUTPUT_HIDE = 32, 
     263  PJMEDIA_VID_DEV_CAP_INPUT_PREVIEW = 64, 
     264  PJMEDIA_VID_DEV_CAP_ORIENTATION = 128, 
     265  PJMEDIA_VID_DEV_CAP_SWITCH = 256, 
     266  PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW_FLAGS = 512, 
     267  PJMEDIA_VID_DEV_CAP_MAX = 16384 
     268} pjmedia_vid_dev_cap; 
     269 
     270typedef enum pjmedia_aud_dev_id 
     271{ 
     272  PJMEDIA_AUD_DEFAULT_CAPTURE_DEV = -1, 
     273  PJMEDIA_AUD_DEFAULT_PLAYBACK_DEV = -2, 
     274  PJMEDIA_AUD_INVALID_DEV = -3 
     275} pjmedia_aud_dev_id; 
     276 
     277typedef enum pjmedia_aud_dev_route 
     278{ 
     279  PJMEDIA_AUD_DEV_ROUTE_DEFAULT = 0, 
     280  PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER = 1, 
     281  PJMEDIA_AUD_DEV_ROUTE_EARPIECE = 2, 
     282  PJMEDIA_AUD_DEV_ROUTE_BLUETOOTH = 4, 
     283  PJMEDIA_AUD_DEV_ROUTE_CUSTOM = 128 
     284} pjmedia_aud_dev_route; 
     285 
     286typedef enum pjmedia_aud_dev_cap 
     287{ 
     288  PJMEDIA_AUD_DEV_CAP_EXT_FORMAT = 1, 
     289  PJMEDIA_AUD_DEV_CAP_INPUT_LATENCY = 2, 
     290  PJMEDIA_AUD_DEV_CAP_OUTPUT_LATENCY = 4, 
     291  PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING = 8, 
     292  PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING = 16, 
     293  PJMEDIA_AUD_DEV_CAP_INPUT_SIGNAL_METER = 32, 
     294  PJMEDIA_AUD_DEV_CAP_OUTPUT_SIGNAL_METER = 64, 
     295  PJMEDIA_AUD_DEV_CAP_INPUT_ROUTE = 128, 
     296  PJMEDIA_AUD_DEV_CAP_INPUT_SOURCE = 128, 
     297  PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE = 256, 
     298  PJMEDIA_AUD_DEV_CAP_EC = 512, 
     299  PJMEDIA_AUD_DEV_CAP_EC_TAIL = 1024, 
     300  PJMEDIA_AUD_DEV_CAP_VAD = 2048, 
     301  PJMEDIA_AUD_DEV_CAP_CNG = 4096, 
     302  PJMEDIA_AUD_DEV_CAP_PLC = 8192, 
     303  PJMEDIA_AUD_DEV_CAP_MAX = 16384 
     304} pjmedia_aud_dev_cap; 
     305 
     306enum pjmedia_file_writer_option 
     307{ 
     308  PJMEDIA_FILE_WRITE_PCM = 0, 
     309  PJMEDIA_FILE_WRITE_ALAW = 1, 
     310  PJMEDIA_FILE_WRITE_ULAW = 2 
     311}; 
     312 
     313enum pjmedia_file_player_option 
     314{ 
     315  PJMEDIA_FILE_NO_LOOP = 1 
     316}; 
    70317 
    71318typedef struct pjmedia_tone_digit 
     
    98345} pjmedia_tone_desc; 
    99346 
    100 typedef enum pjmedia_type {PJMEDIA_TYPE_NONE, PJMEDIA_TYPE_AUDIO, PJMEDIA_TYPE_VIDEO, PJMEDIA_TYPE_APPLICATION, PJMEDIA_TYPE_UNKNOWN} pjmedia_type; 
    101  
    102 typedef enum pjmedia_dir {PJMEDIA_DIR_NONE = 0, PJMEDIA_DIR_ENCODING = 1, PJMEDIA_DIR_CAPTURE = PJMEDIA_DIR_ENCODING, PJMEDIA_DIR_DECODING = 2, PJMEDIA_DIR_PLAYBACK = PJMEDIA_DIR_DECODING, PJMEDIA_DIR_RENDER = PJMEDIA_DIR_DECODING, PJMEDIA_DIR_ENCODING_DECODING = 3, PJMEDIA_DIR_CAPTURE_PLAYBACK = PJMEDIA_DIR_ENCODING_DECODING, PJMEDIA_DIR_CAPTURE_RENDER = PJMEDIA_DIR_ENCODING_DECODING} pjmedia_dir; 
    103  
    104 typedef enum pjmedia_tp_proto {PJMEDIA_TP_PROTO_NONE = 0, PJMEDIA_TP_PROTO_RTP_AVP, PJMEDIA_TP_PROTO_RTP_SAVP, PJMEDIA_TP_PROTO_UNKNOWN} pjmedia_tp_proto; 
    105  
    106 typedef enum pjmedia_orient {PJMEDIA_ORIENT_UNKNOWN, PJMEDIA_ORIENT_NATURAL, PJMEDIA_ORIENT_ROTATE_90DEG, PJMEDIA_ORIENT_ROTATE_180DEG, PJMEDIA_ORIENT_ROTATE_270DEG} pjmedia_orient; 
    107  
    108 typedef enum pjmedia_format_id {PJMEDIA_FORMAT_L16 = 0, PJMEDIA_FORMAT_PCM = PJMEDIA_FORMAT_L16, PJMEDIA_FORMAT_PCMA = ((('W' << 24) | ('A' << 16)) | ('L' << 8)) | 'A', PJMEDIA_FORMAT_ALAW = PJMEDIA_FORMAT_PCMA, PJMEDIA_FORMAT_PCMU = ((('W' << 24) | ('A' << 16)) | ('L' << 8)) | 'u', PJMEDIA_FORMAT_ULAW = PJMEDIA_FORMAT_PCMU, PJMEDIA_FORMAT_AMR = ((('R' << 24) | ('M' << 16)) | ('A' << 8)) | ' ', PJMEDIA_FORMAT_G729 = ((('9' << 24) | ('2' << 16)) | ('7' << 8)) | 'G', PJMEDIA_FORMAT_ILBC = ((('C' << 24) | ('B' << 16)) | ('L' << 8)) | 'I', PJMEDIA_FORMAT_RGB24 = ((('3' << 24) | ('B' << 16)) | ('G' << 8)) | 'R', PJMEDIA_FORMAT_RGBA = ((('A' << 24) | ('B' << 16)) | ('G' << 8)) | 'R', PJMEDIA_FORMAT_BGRA = ((('A' << 24) | ('R' << 16)) | ('G' << 8)) | 'B', PJMEDIA_FORMAT_RGB32 = PJMEDIA_FORMAT_RGBA, PJMEDIA_FORMAT_DIB = (((' ' << 24) | ('B' << 16)) | ('I' << 8)) | 'D', PJMEDIA_FORMAT_GBRP = ((('P' << 24) | ('R' << 16)) | ('B' << 8)) | 'G', PJMEDIA_FORMAT_AYUV = ((('V' << 24) | ('U' << 16)) | ('Y' << 8)) | 'A', PJMEDIA_FORMAT_YUY2 = ((('2' << 24) | ('Y' << 16)) | ('U' << 8)) | 'Y', PJMEDIA_FORMAT_UYVY = ((('Y' << 24) | ('V' << 16)) | ('Y' << 8)) | 'U', PJMEDIA_FORMAT_YVYU = ((('U' << 24) | ('Y' << 16)) | ('V' << 8)) | 'Y', PJMEDIA_FORMAT_I420 = ((('0' << 24) | ('2' << 16)) | ('4' << 8)) | 'I', PJMEDIA_FORMAT_IYUV = PJMEDIA_FORMAT_I420, PJMEDIA_FORMAT_YV12 = ((('2' << 24) | ('1' << 16)) | ('V' << 8)) | 'Y', PJMEDIA_FORMAT_NV21 = ((('1' << 24) | ('2' << 16)) | ('V' << 8)) | 'N', PJMEDIA_FORMAT_I422 = ((('2' << 24) | ('2' << 16)) | ('4' << 8)) | 'I', PJMEDIA_FORMAT_I420JPEG = ((('0' << 24) | ('2' << 16)) | ('4' << 8)) | 'J', PJMEDIA_FORMAT_I422JPEG = ((('2' << 24) | ('2' << 16)) | ('4' << 8)) | 'J', PJMEDIA_FORMAT_H261 = ((('1' << 24) | ('6' << 16)) | ('2' << 8)) | 'H', PJMEDIA_FORMAT_H263 = ((('3' << 24) | ('6' << 16)) | ('2' << 8)) | 'H', PJMEDIA_FORMAT_H263P = ((('3' << 24) | ('6' << 16)) | ('2' << 8)) | 'P', PJMEDIA_FORMAT_H264 = ((('4' << 24) | ('6' << 16)) | ('2' << 8)) | 'H', PJMEDIA_FORMAT_MJPEG = ((('G' << 24) | ('P' << 16)) | ('J' << 8)) | 'M', PJMEDIA_FORMAT_MPEG1VIDEO = ((('V' << 24) | ('1' << 16)) | ('P' << 8)) | 'M', PJMEDIA_FORMAT_MPEG2VIDEO = ((('V' << 24) | ('2' << 16)) | ('P' << 8)) | 'M', PJMEDIA_FORMAT_MPEG4 = ((('4' << 24) | ('G' << 16)) | ('P' << 8)) | 'M'} pjmedia_format_id; 
    109  
    110 typedef enum pjmedia_vid_packing {PJMEDIA_VID_PACKING_UNKNOWN, PJMEDIA_VID_PACKING_PACKETS = 1, PJMEDIA_VID_PACKING_WHOLE = 2} pjmedia_vid_packing; 
    111  
    112 typedef enum pjmedia_rtcp_fb_type {PJMEDIA_RTCP_FB_ACK, PJMEDIA_RTCP_FB_NACK, PJMEDIA_RTCP_FB_TRR_INT, PJMEDIA_RTCP_FB_OTHER} pjmedia_rtcp_fb_type; 
    113  
    114 typedef enum pjsip_cred_data_type {PJSIP_CRED_DATA_PLAIN_PASSWD = 0, PJSIP_CRED_DATA_DIGEST = 1, PJSIP_CRED_DATA_EXT_AKA = 16} pjsip_cred_data_type; 
    115  
    116 typedef enum pjsip_dialog_cap_status {PJSIP_DIALOG_CAP_UNSUPPORTED = 0, PJSIP_DIALOG_CAP_SUPPORTED = 1, PJSIP_DIALOG_CAP_UNKNOWN = 2} pjsip_dialog_cap_status; 
    117  
    118 typedef enum pjsip_event_id_e {PJSIP_EVENT_UNKNOWN, PJSIP_EVENT_TIMER, PJSIP_EVENT_TX_MSG, PJSIP_EVENT_RX_MSG, PJSIP_EVENT_TRANSPORT_ERROR, PJSIP_EVENT_TSX_STATE, PJSIP_EVENT_USER} pjsip_event_id_e; 
    119  
    120 typedef enum pjsip_status_code {PJSIP_SC_NULL = 0, PJSIP_SC_TRYING = 100, PJSIP_SC_RINGING = 180, PJSIP_SC_CALL_BEING_FORWARDED = 181, PJSIP_SC_QUEUED = 182, PJSIP_SC_PROGRESS = 183, PJSIP_SC_OK = 200, PJSIP_SC_ACCEPTED = 202, PJSIP_SC_MULTIPLE_CHOICES = 300, PJSIP_SC_MOVED_PERMANENTLY = 301, PJSIP_SC_MOVED_TEMPORARILY = 302, PJSIP_SC_USE_PROXY = 305, PJSIP_SC_ALTERNATIVE_SERVICE = 380, PJSIP_SC_BAD_REQUEST = 400, PJSIP_SC_UNAUTHORIZED = 401, PJSIP_SC_PAYMENT_REQUIRED = 402, PJSIP_SC_FORBIDDEN = 403, PJSIP_SC_NOT_FOUND = 404, PJSIP_SC_METHOD_NOT_ALLOWED = 405, PJSIP_SC_NOT_ACCEPTABLE = 406, PJSIP_SC_PROXY_AUTHENTICATION_REQUIRED = 407, PJSIP_SC_REQUEST_TIMEOUT = 408, PJSIP_SC_GONE = 410, PJSIP_SC_REQUEST_ENTITY_TOO_LARGE = 413, PJSIP_SC_REQUEST_URI_TOO_LONG = 414, PJSIP_SC_UNSUPPORTED_MEDIA_TYPE = 415, PJSIP_SC_UNSUPPORTED_URI_SCHEME = 416, PJSIP_SC_BAD_EXTENSION = 420, PJSIP_SC_EXTENSION_REQUIRED = 421, PJSIP_SC_SESSION_TIMER_TOO_SMALL = 422, PJSIP_SC_INTERVAL_TOO_BRIEF = 423, PJSIP_SC_TEMPORARILY_UNAVAILABLE = 480, PJSIP_SC_CALL_TSX_DOES_NOT_EXIST = 481, PJSIP_SC_LOOP_DETECTED = 482, PJSIP_SC_TOO_MANY_HOPS = 483, PJSIP_SC_ADDRESS_INCOMPLETE = 484, PJSIP_AC_AMBIGUOUS = 485, PJSIP_SC_BUSY_HERE = 486, PJSIP_SC_REQUEST_TERMINATED = 487, PJSIP_SC_NOT_ACCEPTABLE_HERE = 488, PJSIP_SC_BAD_EVENT = 489, PJSIP_SC_REQUEST_UPDATED = 490, PJSIP_SC_REQUEST_PENDING = 491, PJSIP_SC_UNDECIPHERABLE = 493, PJSIP_SC_INTERNAL_SERVER_ERROR = 500, PJSIP_SC_NOT_IMPLEMENTED = 501, PJSIP_SC_BAD_GATEWAY = 502, PJSIP_SC_SERVICE_UNAVAILABLE = 503, PJSIP_SC_SERVER_TIMEOUT = 504, PJSIP_SC_VERSION_NOT_SUPPORTED = 505, PJSIP_SC_MESSAGE_TOO_LARGE = 513, PJSIP_SC_PRECONDITION_FAILURE = 580, PJSIP_SC_BUSY_EVERYWHERE = 600, PJSIP_SC_DECLINE = 603, PJSIP_SC_DOES_NOT_EXIST_ANYWHERE = 604, PJSIP_SC_NOT_ACCEPTABLE_ANYWHERE = 606, PJSIP_SC_TSX_TIMEOUT = PJSIP_SC_REQUEST_TIMEOUT, PJSIP_SC_TSX_TRANSPORT_ERROR = PJSIP_SC_SERVICE_UNAVAILABLE, PJSIP_SC__force_32bit = 0x7FFFFFFF} pjsip_status_code; 
    121  
    122 typedef enum pjsip_hdr_e {PJSIP_H_ACCEPT, PJSIP_H_ACCEPT_ENCODING_UNIMP, PJSIP_H_ACCEPT_LANGUAGE_UNIMP, PJSIP_H_ALERT_INFO_UNIMP, PJSIP_H_ALLOW, PJSIP_H_AUTHENTICATION_INFO_UNIMP, PJSIP_H_AUTHORIZATION, PJSIP_H_CALL_ID, PJSIP_H_CALL_INFO_UNIMP, PJSIP_H_CONTACT, PJSIP_H_CONTENT_DISPOSITION_UNIMP, PJSIP_H_CONTENT_ENCODING_UNIMP, PJSIP_H_CONTENT_LANGUAGE_UNIMP, PJSIP_H_CONTENT_LENGTH, PJSIP_H_CONTENT_TYPE, PJSIP_H_CSEQ, PJSIP_H_DATE_UNIMP, PJSIP_H_ERROR_INFO_UNIMP, PJSIP_H_EXPIRES, PJSIP_H_FROM, PJSIP_H_IN_REPLY_TO_UNIMP, PJSIP_H_MAX_FORWARDS, PJSIP_H_MIME_VERSION_UNIMP, PJSIP_H_MIN_EXPIRES, PJSIP_H_ORGANIZATION_UNIMP, PJSIP_H_PRIORITY_UNIMP, PJSIP_H_PROXY_AUTHENTICATE, PJSIP_H_PROXY_AUTHORIZATION, PJSIP_H_PROXY_REQUIRE_UNIMP, PJSIP_H_RECORD_ROUTE, PJSIP_H_REPLY_TO_UNIMP, PJSIP_H_REQUIRE, PJSIP_H_RETRY_AFTER, PJSIP_H_ROUTE, PJSIP_H_SERVER_UNIMP, PJSIP_H_SUBJECT_UNIMP, PJSIP_H_SUPPORTED, PJSIP_H_TIMESTAMP_UNIMP, PJSIP_H_TO, PJSIP_H_UNSUPPORTED, PJSIP_H_USER_AGENT_UNIMP, PJSIP_H_VIA, PJSIP_H_WARNING_UNIMP, PJSIP_H_WWW_AUTHENTICATE, PJSIP_H_OTHER} pjsip_hdr_e; 
    123  
    124 typedef enum pjsip_transport_type_e {PJSIP_TRANSPORT_UNSPECIFIED, PJSIP_TRANSPORT_UDP, PJSIP_TRANSPORT_TCP, PJSIP_TRANSPORT_TLS, PJSIP_TRANSPORT_SCTP, PJSIP_TRANSPORT_LOOP, PJSIP_TRANSPORT_LOOP_DGRAM, PJSIP_TRANSPORT_START_OTHER, PJSIP_TRANSPORT_IPV6 = 128, PJSIP_TRANSPORT_UDP6 = PJSIP_TRANSPORT_UDP + PJSIP_TRANSPORT_IPV6, PJSIP_TRANSPORT_TCP6 = PJSIP_TRANSPORT_TCP + PJSIP_TRANSPORT_IPV6, PJSIP_TRANSPORT_TLS6 = PJSIP_TRANSPORT_TLS + PJSIP_TRANSPORT_IPV6} pjsip_transport_type_e; 
    125  
    126 enum pjsip_transport_flags_e {PJSIP_TRANSPORT_RELIABLE = 1, PJSIP_TRANSPORT_SECURE = 2, PJSIP_TRANSPORT_DATAGRAM = 4}; 
    127  
    128 typedef enum pjsip_transport_state {PJSIP_TP_STATE_CONNECTED, PJSIP_TP_STATE_DISCONNECTED, PJSIP_TP_STATE_SHUTDOWN, PJSIP_TP_STATE_DESTROY} pjsip_transport_state; 
    129  
    130 typedef enum pjsip_ssl_method {PJSIP_SSL_UNSPECIFIED_METHOD = 0, PJSIP_SSLV2_METHOD = 20, PJSIP_SSLV3_METHOD = 30, PJSIP_TLSV1_METHOD = 31, PJSIP_TLSV1_1_METHOD = 32, PJSIP_TLSV1_2_METHOD = 33, PJSIP_SSLV23_METHOD = 23} pjsip_ssl_method; 
    131  
    132 typedef enum pjsip_tsx_state_e {PJSIP_TSX_STATE_NULL, PJSIP_TSX_STATE_CALLING, PJSIP_TSX_STATE_TRYING, PJSIP_TSX_STATE_PROCEEDING, PJSIP_TSX_STATE_COMPLETED, PJSIP_TSX_STATE_CONFIRMED, PJSIP_TSX_STATE_TERMINATED, PJSIP_TSX_STATE_DESTROYED, PJSIP_TSX_STATE_MAX} pjsip_tsx_state_e; 
    133  
    134 typedef enum pjsip_role_e {PJSIP_ROLE_UAC, PJSIP_ROLE_UAS, PJSIP_UAC_ROLE = PJSIP_ROLE_UAC, PJSIP_UAS_ROLE = PJSIP_ROLE_UAS} pjsip_role_e; 
    135  
    136 typedef enum pjsip_redirect_op {PJSIP_REDIRECT_REJECT, PJSIP_REDIRECT_ACCEPT, PJSIP_REDIRECT_ACCEPT_REPLACE, PJSIP_REDIRECT_PENDING, PJSIP_REDIRECT_STOP} pjsip_redirect_op; 
    137  
    138 typedef enum pjrpid_activity {PJRPID_ACTIVITY_UNKNOWN, PJRPID_ACTIVITY_AWAY, PJRPID_ACTIVITY_BUSY} pjrpid_activity; 
    139  
    140 typedef enum pjsip_evsub_state {PJSIP_EVSUB_STATE_NULL, PJSIP_EVSUB_STATE_SENT, PJSIP_EVSUB_STATE_ACCEPTED, PJSIP_EVSUB_STATE_PENDING, PJSIP_EVSUB_STATE_ACTIVE, PJSIP_EVSUB_STATE_TERMINATED, PJSIP_EVSUB_STATE_UNKNOWN} pjsip_evsub_state; 
    141  
    142 typedef enum pjsip_inv_state {PJSIP_INV_STATE_NULL, PJSIP_INV_STATE_CALLING, PJSIP_INV_STATE_INCOMING, PJSIP_INV_STATE_EARLY, PJSIP_INV_STATE_CONNECTING, PJSIP_INV_STATE_CONFIRMED, PJSIP_INV_STATE_DISCONNECTED} pjsip_inv_state; 
    143  
    144 enum pjsua_invalid_id_const_ {PJSUA_INVALID_ID = -1}; 
    145  
    146 typedef enum pjsua_state {PJSUA_STATE_NULL, PJSUA_STATE_CREATED, PJSUA_STATE_INIT, PJSUA_STATE_STARTING, PJSUA_STATE_RUNNING, PJSUA_STATE_CLOSING} pjsua_state; 
    147  
    148 typedef enum pjsua_stun_use {PJSUA_STUN_USE_DEFAULT, PJSUA_STUN_USE_DISABLED, PJSUA_STUN_RETRY_ON_FAILURE} pjsua_stun_use; 
    149  
    150 typedef enum pjsua_call_hold_type {PJSUA_CALL_HOLD_TYPE_RFC3264, PJSUA_CALL_HOLD_TYPE_RFC2543} pjsua_call_hold_type; 
     347typedef enum pjmedia_type 
     348{ 
     349  PJMEDIA_TYPE_NONE, 
     350  PJMEDIA_TYPE_AUDIO, 
     351  PJMEDIA_TYPE_VIDEO, 
     352  PJMEDIA_TYPE_APPLICATION, 
     353  PJMEDIA_TYPE_UNKNOWN 
     354} pjmedia_type; 
     355 
     356typedef enum pjmedia_dir 
     357{ 
     358  PJMEDIA_DIR_NONE = 0, 
     359  PJMEDIA_DIR_ENCODING = 1, 
     360  PJMEDIA_DIR_CAPTURE = PJMEDIA_DIR_ENCODING, 
     361  PJMEDIA_DIR_DECODING = 2, 
     362  PJMEDIA_DIR_PLAYBACK = PJMEDIA_DIR_DECODING, 
     363  PJMEDIA_DIR_RENDER = PJMEDIA_DIR_DECODING, 
     364  PJMEDIA_DIR_ENCODING_DECODING = 3, 
     365  PJMEDIA_DIR_CAPTURE_PLAYBACK = PJMEDIA_DIR_ENCODING_DECODING, 
     366  PJMEDIA_DIR_CAPTURE_RENDER = PJMEDIA_DIR_ENCODING_DECODING 
     367} pjmedia_dir; 
     368 
     369typedef enum pjmedia_tp_proto 
     370{ 
     371  PJMEDIA_TP_PROTO_NONE = 0, 
     372  PJMEDIA_TP_PROTO_UNKNOWN = 1 << 0, 
     373  PJMEDIA_TP_PROTO_UDP = 1 << 1, 
     374  PJMEDIA_TP_PROTO_RTP = 1 << 2, 
     375  PJMEDIA_TP_PROTO_DTLS = 1 << 3, 
     376  PJMEDIA_TP_PROFILE_RTCP_FB = 1 << 13, 
     377  PJMEDIA_TP_PROFILE_SRTP = 1 << 14, 
     378  PJMEDIA_TP_PROFILE_AVP = 1 << 15, 
     379  PJMEDIA_TP_PROTO_RTP_AVP = PJMEDIA_TP_PROTO_RTP | PJMEDIA_TP_PROFILE_AVP, 
     380  PJMEDIA_TP_PROTO_RTP_SAVP = PJMEDIA_TP_PROTO_RTP_AVP | PJMEDIA_TP_PROFILE_SRTP, 
     381  PJMEDIA_TP_PROTO_DTLS_SRTP = PJMEDIA_TP_PROTO_DTLS | PJMEDIA_TP_PROTO_RTP_SAVP, 
     382  PJMEDIA_TP_PROTO_RTP_AVPF = PJMEDIA_TP_PROTO_RTP_AVP | PJMEDIA_TP_PROFILE_RTCP_FB, 
     383  PJMEDIA_TP_PROTO_RTP_SAVPF = PJMEDIA_TP_PROTO_RTP_SAVP | PJMEDIA_TP_PROFILE_RTCP_FB, 
     384  PJMEDIA_TP_PROTO_DTLS_SRTPF = PJMEDIA_TP_PROTO_DTLS_SRTP | PJMEDIA_TP_PROFILE_RTCP_FB 
     385} pjmedia_tp_proto; 
     386 
     387typedef enum pjmedia_orient 
     388{ 
     389  PJMEDIA_ORIENT_UNKNOWN, 
     390  PJMEDIA_ORIENT_NATURAL, 
     391  PJMEDIA_ORIENT_ROTATE_90DEG, 
     392  PJMEDIA_ORIENT_ROTATE_180DEG, 
     393  PJMEDIA_ORIENT_ROTATE_270DEG 
     394} pjmedia_orient; 
     395 
     396typedef enum pjmedia_format_id 
     397{ 
     398  PJMEDIA_FORMAT_L16 = 0, 
     399  PJMEDIA_FORMAT_PCM = PJMEDIA_FORMAT_L16, 
     400  PJMEDIA_FORMAT_PCMA = ((('W' << 24) | ('A' << 16)) | ('L' << 8)) | 'A', 
     401  PJMEDIA_FORMAT_ALAW = PJMEDIA_FORMAT_PCMA, 
     402  PJMEDIA_FORMAT_PCMU = ((('W' << 24) | ('A' << 16)) | ('L' << 8)) | 'u', 
     403  PJMEDIA_FORMAT_ULAW = PJMEDIA_FORMAT_PCMU, 
     404  PJMEDIA_FORMAT_AMR = ((('R' << 24) | ('M' << 16)) | ('A' << 8)) | ' ', 
     405  PJMEDIA_FORMAT_G729 = ((('9' << 24) | ('2' << 16)) | ('7' << 8)) | 'G', 
     406  PJMEDIA_FORMAT_ILBC = ((('C' << 24) | ('B' << 16)) | ('L' << 8)) | 'I', 
     407  PJMEDIA_FORMAT_RGB24 = ((('3' << 24) | ('B' << 16)) | ('G' << 8)) | 'R', 
     408  PJMEDIA_FORMAT_RGBA = ((('A' << 24) | ('B' << 16)) | ('G' << 8)) | 'R', 
     409  PJMEDIA_FORMAT_BGRA = ((('A' << 24) | ('R' << 16)) | ('G' << 8)) | 'B', 
     410  PJMEDIA_FORMAT_RGB32 = PJMEDIA_FORMAT_RGBA, 
     411  PJMEDIA_FORMAT_DIB = (((' ' << 24) | ('B' << 16)) | ('I' << 8)) | 'D', 
     412  PJMEDIA_FORMAT_GBRP = ((('P' << 24) | ('R' << 16)) | ('B' << 8)) | 'G', 
     413  PJMEDIA_FORMAT_AYUV = ((('V' << 24) | ('U' << 16)) | ('Y' << 8)) | 'A', 
     414  PJMEDIA_FORMAT_YUY2 = ((('2' << 24) | ('Y' << 16)) | ('U' << 8)) | 'Y', 
     415  PJMEDIA_FORMAT_UYVY = ((('Y' << 24) | ('V' << 16)) | ('Y' << 8)) | 'U', 
     416  PJMEDIA_FORMAT_YVYU = ((('U' << 24) | ('Y' << 16)) | ('V' << 8)) | 'Y', 
     417  PJMEDIA_FORMAT_I420 = ((('0' << 24) | ('2' << 16)) | ('4' << 8)) | 'I', 
     418  PJMEDIA_FORMAT_IYUV = PJMEDIA_FORMAT_I420, 
     419  PJMEDIA_FORMAT_YV12 = ((('2' << 24) | ('1' << 16)) | ('V' << 8)) | 'Y', 
     420  PJMEDIA_FORMAT_NV21 = ((('1' << 24) | ('2' << 16)) | ('V' << 8)) | 'N', 
     421  PJMEDIA_FORMAT_I422 = ((('2' << 24) | ('2' << 16)) | ('4' << 8)) | 'I', 
     422  PJMEDIA_FORMAT_I420JPEG = ((('0' << 24) | ('2' << 16)) | ('4' << 8)) | 'J', 
     423  PJMEDIA_FORMAT_I422JPEG = ((('2' << 24) | ('2' << 16)) | ('4' << 8)) | 'J', 
     424  PJMEDIA_FORMAT_H261 = ((('1' << 24) | ('6' << 16)) | ('2' << 8)) | 'H', 
     425  PJMEDIA_FORMAT_H263 = ((('3' << 24) | ('6' << 16)) | ('2' << 8)) | 'H', 
     426  PJMEDIA_FORMAT_H263P = ((('3' << 24) | ('6' << 16)) | ('2' << 8)) | 'P', 
     427  PJMEDIA_FORMAT_H264 = ((('4' << 24) | ('6' << 16)) | ('2' << 8)) | 'H', 
     428  PJMEDIA_FORMAT_MJPEG = ((('G' << 24) | ('P' << 16)) | ('J' << 8)) | 'M', 
     429  PJMEDIA_FORMAT_MPEG1VIDEO = ((('V' << 24) | ('1' << 16)) | ('P' << 8)) | 'M', 
     430  PJMEDIA_FORMAT_MPEG2VIDEO = ((('V' << 24) | ('2' << 16)) | ('P' << 8)) | 'M', 
     431  PJMEDIA_FORMAT_MPEG4 = ((('4' << 24) | ('G' << 16)) | ('P' << 8)) | 'M' 
     432} pjmedia_format_id; 
     433 
     434typedef enum pjmedia_vid_packing 
     435{ 
     436  PJMEDIA_VID_PACKING_UNKNOWN, 
     437  PJMEDIA_VID_PACKING_PACKETS = 1, 
     438  PJMEDIA_VID_PACKING_WHOLE = 2 
     439} pjmedia_vid_packing; 
     440 
     441typedef enum pjmedia_rtcp_fb_type 
     442{ 
     443  PJMEDIA_RTCP_FB_ACK, 
     444  PJMEDIA_RTCP_FB_NACK, 
     445  PJMEDIA_RTCP_FB_TRR_INT, 
     446  PJMEDIA_RTCP_FB_OTHER 
     447} pjmedia_rtcp_fb_type; 
     448 
     449typedef enum pjsip_cred_data_type 
     450{ 
     451  PJSIP_CRED_DATA_PLAIN_PASSWD = 0, 
     452  PJSIP_CRED_DATA_DIGEST = 1, 
     453  PJSIP_CRED_DATA_EXT_AKA = 16 
     454} pjsip_cred_data_type; 
     455 
     456typedef enum pjsip_dialog_cap_status 
     457{ 
     458  PJSIP_DIALOG_CAP_UNSUPPORTED = 0, 
     459  PJSIP_DIALOG_CAP_SUPPORTED = 1, 
     460  PJSIP_DIALOG_CAP_UNKNOWN = 2 
     461} pjsip_dialog_cap_status; 
     462 
     463typedef enum pjsip_event_id_e 
     464{ 
     465  PJSIP_EVENT_UNKNOWN, 
     466  PJSIP_EVENT_TIMER, 
     467  PJSIP_EVENT_TX_MSG, 
     468  PJSIP_EVENT_RX_MSG, 
     469  PJSIP_EVENT_TRANSPORT_ERROR, 
     470  PJSIP_EVENT_TSX_STATE, 
     471  PJSIP_EVENT_USER 
     472} pjsip_event_id_e; 
     473 
     474typedef enum pjsip_status_code 
     475{ 
     476  PJSIP_SC_NULL = 0, 
     477  PJSIP_SC_TRYING = 100, 
     478  PJSIP_SC_RINGING = 180, 
     479  PJSIP_SC_CALL_BEING_FORWARDED = 181, 
     480  PJSIP_SC_QUEUED = 182, 
     481  PJSIP_SC_PROGRESS = 183, 
     482  PJSIP_SC_OK = 200, 
     483  PJSIP_SC_ACCEPTED = 202, 
     484  PJSIP_SC_MULTIPLE_CHOICES = 300, 
     485  PJSIP_SC_MOVED_PERMANENTLY = 301, 
     486  PJSIP_SC_MOVED_TEMPORARILY = 302, 
     487  PJSIP_SC_USE_PROXY = 305, 
     488  PJSIP_SC_ALTERNATIVE_SERVICE = 380, 
     489  PJSIP_SC_BAD_REQUEST = 400, 
     490  PJSIP_SC_UNAUTHORIZED = 401, 
     491  PJSIP_SC_PAYMENT_REQUIRED = 402, 
     492  PJSIP_SC_FORBIDDEN = 403, 
     493  PJSIP_SC_NOT_FOUND = 404, 
     494  PJSIP_SC_METHOD_NOT_ALLOWED = 405, 
     495  PJSIP_SC_NOT_ACCEPTABLE = 406, 
     496  PJSIP_SC_PROXY_AUTHENTICATION_REQUIRED = 407, 
     497  PJSIP_SC_REQUEST_TIMEOUT = 408, 
     498  PJSIP_SC_GONE = 410, 
     499  PJSIP_SC_REQUEST_ENTITY_TOO_LARGE = 413, 
     500  PJSIP_SC_REQUEST_URI_TOO_LONG = 414, 
     501  PJSIP_SC_UNSUPPORTED_MEDIA_TYPE = 415, 
     502  PJSIP_SC_UNSUPPORTED_URI_SCHEME = 416, 
     503  PJSIP_SC_BAD_EXTENSION = 420, 
     504  PJSIP_SC_EXTENSION_REQUIRED = 421, 
     505  PJSIP_SC_SESSION_TIMER_TOO_SMALL = 422, 
     506  PJSIP_SC_INTERVAL_TOO_BRIEF = 423, 
     507  PJSIP_SC_TEMPORARILY_UNAVAILABLE = 480, 
     508  PJSIP_SC_CALL_TSX_DOES_NOT_EXIST = 481, 
     509  PJSIP_SC_LOOP_DETECTED = 482, 
     510  PJSIP_SC_TOO_MANY_HOPS = 483, 
     511  PJSIP_SC_ADDRESS_INCOMPLETE = 484, 
     512  PJSIP_AC_AMBIGUOUS = 485, 
     513  PJSIP_SC_BUSY_HERE = 486, 
     514  PJSIP_SC_REQUEST_TERMINATED = 487, 
     515  PJSIP_SC_NOT_ACCEPTABLE_HERE = 488, 
     516  PJSIP_SC_BAD_EVENT = 489, 
     517  PJSIP_SC_REQUEST_UPDATED = 490, 
     518  PJSIP_SC_REQUEST_PENDING = 491, 
     519  PJSIP_SC_UNDECIPHERABLE = 493, 
     520  PJSIP_SC_INTERNAL_SERVER_ERROR = 500, 
     521  PJSIP_SC_NOT_IMPLEMENTED = 501, 
     522  PJSIP_SC_BAD_GATEWAY = 502, 
     523  PJSIP_SC_SERVICE_UNAVAILABLE = 503, 
     524  PJSIP_SC_SERVER_TIMEOUT = 504, 
     525  PJSIP_SC_VERSION_NOT_SUPPORTED = 505, 
     526  PJSIP_SC_MESSAGE_TOO_LARGE = 513, 
     527  PJSIP_SC_PRECONDITION_FAILURE = 580, 
     528  PJSIP_SC_BUSY_EVERYWHERE = 600, 
     529  PJSIP_SC_DECLINE = 603, 
     530  PJSIP_SC_DOES_NOT_EXIST_ANYWHERE = 604, 
     531  PJSIP_SC_NOT_ACCEPTABLE_ANYWHERE = 606, 
     532  PJSIP_SC_TSX_TIMEOUT = PJSIP_SC_REQUEST_TIMEOUT, 
     533  PJSIP_SC_TSX_TRANSPORT_ERROR = PJSIP_SC_SERVICE_UNAVAILABLE, 
     534  PJSIP_SC__force_32bit = 0x7FFFFFFF 
     535} pjsip_status_code; 
     536 
     537typedef enum pjsip_hdr_e 
     538{ 
     539  PJSIP_H_ACCEPT, 
     540  PJSIP_H_ACCEPT_ENCODING_UNIMP, 
     541  PJSIP_H_ACCEPT_LANGUAGE_UNIMP, 
     542  PJSIP_H_ALERT_INFO_UNIMP, 
     543  PJSIP_H_ALLOW, 
     544  PJSIP_H_AUTHENTICATION_INFO_UNIMP, 
     545  PJSIP_H_AUTHORIZATION, 
     546  PJSIP_H_CALL_ID, 
     547  PJSIP_H_CALL_INFO_UNIMP, 
     548  PJSIP_H_CONTACT, 
     549  PJSIP_H_CONTENT_DISPOSITION_UNIMP, 
     550  PJSIP_H_CONTENT_ENCODING_UNIMP, 
     551  PJSIP_H_CONTENT_LANGUAGE_UNIMP, 
     552  PJSIP_H_CONTENT_LENGTH, 
     553  PJSIP_H_CONTENT_TYPE, 
     554  PJSIP_H_CSEQ, 
     555  PJSIP_H_DATE_UNIMP, 
     556  PJSIP_H_ERROR_INFO_UNIMP, 
     557  PJSIP_H_EXPIRES, 
     558  PJSIP_H_FROM, 
     559  PJSIP_H_IN_REPLY_TO_UNIMP, 
     560  PJSIP_H_MAX_FORWARDS, 
     561  PJSIP_H_MIME_VERSION_UNIMP, 
     562  PJSIP_H_MIN_EXPIRES, 
     563  PJSIP_H_ORGANIZATION_UNIMP, 
     564  PJSIP_H_PRIORITY_UNIMP, 
     565  PJSIP_H_PROXY_AUTHENTICATE, 
     566  PJSIP_H_PROXY_AUTHORIZATION, 
     567  PJSIP_H_PROXY_REQUIRE_UNIMP, 
     568  PJSIP_H_RECORD_ROUTE, 
     569  PJSIP_H_REPLY_TO_UNIMP, 
     570  PJSIP_H_REQUIRE, 
     571  PJSIP_H_RETRY_AFTER, 
     572  PJSIP_H_ROUTE, 
     573  PJSIP_H_SERVER_UNIMP, 
     574  PJSIP_H_SUBJECT_UNIMP, 
     575  PJSIP_H_SUPPORTED, 
     576  PJSIP_H_TIMESTAMP_UNIMP, 
     577  PJSIP_H_TO, 
     578  PJSIP_H_UNSUPPORTED, 
     579  PJSIP_H_USER_AGENT_UNIMP, 
     580  PJSIP_H_VIA, 
     581  PJSIP_H_WARNING_UNIMP, 
     582  PJSIP_H_WWW_AUTHENTICATE, 
     583  PJSIP_H_OTHER 
     584} pjsip_hdr_e; 
     585 
     586typedef enum pjsip_transport_type_e 
     587{ 
     588  PJSIP_TRANSPORT_UNSPECIFIED, 
     589  PJSIP_TRANSPORT_UDP, 
     590  PJSIP_TRANSPORT_TCP, 
     591  PJSIP_TRANSPORT_TLS, 
     592  PJSIP_TRANSPORT_SCTP, 
     593  PJSIP_TRANSPORT_LOOP, 
     594  PJSIP_TRANSPORT_LOOP_DGRAM, 
     595  PJSIP_TRANSPORT_START_OTHER, 
     596  PJSIP_TRANSPORT_IPV6 = 128, 
     597  PJSIP_TRANSPORT_UDP6 = PJSIP_TRANSPORT_UDP + PJSIP_TRANSPORT_IPV6, 
     598  PJSIP_TRANSPORT_TCP6 = PJSIP_TRANSPORT_TCP + PJSIP_TRANSPORT_IPV6, 
     599  PJSIP_TRANSPORT_TLS6 = PJSIP_TRANSPORT_TLS + PJSIP_TRANSPORT_IPV6 
     600} pjsip_transport_type_e; 
     601 
     602enum pjsip_transport_flags_e 
     603{ 
     604  PJSIP_TRANSPORT_RELIABLE = 1, 
     605  PJSIP_TRANSPORT_SECURE = 2, 
     606  PJSIP_TRANSPORT_DATAGRAM = 4 
     607}; 
     608 
     609typedef enum pjsip_transport_state 
     610{ 
     611  PJSIP_TP_STATE_CONNECTED, 
     612  PJSIP_TP_STATE_DISCONNECTED, 
     613  PJSIP_TP_STATE_SHUTDOWN, 
     614  PJSIP_TP_STATE_DESTROY 
     615} pjsip_transport_state; 
     616 
     617typedef enum pjsip_ssl_method 
     618{ 
     619  PJSIP_SSL_UNSPECIFIED_METHOD = 0, 
     620  PJSIP_SSLV2_METHOD = 20, 
     621  PJSIP_SSLV3_METHOD = 30, 
     622  PJSIP_TLSV1_METHOD = 31, 
     623  PJSIP_TLSV1_1_METHOD = 32, 
     624  PJSIP_TLSV1_2_METHOD = 33, 
     625  PJSIP_SSLV23_METHOD = 23 
     626} pjsip_ssl_method; 
     627 
     628typedef enum pjsip_tsx_state_e 
     629{ 
     630  PJSIP_TSX_STATE_NULL, 
     631  PJSIP_TSX_STATE_CALLING, 
     632  PJSIP_TSX_STATE_TRYING, 
     633  PJSIP_TSX_STATE_PROCEEDING, 
     634  PJSIP_TSX_STATE_COMPLETED, 
     635  PJSIP_TSX_STATE_CONFIRMED, 
     636  PJSIP_TSX_STATE_TERMINATED, 
     637  PJSIP_TSX_STATE_DESTROYED, 
     638  PJSIP_TSX_STATE_MAX 
     639} pjsip_tsx_state_e; 
     640 
     641typedef enum pjsip_role_e 
     642{ 
     643  PJSIP_ROLE_UAC, 
     644  PJSIP_ROLE_UAS, 
     645  PJSIP_UAC_ROLE = PJSIP_ROLE_UAC, 
     646  PJSIP_UAS_ROLE = PJSIP_ROLE_UAS 
     647} pjsip_role_e; 
     648 
     649typedef enum pjsip_redirect_op 
     650{ 
     651  PJSIP_REDIRECT_REJECT, 
     652  PJSIP_REDIRECT_ACCEPT, 
     653  PJSIP_REDIRECT_ACCEPT_REPLACE, 
     654  PJSIP_REDIRECT_PENDING, 
     655  PJSIP_REDIRECT_STOP 
     656} pjsip_redirect_op; 
     657 
     658typedef enum pjrpid_activity 
     659{ 
     660  PJRPID_ACTIVITY_UNKNOWN, 
     661  PJRPID_ACTIVITY_AWAY, 
     662  PJRPID_ACTIVITY_BUSY 
     663} pjrpid_activity; 
     664 
     665typedef enum pjsip_evsub_state 
     666{ 
     667  PJSIP_EVSUB_STATE_NULL, 
     668  PJSIP_EVSUB_STATE_SENT, 
     669  PJSIP_EVSUB_STATE_ACCEPTED, 
     670  PJSIP_EVSUB_STATE_PENDING, 
     671  PJSIP_EVSUB_STATE_ACTIVE, 
     672  PJSIP_EVSUB_STATE_TERMINATED, 
     673  PJSIP_EVSUB_STATE_UNKNOWN 
     674} pjsip_evsub_state; 
     675 
     676typedef enum pjsip_inv_state 
     677{ 
     678  PJSIP_INV_STATE_NULL, 
     679  PJSIP_INV_STATE_CALLING, 
     680  PJSIP_INV_STATE_INCOMING, 
     681  PJSIP_INV_STATE_EARLY, 
     682  PJSIP_INV_STATE_CONNECTING, 
     683  PJSIP_INV_STATE_CONFIRMED, 
     684  PJSIP_INV_STATE_DISCONNECTED 
     685} pjsip_inv_state; 
     686 
     687enum pjsua_invalid_id_const_ 
     688{ 
     689  PJSUA_INVALID_ID = -1 
     690}; 
     691 
     692typedef enum pjsua_state 
     693{ 
     694  PJSUA_STATE_NULL, 
     695  PJSUA_STATE_CREATED, 
     696  PJSUA_STATE_INIT, 
     697  PJSUA_STATE_STARTING, 
     698  PJSUA_STATE_RUNNING, 
     699  PJSUA_STATE_CLOSING 
     700} pjsua_state; 
     701 
     702typedef enum pjsua_stun_use 
     703{ 
     704  PJSUA_STUN_USE_DEFAULT, 
     705  PJSUA_STUN_USE_DISABLED, 
     706  PJSUA_STUN_RETRY_ON_FAILURE 
     707} pjsua_stun_use; 
     708 
     709typedef enum pjsua_call_hold_type 
     710{ 
     711  PJSUA_CALL_HOLD_TYPE_RFC3264, 
     712  PJSUA_CALL_HOLD_TYPE_RFC2543 
     713} pjsua_call_hold_type; 
    151714 
    152715typedef int pjsua_acc_id; 
    153716 
    154 typedef enum pjsua_destroy_flag {PJSUA_DESTROY_NO_RX_MSG = 1, PJSUA_DESTROY_NO_TX_MSG = 2, PJSUA_DESTROY_NO_NETWORK = PJSUA_DESTROY_NO_RX_MSG | PJSUA_DESTROY_NO_TX_MSG} pjsua_destroy_flag; 
    155  
    156 typedef enum pjsua_100rel_use {PJSUA_100REL_NOT_USED, PJSUA_100REL_MANDATORY, PJSUA_100REL_OPTIONAL} pjsua_100rel_use; 
    157  
    158 typedef enum pjsua_sip_timer_use {PJSUA_SIP_TIMER_INACTIVE, PJSUA_SIP_TIMER_OPTIONAL, PJSUA_SIP_TIMER_REQUIRED, PJSUA_SIP_TIMER_ALWAYS} pjsua_sip_timer_use; 
    159  
    160 typedef enum pjsua_ipv6_use {PJSUA_IPV6_DISABLED, PJSUA_IPV6_ENABLED} pjsua_ipv6_use; 
    161  
    162 typedef enum pjsua_nat64_opt {PJSUA_NAT64_DISABLED, PJSUA_NAT64_ENABLED} pjsua_nat64_opt; 
    163  
    164 typedef enum pjsua_buddy_status {PJSUA_BUDDY_STATUS_UNKNOWN, PJSUA_BUDDY_STATUS_ONLINE, PJSUA_BUDDY_STATUS_OFFLINE} pjsua_buddy_status; 
    165  
    166 typedef enum pjsua_call_media_status {PJSUA_CALL_MEDIA_NONE, PJSUA_CALL_MEDIA_ACTIVE, PJSUA_CALL_MEDIA_LOCAL_HOLD, PJSUA_CALL_MEDIA_REMOTE_HOLD, PJSUA_CALL_MEDIA_ERROR} pjsua_call_media_status; 
     717typedef enum pjsua_destroy_flag 
     718{ 
     719  PJSUA_DESTROY_NO_RX_MSG = 1, 
     720  PJSUA_DESTROY_NO_TX_MSG = 2, 
     721  PJSUA_DESTROY_NO_NETWORK = PJSUA_DESTROY_NO_RX_MSG | PJSUA_DESTROY_NO_TX_MSG 
     722} pjsua_destroy_flag; 
     723 
     724typedef enum pjsua_100rel_use 
     725{ 
     726  PJSUA_100REL_NOT_USED, 
     727  PJSUA_100REL_MANDATORY, 
     728  PJSUA_100REL_OPTIONAL 
     729} pjsua_100rel_use; 
     730 
     731typedef enum pjsua_sip_timer_use 
     732{ 
     733  PJSUA_SIP_TIMER_INACTIVE, 
     734  PJSUA_SIP_TIMER_OPTIONAL, 
     735  PJSUA_SIP_TIMER_REQUIRED, 
     736  PJSUA_SIP_TIMER_ALWAYS 
     737} pjsua_sip_timer_use; 
     738 
     739typedef enum pjsua_ipv6_use 
     740{ 
     741  PJSUA_IPV6_DISABLED, 
     742  PJSUA_IPV6_ENABLED 
     743} pjsua_ipv6_use; 
     744 
     745typedef enum pjsua_nat64_opt 
     746{ 
     747  PJSUA_NAT64_DISABLED, 
     748  PJSUA_NAT64_ENABLED 
     749} pjsua_nat64_opt; 
     750 
     751typedef enum pjsua_buddy_status 
     752{ 
     753  PJSUA_BUDDY_STATUS_UNKNOWN, 
     754  PJSUA_BUDDY_STATUS_ONLINE, 
     755  PJSUA_BUDDY_STATUS_OFFLINE 
     756} pjsua_buddy_status; 
     757 
     758typedef enum pjsua_call_media_status 
     759{ 
     760  PJSUA_CALL_MEDIA_NONE, 
     761  PJSUA_CALL_MEDIA_ACTIVE, 
     762  PJSUA_CALL_MEDIA_LOCAL_HOLD, 
     763  PJSUA_CALL_MEDIA_REMOTE_HOLD, 
     764  PJSUA_CALL_MEDIA_ERROR 
     765} pjsua_call_media_status; 
    167766 
    168767typedef int pjsua_vid_win_id; 
     
    170769typedef int pjsua_call_id; 
    171770 
    172 typedef enum pjsua_med_tp_st {PJSUA_MED_TP_NULL, PJSUA_MED_TP_CREATING, PJSUA_MED_TP_IDLE, PJSUA_MED_TP_INIT, PJSUA_MED_TP_RUNNING, PJSUA_MED_TP_DISABLED} pjsua_med_tp_st; 
    173  
    174 typedef enum pjsua_call_vid_strm_op {PJSUA_CALL_VID_STRM_NO_OP, PJSUA_CALL_VID_STRM_ADD, PJSUA_CALL_VID_STRM_REMOVE, PJSUA_CALL_VID_STRM_CHANGE_DIR, PJSUA_CALL_VID_STRM_CHANGE_CAP_DEV, PJSUA_CALL_VID_STRM_START_TRANSMIT, PJSUA_CALL_VID_STRM_STOP_TRANSMIT, PJSUA_CALL_VID_STRM_SEND_KEYFRAME} pjsua_call_vid_strm_op; 
    175  
    176 typedef enum pjsua_vid_req_keyframe_method {PJSUA_VID_REQ_KEYFRAME_SIP_INFO = 1, PJSUA_VID_REQ_KEYFRAME_RTCP_PLI = 2} pjsua_vid_req_keyframe_method; 
    177  
    178 typedef enum pjsua_call_flag {PJSUA_CALL_UNHOLD = 1, PJSUA_CALL_UPDATE_CONTACT = 2, PJSUA_CALL_INCLUDE_DISABLED_MEDIA = 4, PJSUA_CALL_NO_SDP_OFFER = 8, PJSUA_CALL_REINIT_MEDIA = 16, PJSUA_CALL_UPDATE_VIA = 32, PJSUA_CALL_UPDATE_TARGET = 64} pjsua_call_flag; 
    179  
    180 typedef enum pjsua_create_media_transport_flag {PJSUA_MED_TP_CLOSE_MEMBER = 1} pjsua_create_media_transport_flag; 
    181  
    182 typedef enum pjsua_snd_dev_id {PJSUA_SND_DEFAULT_CAPTURE_DEV = PJMEDIA_AUD_DEFAULT_CAPTURE_DEV, PJSUA_SND_DEFAULT_PLAYBACK_DEV = PJMEDIA_AUD_DEFAULT_PLAYBACK_DEV, PJSUA_SND_NO_DEV = PJMEDIA_AUD_INVALID_DEV, PJSUA_SND_NULL_DEV = -99} pjsua_snd_dev_id; 
    183  
    184 typedef enum pjsua_snd_dev_mode {PJSUA_SND_DEV_SPEAKER_ONLY = 1, PJSUA_SND_DEV_NO_IMMEDIATE_OPEN = 2} pjsua_snd_dev_mode; 
    185  
    186 typedef enum pjsua_ip_change_op {PJSUA_IP_CHANGE_OP_NULL, PJSUA_IP_CHANGE_OP_RESTART_LIS, PJSUA_IP_CHANGE_OP_ACC_SHUTDOWN_TP, PJSUA_IP_CHANGE_OP_ACC_UPDATE_CONTACT, PJSUA_IP_CHANGE_OP_ACC_HANGUP_CALLS, PJSUA_IP_CHANGE_OP_ACC_REINVITE_CALLS} pjsua_ip_change_op; 
    187  
    188 typedef enum pjsua_dtmf_method {PJSUA_DTMF_METHOD_RFC2833, PJSUA_DTMF_METHOD_SIP_INFO} pjsua_dtmf_method; 
    189  
     771typedef enum pjsua_med_tp_st 
     772{ 
     773  PJSUA_MED_TP_NULL, 
     774  PJSUA_MED_TP_CREATING, 
     775  PJSUA_MED_TP_IDLE, 
     776  PJSUA_MED_TP_INIT, 
     777  PJSUA_MED_TP_RUNNING, 
     778  PJSUA_MED_TP_DISABLED 
     779} pjsua_med_tp_st; 
     780 
     781typedef enum pjsua_call_vid_strm_op 
     782{ 
     783  PJSUA_CALL_VID_STRM_NO_OP, 
     784  PJSUA_CALL_VID_STRM_ADD, 
     785  PJSUA_CALL_VID_STRM_REMOVE, 
     786  PJSUA_CALL_VID_STRM_CHANGE_DIR, 
     787  PJSUA_CALL_VID_STRM_CHANGE_CAP_DEV, 
     788  PJSUA_CALL_VID_STRM_START_TRANSMIT, 
     789  PJSUA_CALL_VID_STRM_STOP_TRANSMIT, 
     790  PJSUA_CALL_VID_STRM_SEND_KEYFRAME 
     791} pjsua_call_vid_strm_op; 
     792 
     793typedef enum pjsua_vid_req_keyframe_method 
     794{ 
     795  PJSUA_VID_REQ_KEYFRAME_SIP_INFO = 1, 
     796  PJSUA_VID_REQ_KEYFRAME_RTCP_PLI = 2 
     797} pjsua_vid_req_keyframe_method; 
     798 
     799typedef enum pjsua_call_flag 
     800{ 
     801  PJSUA_CALL_UNHOLD = 1, 
     802  PJSUA_CALL_UPDATE_CONTACT = 2, 
     803  PJSUA_CALL_INCLUDE_DISABLED_MEDIA = 4, 
     804  PJSUA_CALL_NO_SDP_OFFER = 8, 
     805  PJSUA_CALL_REINIT_MEDIA = 16, 
     806  PJSUA_CALL_UPDATE_VIA = 32, 
     807  PJSUA_CALL_UPDATE_TARGET = 64 
     808} pjsua_call_flag; 
     809 
     810typedef enum pjsua_create_media_transport_flag 
     811{ 
     812  PJSUA_MED_TP_CLOSE_MEMBER = 1 
     813} pjsua_create_media_transport_flag; 
     814 
     815typedef enum pjsua_snd_dev_id 
     816{ 
     817  PJSUA_SND_DEFAULT_CAPTURE_DEV = PJMEDIA_AUD_DEFAULT_CAPTURE_DEV, 
     818  PJSUA_SND_DEFAULT_PLAYBACK_DEV = PJMEDIA_AUD_DEFAULT_PLAYBACK_DEV, 
     819  PJSUA_SND_NO_DEV = PJMEDIA_AUD_INVALID_DEV, 
     820  PJSUA_SND_NULL_DEV = -99 
     821} pjsua_snd_dev_id; 
     822 
     823typedef enum pjsua_snd_dev_mode 
     824{ 
     825  PJSUA_SND_DEV_SPEAKER_ONLY = 1, 
     826  PJSUA_SND_DEV_NO_IMMEDIATE_OPEN = 2 
     827} pjsua_snd_dev_mode; 
     828 
     829typedef enum pjsua_ip_change_op 
     830{ 
     831  PJSUA_IP_CHANGE_OP_NULL, 
     832  PJSUA_IP_CHANGE_OP_RESTART_LIS, 
     833  PJSUA_IP_CHANGE_OP_ACC_SHUTDOWN_TP, 
     834  PJSUA_IP_CHANGE_OP_ACC_UPDATE_CONTACT, 
     835  PJSUA_IP_CHANGE_OP_ACC_HANGUP_CALLS, 
     836  PJSUA_IP_CHANGE_OP_ACC_REINVITE_CALLS 
     837} pjsua_ip_change_op; 
     838 
     839typedef enum pjsua_dtmf_method 
     840{ 
     841  PJSUA_DTMF_METHOD_RFC2833, 
     842  PJSUA_DTMF_METHOD_SIP_INFO 
     843} pjsua_dtmf_method; 
     844 
  • pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h

    r5918 r5923  
    17351735                                  const pjsua_ip_change_op_info *info); 
    17361736 
     1737    /** 
     1738     * Notification about media events such as video notifications. This 
     1739     * callback will most likely be called from media threads, thus 
     1740     * application must not perform heavy processing in this callback. 
     1741     * If application needs to perform more complex tasks to handle 
     1742     * the event, it should post the task to another thread. 
     1743     * 
     1744     * @param event     The media event. 
     1745     */ 
     1746    void (*on_media_event)(pjmedia_event *event); 
     1747 
    17371748} pjsua_callback; 
    17381749 
  • pjproject/trunk/pjsip/include/pjsua-lib/pjsua_internal.h

    r5911 r5923  
    698698 
    699699/* Callback to receive media events */ 
     700pj_status_t on_media_event(pjmedia_event *event, void *user_data); 
    700701pj_status_t call_media_on_event(pjmedia_event *event, 
    701702                                void *user_data); 
  • pjproject/trunk/pjsip/include/pjsua2/call.hpp

    r5899 r5923  
    228228}; 
    229229 
    230 /** 
    231  * This structure describes a media format changed event. 
    232  */ 
    233 struct MediaFmtChangedEvent 
    234 { 
    235     unsigned newWidth;      /**< The new width.     */ 
    236     unsigned newHeight;     /**< The new height.    */ 
    237 }; 
    238  
    239 /** 
    240  * Media event data. 
    241  */ 
    242 typedef union MediaEventData { 
    243     /** 
    244      * Media format changed event data. 
    245      */ 
    246     MediaFmtChangedEvent    fmtChanged; 
    247      
    248     /** 
    249      * Pointer to storage to user event data, if it's outside 
    250      * this struct 
    251      */ 
    252     GenericData         ptr; 
    253  
    254 } MediaEventData; 
    255  
    256 /** 
    257  * This structure describes a media event. It corresponds to the 
    258  * pjmedia_event structure. 
    259  */ 
    260 struct MediaEvent 
    261 { 
    262     /** 
    263      * The event type. 
    264      */ 
    265     pjmedia_event_type          type; 
    266  
    267     /** 
    268      * Additional data/parameters about the event. The type of data 
    269      * will be specific to the event type being reported. 
    270      */ 
    271     MediaEventData              data; 
    272      
    273     /** 
    274      * Pointer to original pjmedia_event. Only valid when the struct 
    275      * is converted from PJSIP's pjmedia_event. 
    276      */ 
    277     void                       *pjMediaEvent; 
    278  
    279 public: 
    280     /** 
    281      * Convert from pjsip 
    282      */ 
    283     void fromPj(const pjmedia_event &ev); 
    284 }; 
    285230 
    286231/** 
  • pjproject/trunk/pjsip/include/pjsua2/endpoint.hpp

    r5912 r5923  
    416416}; 
    417417 
     418/** 
     419 * Parameter of Endpoint::onCallMediaEvent() callback. 
     420 */ 
     421struct OnMediaEventParam 
     422{ 
     423    /** 
     424     * The media event. 
     425     */ 
     426    MediaEvent      ev; 
     427}; 
    418428 
    419429////////////////////////////////////////////////////////////////////////////// 
     
    15861596     */ 
    15871597    virtual void onIpChangeProgress(OnIpChangeProgressParam &prm) 
     1598    { PJ_UNUSED_ARG(prm); } 
     1599 
     1600    /** 
     1601     * Notification about media events such as video notifications. This 
     1602     * callback will most likely be called from media threads, thus 
     1603     * application must not perform heavy processing in this callback. 
     1604     * If application needs to perform more complex tasks to handle the 
     1605     * event, it should post the task to another thread. 
     1606     * 
     1607     * @param prm       Callback parameter. 
     1608     */ 
     1609    virtual void onMediaEvent(OnMediaEventParam &prm) 
    15881610    { PJ_UNUSED_ARG(prm); } 
    15891611 
     
    17341756    on_call_media_transport_state(pjsua_call_id call_id, 
    17351757                                  const pjsua_med_tp_state_info *info); 
     1758    static void on_media_event(pjmedia_event *event); 
    17361759    static void on_call_media_event(pjsua_call_id call_id, 
    17371760                                    unsigned med_idx, 
  • pjproject/trunk/pjsip/include/pjsua2/media.hpp

    r5896 r5923  
    21532153 
    21542154 
     2155/************************************************************************* 
     2156* Media event 
     2157*/ 
     2158 
     2159/** 
     2160 * This structure describes a media format changed event. 
     2161 */ 
     2162struct MediaFmtChangedEvent 
     2163{ 
     2164    unsigned newWidth;      /**< The new width.     */ 
     2165    unsigned newHeight;     /**< The new height.    */ 
     2166}; 
     2167 
     2168/** 
     2169 * This structure describes an audio device error event. 
     2170 */ 
     2171struct AudDevErrorEvent 
     2172{ 
     2173    pjmedia_dir             dir;        /**< The direction.         */ 
     2174    int                     id;         /**< The audio device ID.   */ 
     2175    pj_status_t             status;     /**< The status code.       */ 
     2176}; 
     2177 
     2178/** 
     2179 * Media event data. 
     2180 */ 
     2181typedef union MediaEventData { 
     2182    /** 
     2183     * Media format changed event data. 
     2184     */ 
     2185    MediaFmtChangedEvent    fmtChanged; 
     2186 
     2187    /** 
     2188     * Audio device error event data. 
     2189     */ 
     2190    AudDevErrorEvent        audDevError; 
     2191     
     2192    /** 
     2193     * Pointer to storage to user event data, if it's outside 
     2194     * this struct 
     2195     */ 
     2196    GenericData             ptr; 
     2197 
     2198} MediaEventData; 
     2199 
     2200/** 
     2201 * This structure describes a media event. It corresponds to the 
     2202 * pjmedia_event structure. 
     2203 */ 
     2204struct MediaEvent 
     2205{ 
     2206    /** 
     2207     * The event type. 
     2208     */ 
     2209    pjmedia_event_type          type; 
     2210 
     2211    /** 
     2212     * Additional data/parameters about the event. The type of data 
     2213     * will be specific to the event type being reported. 
     2214     */ 
     2215    MediaEventData              data; 
     2216     
     2217    /** 
     2218     * Pointer to original pjmedia_event. Only valid when the struct 
     2219     * is converted from PJSIP's pjmedia_event. 
     2220     */ 
     2221    void                       *pjMediaEvent; 
     2222 
     2223public: 
     2224    /** 
     2225     * Convert from pjsip 
     2226     */ 
     2227    void fromPj(const pjmedia_event &ev); 
     2228}; 
     2229 
    21552230/** 
    21562231 * @}  // PJSUA2_MED 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_aud.c

    r5920 r5923  
    19491949 
    19501950    /* Subscribe to audio device events */ 
    1951     pjmedia_event_subscribe(NULL, &call_media_on_event, NULL, 
     1951    pjmedia_event_subscribe(NULL, &on_media_event, NULL, 
    19521952                    pjmedia_snd_port_get_snd_stream(pjsua_var.snd_port)); 
    19531953 
     
    19901990 
    19911991        /* Unsubscribe from audio device events */ 
    1992         pjmedia_event_unsubscribe(NULL, &call_media_on_event, NULL, strm); 
     1992        pjmedia_event_unsubscribe(NULL, &on_media_event, NULL, strm); 
    19931993 
    19941994        pjmedia_snd_port_disconnect(pjsua_var.snd_port); 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c

    r5920 r5923  
    14211421} 
    14221422 
    1423  
    1424 /* Callback to receive media events */ 
     1423/* Callback to receive global media events */ 
     1424pj_status_t on_media_event(pjmedia_event *event, void *user_data) 
     1425{ 
     1426    pj_status_t status = PJ_SUCCESS; 
     1427 
     1428    PJ_UNUSED_ARG(user_data); 
     1429 
     1430    /* Forward the event */ 
     1431    if (pjsua_var.ua_cfg.cb.on_media_event) { 
     1432        (*pjsua_var.ua_cfg.cb.on_media_event)(event); 
     1433    } 
     1434 
     1435    return status; 
     1436} 
     1437 
     1438/* Callback to receive media events of a call */ 
    14251439pj_status_t call_media_on_event(pjmedia_event *event, 
    14261440                                void *user_data) 
  • pjproject/trunk/pjsip/src/pjsua2/call.cpp

    r5899 r5923  
    120120#endif     
    121121    pjSdpSession = (void *)&sdp; 
    122 } 
    123  
    124 void MediaEvent::fromPj(const pjmedia_event &ev) 
    125 { 
    126     type = ev.type; 
    127     if (type == PJMEDIA_EVENT_FMT_CHANGED) { 
    128         data.fmtChanged.newWidth = ev.data.fmt_changed.new_fmt.det.vid.size.w; 
    129         data.fmtChanged.newHeight = ev.data.fmt_changed.new_fmt.det.vid.size.h; 
    130     } 
    131     pjMediaEvent = (void *)&ev; 
    132122} 
    133123 
  • pjproject/trunk/pjsip/src/pjsua2/endpoint.cpp

    r5912 r5923  
    14311431    virtual void execute(bool is_pending) 
    14321432    { 
    1433         Call *call = Call::lookup(call_id); 
    1434         if (!call) 
    1435             return; 
    1436  
    14371433        if (is_pending) { 
    14381434            /* Can't do this anymore, pointer is invalid */ 
     
    14401436        } 
    14411437 
    1442         call->onCallMediaEvent(prm); 
     1438        if (call_id == PJSUA_INVALID_ID) { 
     1439            OnMediaEventParam prm2; 
     1440            prm2.ev = prm.ev; 
     1441            Endpoint::instance().onMediaEvent(prm2); 
     1442        } else { 
     1443            Call *call = Call::lookup(call_id); 
     1444             
     1445            if (call) 
     1446                call->onCallMediaEvent(prm); 
     1447        } 
    14431448    } 
    14441449}; 
     1450 
     1451void Endpoint::on_media_event(pjmedia_event *event) 
     1452{ 
     1453    PendingOnMediaEventCallback *job = new PendingOnMediaEventCallback; 
     1454 
     1455    job->call_id = PJSUA_INVALID_ID; 
     1456    job->prm.medIdx = 0; 
     1457    job->prm.ev.fromPj(*event); 
     1458     
     1459    Endpoint::instance().utilAddPendingJob(job); 
     1460} 
    14451461 
    14461462void Endpoint::on_call_media_event(pjsua_call_id call_id, 
     
    14481464                                   pjmedia_event *event) 
    14491465{ 
    1450     Call *call = Call::lookup(call_id); 
    1451     if (!call) { 
    1452         return; 
    1453     } 
    1454      
    14551466    PendingOnMediaEventCallback *job = new PendingOnMediaEventCallback; 
    14561467 
     
    16661677    ua_cfg.cb.on_call_media_transport_state = 
    16671678        &Endpoint::on_call_media_transport_state; 
     1679    ua_cfg.cb.on_media_event            = &Endpoint::on_media_event; 
    16681680    ua_cfg.cb.on_call_media_event       = &Endpoint::on_call_media_event; 
    16691681    ua_cfg.cb.on_create_media_transport = &Endpoint::on_create_media_transport; 
  • pjproject/trunk/pjsip/src/pjsua2/media.cpp

    r5792 r5923  
    17301730} 
    17311731 
     1732/////////////////////////////////////////////////////////////////////////////// 
     1733void MediaEvent::fromPj(const pjmedia_event &ev) 
     1734{ 
     1735    type = ev.type; 
     1736    if (type == PJMEDIA_EVENT_FMT_CHANGED) { 
     1737        data.fmtChanged.newWidth = ev.data.fmt_changed.new_fmt.det.vid.size.w; 
     1738        data.fmtChanged.newHeight = ev.data.fmt_changed.new_fmt.det.vid.size.h; 
     1739    } else if (type == PJMEDIA_EVENT_AUD_DEV_ERROR) { 
     1740        data.audDevError.dir = ev.data.aud_dev_err.dir; 
     1741        data.audDevError.id = ev.data.aud_dev_err.id; 
     1742        data.audDevError.status = ev.data.aud_dev_err.status; 
     1743    } 
     1744    pjMediaEvent = (void *)&ev; 
     1745} 
     1746 
Note: See TracChangeset for help on using the changeset viewer.