[Freeswitch-users] mod_voicemail: skip instructions after recording

Michael Collins msc at freeswitch.org
Mon Apr 29 09:15:00 MSD 2013


Peter,

After looking at mod_voicemail.c I could tell that there's no way to do
this currently. However, like Brian said, there isn't a whole lot to it.
Here's a simple patch for you to test.

To use this just set the channel variables 'skip_record_check' and
'skip_urgent_check' to true. It should then just disconnect the channel
once the recording is done. The first variable turns off the record check
("1 to listen, 2 to save, 3 to re-record") and the second turns off the
urgent check ("to mark this message urgent, press 1...").

Also, if this seems to work then please open a new jira of type
"improvement" for project "FreeSWITCH" and attach this patch. (If you make
any adjustments, please create a new patch and attach it instead of this
file.)

Let us know how it goes.
-Michael



On Sun, Apr 28, 2013 at 3:30 AM, Peter Steinbach <lists at telefaks.de> wrote:

>  Hello Brian,
>
> I was thinking about that too. But is there a way of having a solution
> without patching the code?
>
>
> Best regards
> Peter
>
>
>
>
>
> On 04/26/13 15:45, Brian West wrote:
>
> Should be fairly simple to find where that ends in the code and add the proper bits so it doesn't play that.
>
> Its patches just like what you described that got me into coding C back when I started with Asterisk.
>
> On Apr 26, 2013, at 7:01 AM, Peter Steinbach <lists at telefaks.de> <lists at telefaks.de> wrote:
>
>
>  Anybody has a clue how to solve this?
>
>
>
> --
> Brian Westbrian at freeswitch.org
> FreeSWITCH Solutions, LLC
> PO BOX PO BOX 2531
> Brookfield, WI 53008-2531
> Twitter: @FreeSWITCH_Wire
> T: +1.918.420.9266  |  F: +1.918.420.9267  |  M: +1.918.424.WEST
> iNUM: +883 5100 1420 9266
> ISN: 410*543
>
>
>
>
>
>
>
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:consulting at freeswitch.orghttp://www.freeswitchsolutions.com
>
> FreeSWITCH-powered IP PBX: The CudaTel Communication Server
>
> Official FreeSWITCH Siteshttp://www.freeswitch.orghttp://wiki.freeswitch.orghttp://www.cluecon.com
>
> FreeSWITCH-users mailing listFreeSWITCH-users at lists.freeswitch.orghttp://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-usershttp://www.freeswitch.org
>
>
>
> --
> With kind regards
> Peter Steinbach
>
> Telefaks Services GmbHmailto:lists <lists> (att) telefaks.de
> Internet: www.telefaks.de
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> 
> 
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>


-- 
Michael S Collins
Twitter: @mercutioviz
http://www.FreeSWITCH.org
http://www.ClueCon.com
http://www.OSTAG.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130428/596f4629/attachment.html 
-------------- next part --------------
diff --git a/src/mod/applications/mod_voicemail/mod_voicemail.c b/src/mod/applications/mod_voicemail/mod_voicemail.c
index 26841a0..9cce758 100644
--- a/src/mod/applications/mod_voicemail/mod_voicemail.c
+++ b/src/mod/applications/mod_voicemail/mod_voicemail.c
@@ -1186,6 +1186,7 @@ static switch_status_t create_file(switch_core_session_t *session, vm_profile_t
 	cc_t cc = { 0 };
 	switch_codec_implementation_t read_impl = { 0 };
 	int got_file = 0;
+	switch_bool_t skip_record_check = switch_true(switch_channel_get_variable(channel, "skip_record_check"));
 
 	switch_core_session_get_read_impl(session, &read_impl);
 
@@ -1265,6 +1266,9 @@ static switch_status_t create_file(switch_core_session_t *session, vm_profile_t
 				*(input + 1) = '\0';
 				status = SWITCH_STATUS_SUCCESS;
 				*cc.buf = '\0';
+			} else if (skip_record_check) {
+				/* Skip the record check and simply return */
+				goto end;
 			} else {
 				(void) vm_macro_get(session, VM_RECORD_FILE_CHECK_MACRO, key_buf, input, sizeof(input), 1, "", &term, profile->digit_timeout);
 			}
@@ -3311,10 +3315,12 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, vm_p
 	int disk_quota = 0;
 	switch_bool_t skip_greeting = switch_true(switch_channel_get_variable(channel, "skip_greeting"));
 	switch_bool_t skip_instructions = switch_true(switch_channel_get_variable(channel, "skip_instructions"));
+	switch_bool_t skip_record_urgent_check = switch_true(switch_channel_get_variable(channel, "skip_record_urgent_check"));
 	switch_bool_t vm_enabled = SWITCH_TRUE;
 
 	switch_channel_set_variable(channel, "skip_greeting", NULL);
 	switch_channel_set_variable(channel, "skip_instructions", NULL);
+	switch_channel_set_variable(channel, "skip_record_urgent_check", NULL);
 
 	memset(&cbt, 0, sizeof(cbt));
 
@@ -3589,13 +3595,14 @@ static switch_status_t voicemail_leave_main(switch_core_session_t *session, vm_p
 		char input[10] = "", term = 0;
 
 		switch_snprintf(key_buf, sizeof(key_buf), "%s:%s", profile->urgent_key, profile->terminator_key);
-
-		(void) vm_macro_get(session, VM_RECORD_URGENT_CHECK_MACRO, key_buf, input, sizeof(input), 1, "", &term, profile->digit_timeout);
-		if (*profile->urgent_key == *input) {
-			read_flags = URGENT_FLAG_STRING;
-			(void) switch_ivr_phrase_macro(session, VM_ACK_MACRO, "marked-urgent", NULL, NULL);
-		} else {
-			(void) switch_ivr_phrase_macro(session, VM_ACK_MACRO, "saved", NULL, NULL);
+		if (!skip_record_urgent_check) {
+			(void) vm_macro_get(session, VM_RECORD_URGENT_CHECK_MACRO, key_buf, input, sizeof(input), 1, "", &term, profile->digit_timeout);
+			if (*profile->urgent_key == *input) {
+				read_flags = URGENT_FLAG_STRING;
+				(void) switch_ivr_phrase_macro(session, VM_ACK_MACRO, "marked-urgent", NULL, NULL);
+			} else {
+				(void) switch_ivr_phrase_macro(session, VM_ACK_MACRO, "saved", NULL, NULL);
+			}
 		}
 	}
 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list