Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate

Advertising

Paste Description for queuepatch

patch for better saying of minutes and seconds of hold time in an asterisk's queue

queuepatch
Monday, May 14th, 2007 at 4:52:54pm UTC 

  1. Index: apps/app_queue.c
  2. ===================================================================
  3. --- apps/app_queue.c    (revis√£o 64186)
  4. +++ apps/app_queue.c    (c√≥pia de trabalho)
  5. @@ -374,8 +374,10 @@
  6.         char sound_calls[80];               /*!< Sound file: "calls waiting to speak to a representative." (def. queue-callswaiting)*/
  7.         char sound_holdtime[80];            /*!< Sound file: "The current estimated total holdtime is" (def. queue-holdtime) */
  8.         char sound_minutes[80];             /*!< Sound file: "minutes." (def. queue-minutes) */
  9. +       char sound_minute[80];              /*!< Sound file: "minute." (def. queue-minute) */
  10.         char sound_lessthan[80];            /*!< Sound file: "less-than" (def. queue-lessthan) */
  11.         char sound_seconds[80];             /*!< Sound file: "seconds." (def. queue-seconds) */
  12. +       char sound_second[80];              /*!< Sound file: "second." (def. queue-second) */
  13.         char sound_thanks[80];              /*!< Sound file: "Thank you for your patience." (def. queue-thankyou) */
  14.         char sound_reporthold[80];          /*!< Sound file: "Hold time" (def. queue-reporthold) */
  15.         char sound_periodicannounce[MAX_PERIODIC_ANNOUNCEMENTS][80];/*!< Sound files: Custom announce, no default */
  16. @@ -668,7 +670,9 @@
  17.         ast_copy_string(q->sound_calls, "queue-callswaiting", sizeof(q->sound_calls));
  18.         ast_copy_string(q->sound_holdtime, "queue-holdtime", sizeof(q->sound_holdtime));
  19.         ast_copy_string(q->sound_minutes, "queue-minutes", sizeof(q->sound_minutes));
  20. +       ast_copy_string(q->sound_minute, "queue-minute", sizeof(q->sound_minute));
  21.         ast_copy_string(q->sound_seconds, "queue-seconds", sizeof(q->sound_seconds));
  22. +       ast_copy_string(q->sound_second, "queue-second", sizeof(q->sound_second));
  23.         ast_copy_string(q->sound_thanks, "queue-thankyou", sizeof(q->sound_thanks));
  24.         ast_copy_string(q->sound_lessthan, "queue-less-than", sizeof(q->sound_lessthan));
  25.         ast_copy_string(q->sound_reporthold, "queue-reporthold", sizeof(q->sound_reporthold));
  26. @@ -806,8 +810,12 @@
  27.                ast_copy_string(q->sound_holdtime, val, sizeof(q->sound_holdtime));
  28.         } else if (!strcasecmp(param, "queue-minutes")) {
  29.                ast_copy_string(q->sound_minutes, val, sizeof(q->sound_minutes));
  30. +       } else if (!strcasecmp(param, "queue-minute")) {
  31. +              ast_copy_string(q->sound_minute, val, sizeof(q->sound_minute));
  32.         } else if (!strcasecmp(param, "queue-seconds")) {
  33.                ast_copy_string(q->sound_seconds, val, sizeof(q->sound_seconds));
  34. +       } else if (!strcasecmp(param, "queue-second")) {
  35. +              ast_copy_string(q->sound_second, val, sizeof(q->sound_second));
  36.         } else if (!strcasecmp(param, "queue-lessthan")) {
  37.                ast_copy_string(q->sound_lessthan, val, sizeof(q->sound_lessthan));
  38.         } else if (!strcasecmp(param, "queue-thankyou")) {
  39. @@ -1312,8 +1320,8 @@
  40.                avgholdsecs = 0;
  41.         }
  42.  
  43. -       if (option_verbose > 2)
  44. -              ast_verbose(VERBOSE_PREFIX_3 "Hold time for %s is %d minutes %d seconds\n", qe->parent->name, avgholdmins, avgholdsecs);
  45. +       if (option_verbose > 1)
  46. +              ast_verbose(VERBOSE_PREFIX_3 "Hold time for %s is %d minute(s) %d second(s)\n", qe->parent->name, avgholdmins, avgholdsecs);
  47.  
  48.         /* If the hold time is >1 min, if it's enabled, and if it's not
  49.           supposed to be only once and we have already said it, say it */
  50. @@ -1324,32 +1332,34 @@
  51.                       goto playout;
  52.  
  53.                if (avgholdmins > 0) {
  54. -                     if (avgholdmins < 2) {
  55. -                            res = play_file(qe->chan, qe->parent->sound_lessthan);
  56. -                            if (res && valid_exit(qe, res))
  57. -                                   goto playout;
  58. -
  59. -                            res = ast_say_number(qe->chan, 2, AST_DIGIT_ANY, qe->chan->language, NULL);
  60. -                            if (res && valid_exit(qe, res))
  61. -                                   goto playout;
  62. -                     } else {
  63. -                            res = ast_say_number(qe->chan, avgholdmins, AST_DIGIT_ANY, qe->chan->language, NULL);
  64. -                            if (res && valid_exit(qe, res))
  65. -                                   goto playout;
  66. -                     }
  67. -                     
  68. -                     res = play_file(qe->chan, qe->parent->sound_minutes);
  69. +                     res = ast_say_number(qe->chan, avgholdmins, AST_DIGIT_ANY, qe->chan->language, NULL);
  70.                       if (res && valid_exit(qe, res))
  71.                              goto playout;
  72. +                     
  73. +            if (avgholdmins == 1) {
  74. +                         res = play_file(qe->chan, qe->parent->sound_minute);
  75. +                         if (res && valid_exit(qe, res))
  76. +                            goto playout;
  77. +            } else {
  78. +                         res = play_file(qe->chan, qe->parent->sound_minutes);
  79. +                         if (res && valid_exit(qe, res))
  80. +                            goto playout;
  81. +            }
  82.                }
  83. -              if (avgholdsecs>0) {
  84. +              if (avgholdsecs > 0) {
  85.                       res = ast_say_number(qe->chan, avgholdsecs, AST_DIGIT_ANY, qe->chan->language, NULL);
  86.                       if (res && valid_exit(qe, res))
  87.                              goto playout;
  88.  
  89. -                     res = play_file(qe->chan, qe->parent->sound_seconds);
  90. -                     if (res && valid_exit(qe, res))
  91. -                            goto playout;
  92. +            if (avgholdsecs > 1) {
  93. +                         res = play_file(qe->chan, qe->parent->sound_seconds);
  94. +                         if (res && valid_exit(qe, res))
  95. +                            goto playout;
  96. +            } else {
  97. +                         res = play_file(qe->chan, qe->parent->sound_second);
  98. +                         if (res && valid_exit(qe, res))
  99. +                            goto playout;
  100. +            }
  101.                }
  102.  
  103.         }
  104. Index: configs/queues.conf.sample
  105. ===================================================================
  106. --- configs/queues.conf.sample  (revis&#8730;£o 64186)
  107. +++ configs/queues.conf.sample  (c&#8730;&#8805;pia de trabalho)
  108. @@ -166,8 +166,12 @@
  109.  ;queue-holdtime = queue-holdtime
  110.                       ;      ("minutes.")
  111.  ;queue-minutes = queue-minutes
  112. +                     ;      ("minute.")
  113. +;queue-minute = queue-minute
  114.                       ;      ("seconds.")
  115.  ;queue-seconds = queue-seconds
  116. +                     ;      ("second.")
  117. +;queue-second = queue-second
  118.                       ;      ("Thank you for your patience.")
  119.  ;queue-thankyou = queue-thankyou
  120.                       ;       ("less than")

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will not expire by default. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

comments powered by Disqus
worth-right