diff options
Diffstat (limited to 'pjsip/include')
-rw-r--r-- | pjsip/include/pjsip-ua/sip_regc.h | 11 | ||||
-rw-r--r-- | pjsip/include/pjsip/sip_auth.h | 46 | ||||
-rw-r--r-- | pjsip/include/pjsua-lib/pjsua.h | 12 |
3 files changed, 64 insertions, 5 deletions
diff --git a/pjsip/include/pjsip-ua/sip_regc.h b/pjsip/include/pjsip-ua/sip_regc.h index be2e37a5..62d2336f 100644 --- a/pjsip/include/pjsip-ua/sip_regc.h +++ b/pjsip/include/pjsip-ua/sip_regc.h @@ -189,6 +189,17 @@ PJ_DECL(pj_status_t) pjsip_regc_set_credentials( pjsip_regc *regc, const pjsip_cred_info cred[] ); /** + * Set authentication preference. + * + * @param regc The registration structure. + * @param pref Authentication preference. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjsip_regc_set_prefs( pjsip_regc *regc, + const pjsip_auth_clt_pref *pref); + +/** * Set route set to be used for outgoing requests. * * @param regc The client registration structure. diff --git a/pjsip/include/pjsip/sip_auth.h b/pjsip/include/pjsip/sip_auth.h index 466e85c2..155c180c 100644 --- a/pjsip/include/pjsip/sip_auth.h +++ b/pjsip/include/pjsip/sip_auth.h @@ -183,6 +183,28 @@ typedef struct pjsip_cached_auth /** + * This structure describes client authentication session preference. + * The preference can be set by calling #pjsip_auth_clt_set_prefs(). + */ +typedef struct pjsip_auth_clt_pref +{ + /** + * If this flag is set, the authentication client framework will + * send an empty Authorization header in each initial request. + * Default is no. + */ + pj_bool_t initial_auth; + + /** + * Specify the algorithm to use when empty Authorization header + * is to be sent for each initial request (see above) + */ + pj_str_t algorithm; + +} pjsip_auth_clt_pref; + + +/** * This structure describes client authentication sessions. It keeps * all the information needed to authorize the client against all downstream * servers. @@ -191,6 +213,7 @@ typedef struct pjsip_auth_clt_sess { pj_pool_t *pool; /**< Pool to use. */ pjsip_endpoint *endpt; /**< Endpoint where this belongs. */ + pjsip_auth_clt_pref pref; /**< Preference/options. */ unsigned cred_cnt; /**< Number of credentials. */ pjsip_cred_info *cred_info; /**< Array of credential information*/ pjsip_cached_auth cached_auth; /**< Cached authorization info. */ @@ -289,6 +312,29 @@ PJ_DECL(pj_status_t) pjsip_auth_clt_set_credentials( pjsip_auth_clt_sess *sess, /** + * Set the preference for the client authentication session. + * + * @param sess The client authentication session. + * @param p Preference. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjsip_auth_clt_set_prefs(pjsip_auth_clt_sess *sess, + const pjsip_auth_clt_pref *p); + + +/** + * Get the preference for the client authentication session. + * + * @param sess The client authentication session. + * @param p Pointer to receive the preference. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjsip_auth_clt_get_prefs(pjsip_auth_clt_sess *sess, + pjsip_auth_clt_pref *p); + +/** * Initialize new request message with authorization headers. * This function will put Authorization/Proxy-Authorization headers to the * outgoing request message. If caching is enabled (PJSIP_AUTH_HEADER_CACHING) diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h index 369f7015..db5a6496 100644 --- a/pjsip/include/pjsua-lib/pjsua.h +++ b/pjsip/include/pjsua-lib/pjsua.h @@ -1840,10 +1840,17 @@ typedef struct pjsua_acc_config /** * If this flag is set, the presence information of this account will * be PUBLISH-ed to the server where the account belongs. + * + * Default: PJ_FALSE */ pj_bool_t publish_enabled; /** + * Authentication preference. + */ + pjsip_auth_clt_pref auth_pref; + + /** * Optional PIDF tuple ID for outgoing PUBLISH and NOTIFY. If this value * is not specified, a random string will be used. */ @@ -1890,11 +1897,6 @@ typedef struct pjsua_acc_config */ pj_str_t proxy[PJSUA_ACC_MAX_PROXIES]; - /** - * Enable Service-Route processing for this account. - */ - pj_bool_t enable_service_route; - /** * Optional interval for registration, in seconds. If the value is zero, * default interval will be used (PJSUA_REG_INTERVAL, 300 seconds). |