res_pjsip: Add mediasec capabilities.

This patch adds support for mediasec SIP headers and SDP attributes.
These are defined in RFC 3329, 3GPP TS 24.229 and
draft-dawes-sipcore-mediasec-parameter. The new features are
implemented so that a backbone for RFC 3329 is present to streamline
future work on RFC 3329.

With this patch, Asterisk can communicate with Deutsche Telekom trunks
which require these fields.

ASTERISK-30032

Change-Id: Ia7f5b5ba42db18074fdd5428c4e1838728586be2
This commit is contained in:
Maximilian Fridrich
2022-07-26 14:01:04 +02:00
parent 8d6fdf9c3a
commit 14826a8038
12 changed files with 942 additions and 4 deletions

View File

@@ -348,6 +348,8 @@ static void sip_contact_status_dtor(void *obj)
{
struct ast_sip_contact_status *contact_status = obj;
ast_sip_security_mechanisms_vector_destroy(&contact_status->security_mechanisms);
ast_string_field_free_memory(contact_status);
}
@@ -365,6 +367,7 @@ static struct ast_sip_contact_status *sip_contact_status_alloc(const char *name)
ao2_ref(contact_status, -1);
return NULL;
}
AST_VECTOR_INIT(&contact_status->security_mechanisms, 0);
strcpy(contact_status->name, name); /* SAFE */
return contact_status;
}
@@ -385,6 +388,8 @@ static struct ast_sip_contact_status *sip_contact_status_copy(const struct ast_s
dst->rtt = src->rtt;
dst->status = src->status;
dst->last_status = src->last_status;
ast_sip_security_mechanisms_vector_copy(&dst->security_mechanisms, &src->security_mechanisms);
return dst;
}