diff options
author | Benny Prijono <bennylp@teluu.com> | 2008-01-23 20:39:07 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2008-01-23 20:39:07 +0000 |
commit | 8686b3135348bcd69bdb3c3cb6660a82d989bb30 (patch) | |
tree | 31d9c111724f083782ba5782c58ab2d30a867933 /pjsip/include | |
parent | 5035ea445fbf6de061efacd90c66390ca15806ed (diff) |
Ticket #61: Implement SRTP support in PJMEDIA and PJSUA-LIB, and updated applications because of the changes. This is a major modification back ported from SRTP branch. See ticket #61 for changelog detail of this commit
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1735 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/include')
-rw-r--r-- | pjsip/include/pjsua-lib/pjsua.h | 75 | ||||
-rw-r--r-- | pjsip/include/pjsua-lib/pjsua_internal.h | 9 |
2 files changed, 81 insertions, 3 deletions
diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h index a1c5c86d..d78eeb78 100644 --- a/pjsip/include/pjsua-lib/pjsua.h +++ b/pjsip/include/pjsua-lib/pjsua.h @@ -403,7 +403,28 @@ typedef int pjsua_conf_port_id; # define PJSUA_ACC_MAX_PROXIES 8 #endif +#if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) +/** + * Default value of SRTP mode usage. Valid values are PJMEDIA_SRTP_DISABLED, + * PJMEDIA_SRTP_OPTIONAL, and PJMEDIA_SRTP_MANDATORY. + */ +#ifndef PJSUA_DEFAULT_USE_SRTP + #define PJSUA_DEFAULT_USE_SRTP PJMEDIA_SRTP_DISABLED +#endif + +/** + * Default value of secure signaling requirement for SRTP. + * Valid values are: + * 0: SRTP does not require secure signaling + * 1: SRTP requires secure transport such as TLS + * 2: SRTP requires secure end-to-end transport (SIPS) + */ +#ifndef PJSUA_DEFAULT_SRTP_SECURE_SIGNALING + #define PJSUA_DEFAULT_SRTP_SECURE_SIGNALING 1 +#endif + +#endif /** * Logging configuration, which can be (optionally) specified when calling @@ -1034,6 +1055,36 @@ typedef struct pjsua_config */ pj_str_t user_agent; +#if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) + /** + * Specify default value of secure media transport usage. + * Valid values are PJMEDIA_SRTP_DISABLED, PJMEDIA_SRTP_OPTIONAL, and + * PJMEDIA_SRTP_MANDATORY. + * + * Note that this setting can be further customized in account + * configuration (#pjsua_acc_config). + * + * Default: #PJSUA_DEFAULT_USE_SRTP + */ + pjmedia_srtp_use use_srtp; + + /** + * Specify whether SRTP requires secure signaling to be used. This option + * is only used when \a use_srtp option above is non-zero. + * + * Valid values are: + * 0: SRTP does not require secure signaling + * 1: SRTP requires secure transport such as TLS + * 2: SRTP requires secure end-to-end transport (SIPS) + * + * Note that this setting can be further customized in account + * configuration (#pjsua_acc_config). + * + * Default: #PJSUA_DEFAULT_SRTP_SECURE_SIGNALING + */ + int srtp_secure_signaling; +#endif + } pjsua_config; @@ -1971,6 +2022,30 @@ typedef struct pjsua_acc_config */ pj_str_t ka_data; +#if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0) + /** + * Specify whether secure media transport should be used for this account. + * Valid values are PJMEDIA_SRTP_DISABLED, PJMEDIA_SRTP_OPTIONAL, and + * PJMEDIA_SRTP_MANDATORY. + * + * Default: #PJSUA_DEFAULT_USE_SRTP + */ + pjmedia_srtp_use use_srtp; + + /** + * Specify whether SRTP requires secure signaling to be used. This option + * is only used when \a use_srtp option above is non-zero. + * + * Valid values are: + * 0: SRTP does not require secure signaling + * 1: SRTP requires secure transport such as TLS + * 2: SRTP requires secure end-to-end transport (SIPS) + * + * Default: #PJSUA_DEFAULT_SRTP_SECURE_SIGNALING + */ + int srtp_secure_signaling; +#endif + } pjsua_acc_config; diff --git a/pjsip/include/pjsua-lib/pjsua_internal.h b/pjsip/include/pjsua-lib/pjsua_internal.h index 943eb694..261cea0e 100644 --- a/pjsip/include/pjsua-lib/pjsua_internal.h +++ b/pjsip/include/pjsua-lib/pjsua_internal.h @@ -50,7 +50,8 @@ typedef struct pjsua_call int conf_slot; /**< Slot # in conference bridge. */ pjsip_evsub *xfer_sub; /**< Xfer server subscription, if this call was triggered by xfer. */ - pjmedia_transport *med_tp; /**< Media transport. */ + pjmedia_transport *med_tp; /**< Current media transport. */ + pjmedia_transport *med_orig; /**< Original media transport */ pj_timer_entry refresh_tm;/**< Timer to send re-INVITE. */ pj_timer_entry hangup_tm; /**< Timer to hangup call. */ pj_stun_nat_type rem_nat_type; /**< NAT type of remote endpoint. */ @@ -313,12 +314,14 @@ pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata); * Media channel. */ pj_status_t pjsua_media_channel_init(pjsua_call_id call_id, - pjsip_role_e role); + pjsip_role_e role, + int security_level); pj_status_t pjsua_media_channel_create_sdp(pjsua_call_id call_id, pj_pool_t *pool, + const pjmedia_sdp_session *rem_sdp, pjmedia_sdp_session **p_sdp); pj_status_t pjsua_media_channel_update(pjsua_call_id call_id, - const pjmedia_sdp_session *local_sdp, + pjmedia_sdp_session *local_sdp, const pjmedia_sdp_session *remote_sdp); pj_status_t pjsua_media_channel_deinit(pjsua_call_id call_id); |