Пожалуйста, войдите здесь. Часто задаваемые вопросы О нас
Задайте Ваш вопрос

reportholdtime звонящему

0

Нужна Ваша помошь. Как сделать так, чтобы при активации опции reportholdtime, время ожидания воспроизводилось не только оператору из очерди, но и звонящему в очередь? Либо просто сделать возможным воспроизведение времени ожидания звонящему в очередь.

P/s Заменил исходный код:

if (!res2 && announce) {
                if (play_file(qe->chan, announce) < 0) {
                    ast_log(LOG_ERROR, "play_file failed for '%s' on %s\n", announce, ast_channel_name(peer));
                }
            }
            if (!res2 && qe->parent->reportholdtime) {
                if (!play_file(qe->chan, qe->parent->sound_reporthold)) {
                    int holdtime, holdtimesecs;

                    time(&now);
                    holdtime = abs((now - qe->start) / 60);
                    holdtimesecs = abs((now - qe->start) % 60);
                    if (holdtime > 0) {
                        ast_say_number(qe->chan, holdtime, AST_DIGIT_ANY, ast_channel_language(peer), NULL);
                        if (play_file(qe->chan, qe->parent->sound_minutes) < 0) {
                            ast_log(LOG_ERROR, "play_file failed for '%s' on %s\n", qe->parent->sound_minutes, ast_channel_name(peer));
                        }
                    }
                    if (holdtimesecs > 1) {
                        ast_say_number(qe->chan, holdtimesecs, AST_DIGIT_ANY, ast_channel_language(peer), NULL);
                        if (play_file(qe->chan, qe->parent->sound_seconds) < 0) {
                            ast_log(LOG_ERROR, "play_file failed for '%s' on %s\n", qe->parent->sound_seconds, ast_channel_name(peer));
                        }
                    }
                }
            }

На следующий:

                if (!res2 && announce) {
                if (play_file(peer, announce) < 0) {
                    ast_log(LOG_ERROR, "play_file failed for '%s' on %s\n", announce, ast_channel_name(peer));
                }
            }
            if (!res2 && qe->parent->reportholdtime) {
                if (!play_file(qe->chan, qe->parent->sound_reporthold)) {
                    int holdtime, holdtimesecs;

                    time(&now);
                    holdtime = abs((now - qe->start) / 60);
                    holdtimesecs = abs((now - qe->start) % 60);
                    if (holdtime > 0) {
                        ast_say_number(qe->chan, holdtime, AST_DIGIT_ANY, ast_channel_language(peer), NULL);
                        if (play_file(qe->chan, qe->parent->sound_minutes) < 0) {
                            ast_log(LOG_ERROR, "play_file failed for '%s' on %s\n", qe->parent->sound_minutes, ast_channel_name(peer));
                        }
                    }
                    if (holdtimesecs > 1) {
                        ast_say_number(qe->chan, holdtimesecs, AST_DIGIT_ANY, ast_channel_language(peer), NULL);
                        if (play_file(qe->chan, qe->parent->sound_seconds) < 0) {
                            ast_log(LOG_ERROR, "play_file failed for '%s' on %s\n", qe->parent->sound_seconds, ast_channel_name(peer));
                        }
                    }
                }
            }

Задача решена :) Но появился еще один вопрос, нет ли ошибок в данном коде, такое вмешательство не выльется в краш?

удалить закрыть спам изменить тег редактировать

спросил 2016-10-25 18:03:49 +0400

wildflash Gravatar wildflash
11 1 2

обновил 2016-10-26 08:07:17 +0400

Comments

Покопал исходники app_queue.c Нашел обработку текущего параметра.

if (holdtimesecs > 1) { astsaynumber(peer, holdtimesecs, ASTDIGITANY, astchannellanguage(peer), NULL);

Правильно понимаю, что переменная peer, это и есть обозначение агента очереди? Если например заменить её на qe->chan, то будет объявлятся звонящему?

wildflash ( 2016-10-26 07:30:36 +0400 )редактировать

угу. теперь тестируйте и смотрите будет краш или нет. да, может быть. Когда у вас блокировки сойдутся. .

meral ( 2016-10-26 16:37:47 +0400 )редактировать

1 Ответ

0

Можно включить announceholdtime. Будет говорить во время обьявления позиции

Можно написать скрипт, сложность средняя, через chanspy говорить время при queue connect.

Готовой функциональности нет.

ссылка удалить спам редактировать

ответил 2016-10-25 18:55:01 +0400

meral Gravatar meral flag of Ukraine
23347 24 20 177
http://pro-sip.net/

Ваш ответ

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
[скрыть предварительный просмотр]

Закладки и информация

Добавить закладку

подписаться на rss ленту новостей

Статистика

Задан: 2016-10-25 18:03:49 +0400

Просмотрен: 394 раз

Обновлен: Oct 26 '16

Похожие вопросы:

Проект компании "АТС Дизайн"
Asterisk® и Digium® являются зарегистрированными торговыми марками компании Digium, Inc., США.
IP АТС Asterisk распространяется под лицензией GNU GPL.