<p>Camillo Toselli has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/19467">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">added send_rtcp_nack setting to decouple avpf signalling from webrtc setting<br><br>Change-Id: I5d855494a2ad00eac82f18e80d2fae5418c4cdbe<br>---<br>M channels/chan_pjsip.c<br>M configs/samples/pjsip.conf.sample<br>M contrib/realtime/mysql/mysql_config.sql<br>M contrib/realtime/postgresql/postgresql_config.sql<br>M include/asterisk/res_pjsip.h<br>M res/res_pjsip/pjsip_config.xml<br>M res/res_pjsip/pjsip_configuration.c<br>M res/res_pjsip_sdp_rtp.c<br>8 files changed, 37 insertions(+), 8 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/67/19467/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/channels/chan_pjsip.c b/channels/chan_pjsip.c</span><br><span>index e8fbb3d..87a85e4 100644</span><br><span>--- a/channels/chan_pjsip.c</span><br><span>+++ b/channels/chan_pjsip.c</span><br><span>@@ -1697,7 +1697,7 @@</span><br><span> if (ast_format_cap_iscompatible_format(ast_channel_nativeformats(ast), ast_format_vp8) != AST_FORMAT_CMP_NOT_EQUAL ||</span><br><span> ast_format_cap_iscompatible_format(ast_channel_nativeformats(ast), ast_format_vp9) != AST_FORMAT_CMP_NOT_EQUAL ||</span><br><span> ast_format_cap_iscompatible_format(ast_channel_nativeformats(ast), ast_format_h265) != AST_FORMAT_CMP_NOT_EQUAL ||</span><br><span style="color: hsl(0, 100%, 40%);">- (channel->session->endpoint->media.webrtc &&</span><br><span style="color: hsl(120, 100%, 40%);">+ ((channel->session->endpoint->media.webrtc || channel->session->endpoint->media.send_rtcp_nack) &&</span><br><span> ast_format_cap_iscompatible_format(ast_channel_nativeformats(ast), ast_format_h264) != AST_FORMAT_CMP_NOT_EQUAL)) {</span><br><span> /* FIXME Fake RTP write, this will be sent as an RTCP packet. Ideally the</span><br><span> * RTP engine would provide a way to externally write/schedule RTCP</span><br><span>diff --git a/configs/samples/pjsip.conf.sample b/configs/samples/pjsip.conf.sample</span><br><span>index b1c1657..1e31714 100644</span><br><span>--- a/configs/samples/pjsip.conf.sample</span><br><span>+++ b/configs/samples/pjsip.conf.sample</span><br><span>@@ -874,6 +874,7 @@</span><br><span> ; dtls_setup=actpass</span><br><span> ; A dtls_cert_file and a dtls_ca_file still need to be specified.</span><br><span> ; Default for this option is "no"</span><br><span style="color: hsl(120, 100%, 40%);">+;send_rtcp_nack= ; When set to "yes" enables rtcp nack passthrough in avpf to keep video streams synchronized</span><br><span> ;incoming_mwi_mailbox = ; Mailbox name to use when incoming MWI NOTIFYs are</span><br><span> ; received.</span><br><span> ; If an MWI NOTIFY is received FROM this endpoint,</span><br><span>diff --git a/contrib/realtime/mysql/mysql_config.sql b/contrib/realtime/mysql/mysql_config.sql</span><br><span>index 67482a6..807afeb 100644</span><br><span>--- a/contrib/realtime/mysql/mysql_config.sql</span><br><span>+++ b/contrib/realtime/mysql/mysql_config.sql</span><br><span>@@ -1334,3 +1334,8 @@</span><br><span> </span><br><span> UPDATE alembic_version SET version_num='8f72185e437f' WHERE alembic_version.version_num = 'a06d8f8462d9';</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+-- Running upgrade 8f72185e437f -> 33cccfd113cc</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ALTER TABLE ps_endpoints ADD COLUMN send_rtcp_nack ENUM('yes','no');</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+UPDATE alembic_version SET version_num='33cccfd113cc' WHERE alembic_version.version_num = '8f72185e437f';</span><br><span>\ No newline at end of file</span><br><span>diff --git a/contrib/realtime/postgresql/postgresql_config.sql b/contrib/realtime/postgresql/postgresql_config.sql</span><br><span>index 293a4f9..460cef7 100644</span><br><span>--- a/contrib/realtime/postgresql/postgresql_config.sql</span><br><span>+++ b/contrib/realtime/postgresql/postgresql_config.sql</span><br><span>@@ -1446,3 +1446,8 @@</span><br><span> </span><br><span> COMMIT;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+-- Running upgrade 8f72185e437f -> 33cccfd113cc</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ALTER TABLE ps_endpoints ADD COLUMN send_rtcp_nack yesno_values;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+UPDATE alembic_version SET version_num='33cccfd113cc' WHERE alembic_version.version_num = '8f72185e437f';</span><br><span>diff --git a/include/asterisk/res_pjsip.h b/include/asterisk/res_pjsip.h</span><br><span>index 209cdbf..e6b3598 100644</span><br><span>--- a/include/asterisk/res_pjsip.h</span><br><span>+++ b/include/asterisk/res_pjsip.h</span><br><span>@@ -834,6 +834,8 @@</span><br><span> unsigned int bundle;</span><br><span> /*! Enable webrtc settings and defaults */</span><br><span> unsigned int webrtc;</span><br><span style="color: hsl(120, 100%, 40%);">+ /*! Enable rtcp nack passthrough */</span><br><span style="color: hsl(120, 100%, 40%);">+ unsigned int send_rtcp_nack;</span><br><span> /*! Codec preference for an incoming offer */</span><br><span> struct ast_flags incoming_call_offer_pref;</span><br><span> /*! Codec preference for an outgoing offer */</span><br><span>diff --git a/res/res_pjsip/pjsip_config.xml b/res/res_pjsip/pjsip_config.xml</span><br><span>index ca5a266..d7f8cc0 100644</span><br><span>--- a/res/res_pjsip/pjsip_config.xml</span><br><span>+++ b/res/res_pjsip/pjsip_config.xml</span><br><span>@@ -1360,6 +1360,12 @@</span><br><span> <para>dtls_setup=actpass</para></span><br><span> </description></span><br><span> </configOption></span><br><span style="color: hsl(120, 100%, 40%);">+ <configOption name="send_rtcp_nack" default="no"></span><br><span style="color: hsl(120, 100%, 40%);">+ <synopsis>Enable sending RTCP NACKs</synopsis></span><br><span style="color: hsl(120, 100%, 40%);">+ <description><para></span><br><span style="color: hsl(120, 100%, 40%);">+ When set to "yes" enables rtcp nack passthrough in avpf to keep video streams synchronized</para></span><br><span style="color: hsl(120, 100%, 40%);">+ </description></span><br><span style="color: hsl(120, 100%, 40%);">+ </configOption></span><br><span> <configOption name="incoming_mwi_mailbox"></span><br><span> <synopsis>Mailbox name to use when incoming MWI NOTIFYs are received</synopsis></span><br><span> <description><para></span><br><span>diff --git a/res/res_pjsip/pjsip_configuration.c b/res/res_pjsip/pjsip_configuration.c</span><br><span>index 39c3dab..975b8d8 100644</span><br><span>--- a/res/res_pjsip/pjsip_configuration.c</span><br><span>+++ b/res/res_pjsip/pjsip_configuration.c</span><br><span>@@ -2170,6 +2170,7 @@</span><br><span> ast_sorcery_object_field_register(sip_sorcery, "endpoint", "max_video_streams", "1", OPT_UINT_T, 0, FLDSET(struct ast_sip_endpoint, media.max_video_streams));</span><br><span> ast_sorcery_object_field_register(sip_sorcery, "endpoint", "bundle", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, media.bundle));</span><br><span> ast_sorcery_object_field_register(sip_sorcery, "endpoint", "webrtc", "no", OPT_YESNO_T, 1, FLDSET(struct ast_sip_endpoint, media.webrtc));</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_sorcery_object_field_register(sip_sorcery, "endpoint", "send_rtcp_nack", "no", OPT_YESNO_T, 1, FLDSET(struct ast_sip_endpoint, media.send_rtcp_nack));</span><br><span> ast_sorcery_object_field_register(sip_sorcery, "endpoint", "incoming_mwi_mailbox", "", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_sip_endpoint, incoming_mwi_mailbox));</span><br><span> ast_sorcery_object_field_register(sip_sorcery, "endpoint", "follow_early_media_fork", "yes", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, media.rtp.follow_early_media_fork));</span><br><span> ast_sorcery_object_field_register(sip_sorcery, "endpoint", "accept_multiple_sdp_answers", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, media.rtp.accept_multiple_sdp_answers));</span><br><span>diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c</span><br><span>index e1d1701..0dbacc7 100644</span><br><span>--- a/res/res_pjsip_sdp_rtp.c</span><br><span>+++ b/res/res_pjsip_sdp_rtp.c</span><br><span>@@ -294,10 +294,10 @@</span><br><span> ast_rtp_instance_set_qos(session_media->rtp, session->endpoint->media.tos_audio,</span><br><span> session->endpoint->media.cos_audio, "SIP RTP Audio");</span><br><span> } else if (session_media->type == AST_MEDIA_TYPE_VIDEO) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_rtp_instance_set_prop(session_media->rtp, AST_RTP_PROPERTY_RETRANS_RECV, session->endpoint->media.webrtc);</span><br><span style="color: hsl(0, 100%, 40%);">- ast_rtp_instance_set_prop(session_media->rtp, AST_RTP_PROPERTY_RETRANS_SEND, session->endpoint->media.webrtc);</span><br><span style="color: hsl(0, 100%, 40%);">- ast_rtp_instance_set_prop(session_media->rtp, AST_RTP_PROPERTY_REMB, session->endpoint->media.webrtc);</span><br><span style="color: hsl(0, 100%, 40%);">- if (session->endpoint->media.webrtc) {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_rtp_instance_set_prop(session_media->rtp, AST_RTP_PROPERTY_RETRANS_RECV, session->endpoint->media.webrtc || session->endpoint->media.send_rtcp_nack);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_rtp_instance_set_prop(session_media->rtp, AST_RTP_PROPERTY_RETRANS_SEND, session->endpoint->media.webrtc || session->endpoint->media.send_rtcp_nack);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_rtp_instance_set_prop(session_media->rtp, AST_RTP_PROPERTY_REMB, session->endpoint->media.webrtc || session->endpoint->media.send_rtcp_nack);</span><br><span style="color: hsl(120, 100%, 40%);">+ if (session->endpoint->media.webrtc || session->endpoint->media.send_rtcp_nack) {</span><br><span> enable_rtp_extension(session, session_media, AST_RTP_EXTENSION_ABS_SEND_TIME, AST_RTP_EXTENSION_DIRECTION_SENDRECV, sdp);</span><br><span> enable_rtp_extension(session, session_media, AST_RTP_EXTENSION_TRANSPORT_WIDE_CC, AST_RTP_EXTENSION_DIRECTION_SENDRECV, sdp);</span><br><span> }</span><br><span>@@ -1329,7 +1329,7 @@</span><br><span> pj_str_t stmp;</span><br><span> pjmedia_sdp_attr *attr;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (!session->endpoint->media.webrtc) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!(session->endpoint->media.webrtc || session->endpoint->media.send_rtcp_nack)) {</span><br><span> return;</span><br><span> }</span><br><span> </span><br><span>@@ -1364,7 +1364,7 @@</span><br><span> int idx;</span><br><span> char extmap_value[256];</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (!session->endpoint->media.webrtc || session_media->type != AST_MEDIA_TYPE_VIDEO) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!(session->endpoint->media.webrtc || session->endpoint->media.send_rtcp_nack) || session_media->type != AST_MEDIA_TYPE_VIDEO) {</span><br><span> return;</span><br><span> }</span><br><span> </span><br><span>@@ -1413,7 +1413,7 @@</span><br><span> {</span><br><span> int index;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- if (!session->endpoint->media.webrtc || session_media->type != AST_MEDIA_TYPE_VIDEO) {</span><br><span style="color: hsl(120, 100%, 40%);">+ if (!(session->endpoint->media.webrtc || session->endpoint->media.send_rtcp_nack) || session_media->type != AST_MEDIA_TYPE_VIDEO) {</span><br><span> return;</span><br><span> }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/19467">change 19467</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/19467"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 18.11 </div>
<div style="display:none"> Gerrit-Change-Id: I5d855494a2ad00eac82f18e80d2fae5418c4cdbe </div>
<div style="display:none"> Gerrit-Change-Number: 19467 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Camillo Toselli <camillo.toselli@unibo.it> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>