]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3195, thank you Christian Benke
authorMichal Bielicki - cypromis <michal.bielicki@seventhsignal.de>
Tue, 26 Apr 2011 13:10:37 +0000 (15:10 +0200)
committerMichal Bielicki - cypromis <michal.bielicki@seventhsignal.de>
Tue, 26 Apr 2011 13:10:37 +0000 (15:10 +0200)
conf/lang/de/vm/sounds.xml [new file with mode: 0644]
src/mod/say/mod_say_de/mod_say_de.c

diff --git a/conf/lang/de/vm/sounds.xml b/conf/lang/de/vm/sounds.xml
new file mode 100644 (file)
index 0000000..ad9dc2e
--- /dev/null
@@ -0,0 +1,407 @@
+<include><!--This line will be ignored it's here to validate the xml and is optional -->
+  <macro name="voicemail_enter_id">
+    <input pattern="(.*)">
+      <match>
+               <action function="play-file" data="voicemail/vm-enter_id.wav"/>
+               <action function="say" data="$1" method="pronounced" type="name_spelled"/>
+      </match>
+    </input>
+  </macro>
+
+  <macro name="voicemail_enter_pass">
+    <input pattern="(.*)">
+      <match>
+               <action function="play-file" data="voicemail/vm-enter_pass.wav"/>
+               <action function="say" data="$1" method="pronounced" type="name_spelled"/>
+      </match>
+    </input>
+  </macro>
+
+  <macro name="voicemail_fail_auth">
+    <input pattern="(.*)">
+      <match>
+               <action function="play-file" data="voicemail/vm-fail_auth.wav"/>
+      </match>
+    </input>
+  </macro>
+
+  <macro name="voicemail_hello">
+    <input pattern="(.*)">
+      <match>
+               <!--<action function="play-file" data="voicemail/vm-hello.wav"/> -->
+      </match>
+    </input>
+  </macro>
+
+  <macro name="voicemail_goodbye">
+    <input pattern="(.*)">
+      <match>
+               <action function="play-file" data="voicemail/vm-goodbye.wav"/>
+      </match>
+    </input>
+  </macro>
+
+  <macro name="voicemail_abort">
+    <input pattern="(.*)">
+      <match>
+               <action function="play-file" data="voicemail/vm-abort.wav"/>
+      </match>
+    </input>
+  </macro>
+
+  <macro name="voicemail_message_count">
+    <input pattern="^(1):(.*)$" break_on_match="true">
+      <match>
+               <action function="play-file" data="voicemail/vm-you_have.wav"/>
+               <action application="log" data="INFO $1 $2"/>
+               <action function="say" data="$1" method="pronounced" type="items" gender="feminine"/>
+               <action function="play-file" data="voicemail/vm-$2.wav"/> 
+               <action function="play-file" data="voicemail/vm-message.wav"/>
+      </match>
+    </input>
+    <input pattern="^(\d+):(.*)$">
+      <match>
+               <action function="play-file" data="voicemail/vm-you_have.wav"/>
+               <action function="say" data="$1" method="pronounced" type="items" gender="feminine"/>
+               <action function="play-file" data="voicemail/vm-$2.wav"/> 
+               <action function="play-file" data="voicemail/vm-messages.wav"/>
+      </match>
+    </input>
+  </macro>
+
+  <macro name="voicemail_menu">
+    <input pattern="^([0-9#*]):([0-9#*]):([0-9#*]):([0-9#*])$">
+      <match>
+               <!-- To listen to new messages -->
+               <action function="play-file" data="voicemail/vm-listen_new.wav"/>
+               <action function="play-file" data="voicemail/vm-press.wav"/>
+               <action function="say" data="$1" method="pronounced" type="name_spelled"/>
+               <action function="execute" data="sleep(100)"/>
+
+               <!-- To listen to saved messages -->
+               <action function="play-file" data="voicemail/vm-listen_saved.wav"/>
+               <action function="play-file" data="voicemail/vm-press.wav"/>
+               <action function="say" data="$2" method="pronounced" type="name_spelled"/>
+               <action function="execute" data="sleep(100)"/>
+
+               <!-- For advanced options -->
+               <action function="play-file" data="voicemail/vm-advanced.wav"/>
+               <action function="play-file" data="voicemail/vm-press.wav"/>
+               <action function="say" data="$3" method="pronounced" type="name_spelled"/>
+               <action function="execute" data="sleep(100)"/>
+
+               <!-- To exit -->
+               <action function="play-file" data="voicemail/vm-to_exit.wav"/>
+               <action function="play-file" data="voicemail/vm-press.wav"/>
+               <action function="say" data="$4" method="pronounced" type="name_phonetic"/>
+      </match>
+    </input>
+  </macro>
+
+  <macro name="voicemail_config_menu">
+    <input pattern="^([0-9#*]):([0-9#*]):([0-9#*]):([0-9#*]):([0-9#*])$">
+      <match>
+               <!-- To record a greeting -->
+               <action function="play-file" data="voicemail/vm-to_record_greeting.wav"/>
+               <action function="play-file" data="voicemail/vm-press.wav"/>
+               <action function="say" data="$1" method="pronounced" type="name_spelled"/>
+               <action function="execute" data="sleep(100)"/>
+
+               <!-- To choose greeting -->
+               <action function="play-file" data="voicemail/vm-choose_greeting.wav"/>
+               <action function="play-file" data="voicemail/vm-press.wav"/>
+               <action function="say" data="$2" method="pronounced" type="name_spelled"/>
+               <action function="execute" data="sleep(100)"/>
+
+               <!-- To record your name -->
+               <action function="play-file" data="voicemail/vm-record_name2.wav"/>
+               <action function="play-file" data="voicemail/vm-press.wav"/>
+               <action function="say" data="$3" method="pronounced" type="name_spelled"/>
+               <action function="execute" data="sleep(100)"/>
+
+               <!-- To change password -->
+               <action function="play-file" data="voicemail/vm-change_password.wav"/>
+               <action function="play-file" data="voicemail/vm-press.wav"/>
+               <action function="say" data="$4" method="pronounced" type="name_spelled"/>
+               <action function="execute" data="sleep(100)"/>
+
+               <!-- To return to main menu -->
+               <action function="play-file" data="voicemail/vm-main_menu.wav"/>
+               <action function="play-file" data="voicemail/vm-press.wav"/>
+               <action function="say" data="$5" method="pronounced" type="name_spelled"/>
+      </match>
+    </input>
+  </macro>
+
+  <macro name="voicemail_record_name">
+    <input pattern="^(.*)$">
+      <match>
+               <action function="play-file" data="voicemail/vm-record_name1.wav"/>
+      </match>
+    </input>
+  </macro>
+
+  <macro name="voicemail_record_file_check">
+    <input pattern="^([0-9#*]):([0-9#*]):([0-9#*])$">
+      <match>
+               <action function="play-file" data="voicemail/vm-press.wav"/>
+               <action function="say" data="$1" method="pronounced" type="name_spelled"/>
+               <action function="play-file" data="voicemail/vm-listen_to_recording.wav"/>
+               <action function="play-file" data="voicemail/vm-press.wav"/>
+               <action function="say" data="$2" method="pronounced" type="name_spelled"/>
+               <action function="play-file" data="voicemail/vm-save_recording.wav"/>
+               <action function="play-file" data="voicemail/vm-press.wav"/>
+               <action function="say" data="$3" method="pronounced" type="name_spelled"/>
+               <action function="play-file" data="voicemail/vm-rerecord.wav"/>
+      </match>
+    </input>
+  </macro>
+
+  <macro name="voicemail_record_urgent_check">
+    <input pattern="^([0-9#*]):([0-9#*])$">
+      <match>
+               <action function="play-file" data="voicemail/vm-mark-urgent.wav"/>
+               <action function="play-file" data="voicemail/vm-press.wav"/>
+               <action function="say" data="$1" method="pronounced" type="name_spelled"/>
+               <action function="play-file" data="voicemail/vm-continue.wav"/>
+               <action function="play-file" data="voicemail/vm-press.wav"/>
+               <action function="say" data="$2" method="pronounced" type="name_spelled"/>
+      </match>
+    </input>
+  </macro>
+
+  <macro name="voicemail_forward_prepend">
+    <input pattern="^([0-9#*]):([0-9#*])$">
+      <match>
+               <action function="play-file" data="voicemail/vm-forward_add_intro.wav"/>
+               <action function="play-file" data="voicemail/vm-press.wav"/>
+               <action function="say" data="$1" method="pronounced" type="name_spelled"/>
+               <action function="play-file" data="voicemail/vm-send_message_now.wav"/>
+               <action function="play-file" data="voicemail/vm-press.wav"/>
+               <action function="say" data="$2" method="pronounced" type="name_spelled"/>
+      </match>
+    </input>
+  </macro>
+
+  <macro name="voicemail_forward_message_enter_extension">
+    <input pattern="^([0-9#*])$">
+      <match>
+               <action function="play-file" data="voicemail/vm-forward_enter_ext.wav"/>
+               <action function="play-file" data="voicemail/vm-followed_by.wav"/>
+               <action function="say" data="$1" method="pronounced" type="name_spelled"/>
+      </match>
+    </input>
+  </macro>
+
+  <macro name="voicemail_invalid_extension">
+    <input pattern="^(.*)$">
+      <match>
+               <action function="play-file" data="voicemail/vm-that_was_an_invalid_ext.wav"/>
+      </match>
+    </input>
+  </macro>
+
+  <macro name="voicemail_listen_file_check">
+    <input pattern="^([0-9#*]):([0-9#*]):([0-9#*]):([0-9#*]):([0-9#*]):([0-9#*]):(.*)$">
+      <match>
+               <action function="play-file" data="voicemail/vm-listen_to_recording.wav"/>
+               <action function="play-file" data="voicemail/vm-press.wav"/>
+               <action function="say" data="$1" method="pronounced" type="name_spelled"/>
+               <action function="play-file" data="voicemail/vm-save_recording.wav"/>
+               <action function="play-file" data="voicemail/vm-press.wav"/>
+               <action function="say" data="$2" method="pronounced" type="name_spelled"/>
+               <action function="play-file" data="voicemail/vm-delete_recording.wav"/>
+               <action function="play-file" data="voicemail/vm-press.wav"/>
+               <action function="say" data="$3" method="pronounced" type="name_spelled"/>
+               <action function="play-file" data="voicemail/vm-forward_to_email.wav"/>
+               <action function="play-file" data="voicemail/vm-press.wav"/>
+               <action function="say" data="$4" method="pronounced" type="name_spelled"/>
+               <action function="play-file" data="voicemail/vm-return_call.wav"/>
+               <action function="play-file" data="voicemail/vm-press.wav"/>
+               <action function="say" data="$5" method="pronounced" type="name_spelled"/>
+               <action function="play-file" data="voicemail/vm-to_forward.wav"/>
+               <action function="play-file" data="voicemail/vm-press.wav"/>
+               <action function="say" data="$6" method="pronounced" type="name_spelled"/>
+      </match>
+    </input>
+    <input pattern="^([0-9#*]):([0-9#*]):([0-9#*]):([0-9#*]):([0-9#*]):([0-9#*])$">
+      <match>
+               <action function="play-file" data="voicemail/vm-listen_to_recording.wav"/>
+               <action function="play-file" data="voicemail/vm-press.wav"/>
+               <action function="say" data="$1" method="pronounced" type="name_spelled"/>
+               <action function="play-file" data="voicemail/vm-save_recording.wav"/>
+               <action function="play-file" data="voicemail/vm-press.wav"/>
+               <action function="say" data="$2" method="pronounced" type="name_spelled"/>
+               <action function="play-file" data="voicemail/vm-delete_recording.wav"/>
+               <action function="play-file" data="voicemail/vm-press.wav"/>
+               <action function="say" data="$3" method="pronounced" type="name_spelled"/>
+               <action function="play-file" data="voicemail/vm-return_call.wav"/>
+               <action function="play-file" data="voicemail/vm-press.wav"/>
+               <action function="say" data="$5" method="pronounced" type="name_spelled"/>
+               <action function="play-file" data="voicemail/vm-to_forward.wav"/>
+               <action function="play-file" data="voicemail/vm-press.wav"/>
+               <action function="say" data="$6" method="pronounced" type="name_spelled"/>
+      </match>
+    </input>
+  </macro>
+
+  <macro name="voicemail_choose_greeting">
+    <input pattern="^(.*)$">
+      <match>
+               <action function="play-file" data="voicemail/vm-choose_greeting_choose.wav"/>
+      </match>
+    </input>
+  </macro>
+
+  <macro name="voicemail_choose_greeting_fail">
+    <input pattern="^(.*)$">
+      <match>
+               <action function="play-file" data="voicemail/vm-choose_greeting_fail.wav"/>
+      </match>
+    </input>
+  </macro>
+
+  <macro name="voicemail_record_greeting">
+    <input pattern="^(.*)$">
+      <match>
+               <action function="play-file" data="voicemail/vm-record_greeting.wav"/>
+      </match>
+    </input>
+  </macro>
+
+  <macro name="voicemail_record_message">
+    <input pattern="^(.*)$">
+      <match>
+               <action function="play-file" data="voicemail/vm-record_message.wav"/>
+      </match>
+    </input>
+  </macro>
+
+  <macro name="voicemail_greeting_selected">
+    <input pattern="^(\d+)$">
+      <match>
+               <action function="play-file" data="voicemail/vm-greeting.wav"/>
+               <action function="say" data="$1" method="pronounced" type="items"/>
+               <action function="play-file" data="voicemail/vm-selected.wav"/>
+      </match>
+    </input>
+  </macro>
+
+  <macro name="voicemail_play_greeting">
+    <input pattern="^(.*)$">
+      <match>
+               <action function="play-file" data="voicemail/vm-person.wav"/>
+               <action function="say" data="$1" method="pronounced" type="name_spelled"/>
+               <action function="play-file" data="voicemail/vm-not_available.wav"/>
+      </match>
+    </input>
+  </macro>
+
+  <macro name="voicemail_say_number">
+    <input pattern="^(\d+)$">
+      <match>
+               <action function="say" data="$1" method="pronounced" type="items"/>
+      </match>
+    </input>
+  </macro>
+
+  <macro name="voicemail_say_message_number">
+    <input pattern="^([a-z]+):(\d+)$">
+      <match>
+               <action function="play-file" data="voicemail/vm-$1.wav"/> 
+               <action function="play-file" data="voicemail/vm-message_number.wav"/>
+       <action application="log" data="INFO $1 $2"/>
+               <action function="say" data="$2" method="pronounced" type="items"/> 
+      </match>
+    </input>
+  </macro>
+
+  <macro name="voicemail_say_phone_number">
+    <input pattern="^(.*)$">
+      <match>
+               <action function="say" data="$1" method="pronounced" type="name_spelled"/>
+      </match>
+    </input>
+  </macro>
+
+  <macro name="voicemail_say_name">
+    <input pattern="^(.*)$">
+      <match>
+               <action function="say" data="$1" method="pronounced" type="name_spelled"/>
+      </match>
+    </input>
+  </macro>
+  <!-- Note: Update this to marked-urgent,emailed and saved once new sound files are recorded -->
+  <macro name="voicemail_ack"> 
+    <input pattern="^(too-small)$">
+      <match>
+               <action function="play-file" data="voicemail/vm-too-small.wav"/>
+      </match>
+    </input>
+    <input pattern="^(deleted)$">
+      <match>
+               <action function="play-file" data="voicemail/vm-message.wav"/>
+               <action function="play-file" data="voicemail/vm-$1.wav"/>
+      </match>
+    </input>
+    <input pattern="^(saved)$">
+      <match>
+               <action function="play-file" data="voicemail/vm-message.wav"/>
+               <action function="play-file" data="voicemail/vm-$1.wav"/>
+      </match>
+    </input>
+    <input pattern="^(emailed)$">
+      <match>
+               <action function="play-file" data="voicemail/vm-message.wav"/>
+               <action function="play-file" data="voicemail/vm-$1.wav"/>
+      </match>
+    </input>
+    <input pattern="^(marked-urgent)$">
+      <match>
+               <action function="play-file" data="voicemail/vm-message.wav"/>
+               <action function="play-file" data="voicemail/vm-$1.wav"/>
+      </match>
+    </input>
+  </macro>
+
+  <macro name="voicemail_say_date">
+    <input pattern="^(.*)$">
+      <match>
+               <action application="log" data="INFO $1"/>
+               <action function="say" data="$1" method="counted" type="current_date_time"/>
+      </match>
+    </input>
+  </macro>
+
+  <macro name="voicemail_disk_quota_exceeded">
+    <input pattern="^(.*)$">
+        <match>
+            <action function="play-file" data="voicemail/vm-mailbox_full.wav"/>
+        </match>
+    </input>
+  </macro>
+
+  <macro name="valet_announce_ext">
+    <input pattern="^([^\:]+):(.*)$">
+      <match>
+        <action function="say" data="$2" method="pronounced" type="name_spelled"/>
+      </match>
+    </input>
+  </macro>
+
+  <macro name="valet_lot_full">
+    <input pattern="^(.*)$">
+      <match>
+        <action function="play-file" data="tone_stream://%(275,10,600);%(275,100,300)"/>
+      </match>
+    </input>
+  </macro>
+
+  <macro name="valet_lot_empty">
+    <input pattern="^(.*)$">
+      <match>
+        <action function="play-file" data="tone_stream://%(275,10,600);%(275,100,300)"/>
+      </match>
+    </input>
+  </macro>
+</include><!--This line will be ignored it's here to validate the xml and is optional -->
index 7212a5f58174d6174732d4b22a411c485578da85..667f3f6669af9fece79a677536873bb35986df63 100644 (file)
@@ -40,6 +40,7 @@
  * Anthony Minessale II <anthm@freeswitch.org>
  * Michael B. Murdock <mike@mmurdock.org>
  * Daniel Swarbrick <daniel.swarbrick@gmail.com>
+ * Christian Benke <cb@poab.org>
  *
  * mod_say_de.c -- Say for German
  *
@@ -80,17 +81,27 @@ SWITCH_MODULE_DEFINITION(mod_say_de, mod_say_de_load, NULL, NULL);
                        return SWITCH_STATUS_FALSE;                                                                     \
                }}                                                                                                                              \
 
-static switch_status_t play_group(switch_say_method_t method, int a, int b, int c, char *what, switch_core_session_t *session, switch_input_args_t *args)
+static switch_status_t play_group(switch_say_method_t method, switch_say_gender_t gender, int a, int b, int c, char *what, switch_core_session_t *session, switch_input_args_t *args)
 {
 
        if (a) {
-               say_file("digits/%d.wav", a);
-               say_file("digits/hundred.wav");
+               /*german nominativ for "one" in numbers like 21, 171, 4591 is flexed("ein" instead of "eins"), 2-9 are not*/
+               if ( a == 1 ) {
+                       say_file("digits/s-%d.wav");
+               } else {
+                       say_file("digits/%d.wav", a);
+               }
+                       say_file("digits/hundred.wav");
        }
 
        if (b) {
                if (b > 1) {
-                       say_file("digits/%d.wav", c);
+                       /*german nominativ for "one" in numbers like 21, 171, 4591 is flexed, 2-9 are not*/
+                       if ( c == 1 ) {
+                               say_file("digits/s-%d.wav");
+                       } else {
+                               say_file("digits/%d.wav", c);
+                       } 
                        say_file("currency/and.wav");
                        if (method == SSM_COUNTED) {
                                say_file("digits/h-%d0.wav", b);
@@ -111,7 +122,15 @@ static switch_status_t play_group(switch_say_method_t method, int a, int b, int
                if (method == SSM_COUNTED) {
                        say_file("digits/h-%d.wav", c);
                } else {
-                       say_file("digits/%d.wav", c);
+                       /*"one" used as an article is feminine or masculine in german, e.g. voicemail-message is feminine
+                       only applies to the likes of 1, 101, 1001 etc.*/
+                       if ( b == 0  && c == 1 && gender == SSG_FEMININE ) {        
+                               say_file("digits/%d_f.wav", c);                         
+                       } else if ( b == 0 && c == 1 && what ) {
+                               say_file("digits/s-%d.wav");
+                       } else {
+                               say_file("digits/%d.wav", c);
+                       }
                }
        }
 
@@ -150,7 +169,7 @@ static switch_status_t de_say_general_count(switch_core_session_t *session, char
 
        in = atoi(tosay);
 
-       if (in != 0) {
+       if (in != 0) {   /*fills the places-array with tosay(resp. in) from tail to front e.g. 84371 would be places[|1|7|3|4|8|0|0|0|], up to 1 billion minus 1*/
                for (x = 8; x >= 0; x--) {
                        int num = (int) pow(10, x);
                        if ((places[(uint32_t) x] = in / num)) {
@@ -161,13 +180,13 @@ static switch_status_t de_say_general_count(switch_core_session_t *session, char
                switch (say_args->method) {
                case SSM_COUNTED:
                case SSM_PRONOUNCED:
-                       if ((status = play_group(SSM_PRONOUNCED, places[8], places[7], places[6], "digits/million.wav", session, args)) != SWITCH_STATUS_SUCCESS) {
+                       if ((status = play_group(SSM_PRONOUNCED, say_args->gender, places[8], places[7], places[6], "digits/million.wav", session, args)) != SWITCH_STATUS_SUCCESS) {
                                return status;
                        }
-                       if ((status = play_group(SSM_PRONOUNCED, places[5], places[4], places[3], "digits/thousand.wav", session, args)) != SWITCH_STATUS_SUCCESS) {
+                       if ((status = play_group(SSM_PRONOUNCED, say_args->gender, places[5], places[4], places[3], "digits/thousand.wav", session, args)) != SWITCH_STATUS_SUCCESS) {
                                return status;
                        }
-                       if ((status = play_group(say_args->method, places[2], places[1], places[0], NULL, session, args)) != SWITCH_STATUS_SUCCESS) {
+                       if ((status = play_group(say_args->method, say_args->gender, places[2], places[1], places[0], NULL, session, args)) != SWITCH_STATUS_SUCCESS) {
                                return status;
                        }
                        break;