<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/6177">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Joshua Colp: Looks good to me, but someone else must approve; Approved for Submit
George Joseph: Looks good to me, approved
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">alembic/res_pjsip: Add "webrtc" configuration option<br><br>When the "webrtc" option was added in res_pjsip it was not added to the alembic<br>scripts. This patch adds the option for alembic.<br><br>Also, changed the sorcery configuration type to an OPT_YESNO_T value instead of<br>an OPT_BOOL_T so if this field is ever written to a database it will write out<br>the correct value.<br><br>ASTERISK-27119 #close<br><br>Change-Id: I3e199f060aea25e193c439fc5cf96be4d3ed1c7b<br>(cherry picked from commit b0c016cf6e0bcbe743f4f8286fb9b5ded830ccf7)<br>---<br>A contrib/ast-db-manage/config/versions/44ccced114ce_add_webrtc.py<br>M res/res_pjsip/pjsip_configuration.c<br>2 files changed, 32 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/contrib/ast-db-manage/config/versions/44ccced114ce_add_webrtc.py b/contrib/ast-db-manage/config/versions/44ccced114ce_add_webrtc.py<br>new file mode 100644<br>index 0000000..fdeb058<br>--- /dev/null<br>+++ b/contrib/ast-db-manage/config/versions/44ccced114ce_add_webrtc.py<br>@@ -0,0 +1,31 @@<br>+"""add webrtc option to ps_endpoints<br>+<br>+Revision ID: 44ccced114ce<br>+Revises: 164abbd708c<br>+Create Date: 2017-07-10 17:07:25.926150<br>+<br>+"""<br>+<br>+# revision identifiers, used by Alembic.<br>+revision = '44ccced114ce'<br>+down_revision = '164abbd708c'<br>+<br>+from alembic import op<br>+import sqlalchemy as sa<br>+from sqlalchemy.dialects.postgresql import ENUM<br>+<br>+YESNO_NAME = 'yesno_values'<br>+YESNO_VALUES = ['yes', 'no']<br>+<br>+def upgrade():<br>+ ############################# Enums ##############################<br>+<br>+ # yesno_values have already been created, so use postgres enum object<br>+ # type to get around "already created" issue - works okay with mysql<br>+ yesno_values = ENUM(*YESNO_VALUES, name=YESNO_NAME, create_type=False)<br>+<br>+ op.add_column('ps_endpoints', sa.Column('webrtc', yesno_values))<br>+<br>+<br>+def downgrade():<br>+ op.drop_column('ps_endpoints', 'webrtc')<br>diff --git a/res/res_pjsip/pjsip_configuration.c b/res/res_pjsip/pjsip_configuration.c<br>index 4e12b04..d3ff1f3 100644<br>--- a/res/res_pjsip/pjsip_configuration.c<br>+++ b/res/res_pjsip/pjsip_configuration.c<br>@@ -1994,7 +1994,7 @@<br> ast_sorcery_object_field_register(sip_sorcery, "endpoint", "max_audio_streams", "1", OPT_UINT_T, 0, FLDSET(struct ast_sip_endpoint, media.max_audio_streams));<br> 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));<br> ast_sorcery_object_field_register(sip_sorcery, "endpoint", "bundle", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, media.bundle));<br>- ast_sorcery_object_field_register(sip_sorcery, "endpoint", "webrtc", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, media.webrtc));<br>+ ast_sorcery_object_field_register(sip_sorcery, "endpoint", "webrtc", "no", OPT_YESNO_T, 1, FLDSET(struct ast_sip_endpoint, media.webrtc));<br> <br> if (ast_sip_initialize_sorcery_transport()) {<br> ast_log(LOG_ERROR, "Failed to register SIP transport support with sorcery\n");<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/6177">change 6177</a>. To unsubscribe, 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/6177"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15.0 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I3e199f060aea25e193c439fc5cf96be4d3ed1c7b </div>
<div style="display:none"> Gerrit-Change-Number: 6177 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>