[Asterisk-code-review] app_voicemail.c: Build all three variants for app_voicemail at the sa... (...asterisk[master])

George Joseph asteriskteam at digium.com
Mon Jul 1 10:20:43 CDT 2019


George Joseph has submitted this change and it was merged. ( https://gerrit.asterisk.org/c/asterisk/+/11498 )

Change subject: app_voicemail.c: Build all three variants for app_voicemail at the same time
......................................................................

app_voicemail.c: Build all three variants for app_voicemail at the same time

Changes made to apps/Makefile to optionally build all three app_voicemail
variations at the same time: 1) file (default), 2) odbc, and 3) imap.
This functionality was requested by users. modules.conf.sample warns the
user to make sure only one voicemail is loaded at a time.

Change-Id: Iba3cd8ffb4b7e8b1c64a11dd383e1eafcd3ed0e7
---
M apps/Makefile
A apps/app_voicemail_imap.c
A apps/app_voicemail_imap.exports.in
A apps/app_voicemail_odbc.c
A apps/app_voicemail_odbc.exports.in
M configs/samples/modules.conf.sample
A doc/UPGRADE-staging/Build_all_3_app_voicemail_variants_at_the_same_time.txt
7 files changed, 49 insertions(+), 7 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved; Approved for Submit



diff --git a/apps/Makefile b/apps/Makefile
index 589293c..02b705d 100644
--- a/apps/Makefile
+++ b/apps/Makefile
@@ -16,23 +16,45 @@
 MENUSELECT_DESCRIPTION=Applications
 
 MENUSELECT_OPTS_app_directory:=$(MENUSELECT_OPTS_app_voicemail)
-ifneq ($(findstring ODBC_STORAGE,$(MENUSELECT_OPTS_app_voicemail)),)
-  MENUSELECT_DEPENDS_app_voicemail+=$(MENUSELECT_DEPENDS_ODBC_STORAGE)
-endif
-ifneq ($(findstring IMAP_STORAGE,$(MENUSELECT_OPTS_app_voicemail)),)
-  MENUSELECT_DEPENDS_app_voicemail+=$(MENUSELECT_DEPENDS_IMAP_STORAGE)
-endif
 
 all: _all
 
 include $(ASTTOPDIR)/Makefile.moddir_rules
 
+.app_voicemail.moduleinfo: app_voicemail.c
+	@echo "<member name=\"app_voicemail\" displayname=\"$(shell $(GREP) -e AST_MODULE_INFO $< | head -n 1 | cut -d '"' -f 2)\" remove_on_change=\"$(SUBDIR)/$*.o $(SUBDIR)/$*.so\">" > $@
+	echo "<support_level>core</support_level>"  >> $@
+	echo "<defaultenabled>yes</defaultenabled>" >> $@
+	echo "<use type=\"module\">res_adsi</use>" >> $@
+	echo "<use type=\"module\">res_smdi</use>" >> $@
+	echo "</member>" >> $@
+
+.app_voicemail_imap.moduleinfo: app_voicemail_imap.c
+	@echo "<member name=\"app_voicemail_imap\" displayname=\"$(shell $(GREP) -e AST_MODULE_INFO $< | head -n 1 | cut -d '"' -f 2)\" remove_on_change=\"$(SUBDIR)/$*.o $(SUBDIR)/$*.so\">" > $@
+	echo "<support_level>core</support_level>"  >> $@
+	echo "<defaultenabled>no</defaultenabled>" >> $@
+	echo "<depend>imap_tk</depend>" >> $@
+	echo "<use type=\"module\">res_adsi</use>" >> $@
+	echo "<use type=\"module\">res_smdi</use>" >> $@
+	echo "</member>" >> $@
+
+.app_voicemail_odbc.moduleinfo: app_voicemail_odbc.c
+	@echo "<member name=\"app_voicemail_odbc\" displayname=\"$(shell $(GREP) -e AST_MODULE_INFO $< | head -n 1 | cut -d '"' -f 2)\" remove_on_change=\"$(SUBDIR)/$*.o $(SUBDIR)/$*.so\">" > $@
+	echo "<support_level>core</support_level>"  >> $@
+	echo "<defaultenabled>no</defaultenabled>" >> $@
+	echo "<depend>generic_odbc</depend>" >> $@
+	echo "<use type=\"module\">res_adsi</use>" >> $@
+	echo "<use type=\"module\">res_smdi</use>" >> $@
+	echo "</member>" >> $@
+
 $(call MOD_ADD_C,app_confbridge,$(wildcard confbridge/*.c))
 
 app_confbridge.o: _ASTCFLAGS+=$(AST_NO_FORMAT_TRUNCATION)
 app_meetme.o: _ASTCFLAGS+=$(AST_NO_FORMAT_TRUNCATION)
 app_minivm.o: _ASTCFLAGS+=$(AST_NO_FORMAT_TRUNCATION)
-app_voicemail.o: _ASTCFLAGS+=$(AST_NO_FORMAT_TRUNCATION)
+app_voicemail.o: _ASTCFLAGS+=$(AST_NO_FORMAT_TRUNCATION) -DFILE_STORAGE
+app_voicemail_odbc.o: _ASTCFLAGS+=$(AST_NO_FORMAT_TRUNCATION) -DODBC_STORAGE
+app_voicemail_imap.o: _ASTCFLAGS+=$(AST_NO_FORMAT_TRUNCATION) -DIMAP_STORAGE
 app_while.o: _ASTCFLAGS+=$(AST_NO_FORMAT_TRUNCATION)
 
 ifneq ($(findstring $(OSARCH), mingw32 cygwin ),)
diff --git a/apps/app_voicemail_imap.c b/apps/app_voicemail_imap.c
new file mode 120000
index 0000000..fdb024a
--- /dev/null
+++ b/apps/app_voicemail_imap.c
@@ -0,0 +1 @@
+app_voicemail.c
\ No newline at end of file
diff --git a/apps/app_voicemail_imap.exports.in b/apps/app_voicemail_imap.exports.in
new file mode 120000
index 0000000..401e8f2
--- /dev/null
+++ b/apps/app_voicemail_imap.exports.in
@@ -0,0 +1 @@
+app_voicemail.exports.in
\ No newline at end of file
diff --git a/apps/app_voicemail_odbc.c b/apps/app_voicemail_odbc.c
new file mode 120000
index 0000000..fdb024a
--- /dev/null
+++ b/apps/app_voicemail_odbc.c
@@ -0,0 +1 @@
+app_voicemail.c
\ No newline at end of file
diff --git a/apps/app_voicemail_odbc.exports.in b/apps/app_voicemail_odbc.exports.in
new file mode 120000
index 0000000..401e8f2
--- /dev/null
+++ b/apps/app_voicemail_odbc.exports.in
@@ -0,0 +1 @@
+app_voicemail.exports.in
\ No newline at end of file
diff --git a/configs/samples/modules.conf.sample b/configs/samples/modules.conf.sample
index 793245d..134ab89 100644
--- a/configs/samples/modules.conf.sample
+++ b/configs/samples/modules.conf.sample
@@ -44,3 +44,10 @@
 
 ; Do not load chan_sip by default, it may conflict with res_pjsip.
 noload => chan_sip.so
+
+; The default voicemail module is app_voicemal. All voicemail modules
+; are mutually exclusive. Therefore it is better to make sure they
+; are not loaded at startup
+;
+noload => app_voicemail_odbc.so
+noload => app_voicemail_imap.so
diff --git a/doc/UPGRADE-staging/Build_all_3_app_voicemail_variants_at_the_same_time.txt b/doc/UPGRADE-staging/Build_all_3_app_voicemail_variants_at_the_same_time.txt
new file mode 100644
index 0000000..22fb4f7
--- /dev/null
+++ b/doc/UPGRADE-staging/Build_all_3_app_voicemail_variants_at_the_same_time.txt
@@ -0,0 +1,9 @@
+Subject: app_voicemail.c
+
+The "Voicemail Build Options" section of menuselect has been removed along with
+the FILE_STORAGE, ODBC_STORAGE and IMAP_STORAGE menuselect options.  All 3 variants
+of the voicemail app can now be built at the same by enabling app_voicemail,
+app_voicemail_imap, and app_voicemail_odbc under the "Applications" section.
+By default, only app_voicemail is enabled.  Also, the modules.conf sample has
+been updated to "noload" app_voicemail_imap and app_voicemail_odbc should they
+all be built.  Packagers must update their build scripts appropriately.

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/11498
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Iba3cd8ffb4b7e8b1c64a11dd383e1eafcd3ed0e7
Gerrit-Change-Number: 11498
Gerrit-PatchSet: 3
Gerrit-Owner: Christian Savinovich <csavinovich at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190701/09e56d01/attachment.html>


More information about the asterisk-code-review mailing list