From d33ed08afcf6bd76e24843462a261f0e23bb6723 Mon Sep 17 00:00:00 2001
From: Joshua Colp <jcolp@digium.com>
Date: Fri, 27 Jul 2018 15:46:12 +0000
Subject: [PATCH] res_pjsip_pubsub: Treat "prune_on_boot" as a yes / no.

The alembic for the PJSIP subscription persistence table has the
"prune_on_boot" field as a boolean. While in Asterisk we are
tolerant of many different definitions of true and false in the
database we only accept "yes" and "no". This change makes the
field treated as a yes/no instead of an integer, thus storing
"yes" and "no" instead of "1" and "0".

Change-Id: Ic8b9211b36babefe78f70def6828a135a6ae7ab6
---
 res/res_pjsip_pubsub.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c
index 2f32ebc4d0..a0ec02f09c 100644
--- a/res/res_pjsip_pubsub.c
+++ b/res/res_pjsip_pubsub.c
@@ -5589,7 +5589,7 @@ static int load_module(void)
 		persistence_expires_str2struct, persistence_expires_struct2str, NULL, 0, 0);
 	ast_sorcery_object_field_register(sorcery, "subscription_persistence", "contact_uri", "", OPT_CHAR_ARRAY_T, 0,
 		CHARFLDSET(struct subscription_persistence, contact_uri));
-	ast_sorcery_object_field_register(sorcery, "subscription_persistence", "prune_on_boot", "0", OPT_UINT_T, 0,
+	ast_sorcery_object_field_register(sorcery, "subscription_persistence", "prune_on_boot", "no", OPT_YESNO_T, 0,
 		FLDSET(struct subscription_persistence, prune_on_boot));
 
 	if (apply_list_configuration(sorcery)) {
-- 
GitLab