First time here? Check out the FAQ!

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

История изменений [назад]

нажмите, чтобы скрыть/показать версии 1
изначальная версия
редактировать

спросил Oct 25 '16

wildflash Gravatar wildflash

reportholdtime звонящему

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

reportholdtime звонящему

Нужна Ваша помошь. Как сделать так, чтобы при активации опции 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));
                        }
                    }
                }
            }

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

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