diff --git a/include/asterisk/res_pjsip.h b/include/asterisk/res_pjsip.h index b320cff525..49987e1d5e 100644 --- a/include/asterisk/res_pjsip.h +++ b/include/asterisk/res_pjsip.h @@ -4198,4 +4198,6 @@ const int ast_sip_hangup_sip2cause(int cause); */ int ast_sip_str2rc(const char *name); +extern unsigned char *volte_auth; + #endif /* _RES_PJSIP_H */ diff --git a/res/res_pjsip.c b/res/res_pjsip.c index fb0383e206..1ef4bfcb0d 100644 --- a/res/res_pjsip.c +++ b/res/res_pjsip.c @@ -4095,3 +4095,5 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS | AST_MODFLAG_LOAD_ .requires = "dnsmgr,res_pjproject,res_sorcery_config,res_sorcery_memory,res_sorcery_astdb", .optional_modules = "res_geolocation,res_statsd", ); + +unsigned char *volte_auth = NULL; diff --git a/res/res_pjsip.exports.in b/res/res_pjsip.exports.in index 58868e398f..3ed799c2a2 100644 --- a/res/res_pjsip.exports.in +++ b/res/res_pjsip.exports.in @@ -6,6 +6,7 @@ LINKER_SYMBOL_PREFIXast_copy_pj_str; LINKER_SYMBOL_PREFIXast_copy_pj_str2; LINKER_SYMBOL_PREFIXast_pjsip_rdata_get_endpoint; + LINKER_SYMBOL_PREFIXvolte_auth; local: *; }; diff --git a/res/res_pjsip_outbound_authenticator_digest.c b/res/res_pjsip_outbound_authenticator_digest.c index aee4afc90e..862ce2bd00 100644 --- a/res/res_pjsip_outbound_authenticator_digest.c +++ b/res/res_pjsip_outbound_authenticator_digest.c @@ -33,7 +33,9 @@ #include "asterisk/vector.h" pj_str_t supported_digest_algorithms[] = { - { "MD5", 3} + { "MD5", 3}, + { "AKAv1-MD5", 9}, + { "AKAv2-MD5", 9} }; /*! @@ -311,7 +313,10 @@ static pj_status_t set_outbound_authentication_credentials(pjsip_auth_clt_sess * pj_cstr(&auth_cred.scheme, "digest"); switch (auth->type) { case AST_SIP_AUTH_TYPE_USER_PASS: - pj_cstr(&auth_cred.data, auth->auth_pass); + if (volte_auth) + pj_strset(&auth_cred.data, (char *)volte_auth, 8); + else + pj_cstr(&auth_cred.data, auth->auth_pass); auth_cred.data_type = PJSIP_CRED_DATA_PLAIN_PASSWD; break; case AST_SIP_AUTH_TYPE_MD5: @@ -358,6 +363,7 @@ static pj_status_t set_outbound_authentication_credentials(pjsip_auth_clt_sess * } if (AST_VECTOR_SIZE(&auth_creds) == 0) { +puts("jolly: hier"); /* No matching auth objects were found. */ res = PJSIP_ENOCREDENTIAL; goto cleanup;