mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 10:33:13 +00:00
Merge "res_pjsip: Use hash for contact object identity instead of Contact URI."
This commit is contained in:
@@ -269,8 +269,10 @@ int ast_sip_location_add_contact(struct ast_sip_aor *aor, const char *uri,
|
|||||||
{
|
{
|
||||||
char name[MAX_OBJECT_FIELD * 2 + 3];
|
char name[MAX_OBJECT_FIELD * 2 + 3];
|
||||||
RAII_VAR(struct ast_sip_contact *, contact, NULL, ao2_cleanup);
|
RAII_VAR(struct ast_sip_contact *, contact, NULL, ao2_cleanup);
|
||||||
|
char hash[33];
|
||||||
|
|
||||||
snprintf(name, sizeof(name), "%s;@%s", ast_sorcery_object_get_id(aor), uri);
|
ast_md5_hash(hash, uri);
|
||||||
|
snprintf(name, sizeof(name), "%s;@%s", ast_sorcery_object_get_id(aor), hash);
|
||||||
|
|
||||||
if (!(contact = ast_sorcery_alloc(ast_sip_get_sorcery(), "contact", name))) {
|
if (!(contact = ast_sorcery_alloc(ast_sip_get_sorcery(), "contact", name))) {
|
||||||
return -1;
|
return -1;
|
||||||
|
Reference in New Issue
Block a user