pjsip: new endpoint's options to control Connected Line updates

This patch adds new options 'trust_connected_line' and 'send_connected_line'
to the endpoint.

The option 'trust_connected_line' is to control if connected line updates
are accepted from this endpoint.

The option 'send_connected_line' is to control if connected line updates
can be sent to this endpoint.

The default value is 'yes' for both options.

Change-Id: I16af967815efd904597ec2f033337e4333d097cd
This commit is contained in:
Alexei Gradinari
2018-10-22 12:49:37 -04:00
committed by Richard Mudgett
parent 584e08b81b
commit eee935983b
8 changed files with 79 additions and 3 deletions

View File

@@ -341,7 +341,8 @@ static void update_incoming_connected_line(struct ast_sip_session *session, pjsi
{
struct ast_party_id id;
if (!session->endpoint->id.trust_inbound) {
if (!session->endpoint->id.trust_connected_line
|| !session->endpoint->id.trust_inbound) {
return;
}
@@ -749,7 +750,10 @@ static void caller_id_outgoing_response(struct ast_sip_session *session, pjsip_t
struct ast_party_id effective_id;
struct ast_party_id connected_id;
if (!session->channel) {
if (!session->channel
|| (!session->endpoint->id.send_connected_line
&& session->inv_session
&& session->inv_session->state >= PJSIP_INV_STATE_EARLY)) {
return;
}