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

запомнить введенные цифры в переменную

0

как можно запомнить введенные пользователем цифры в переменную?

exten => 999,1,Answer

exten => 999,n,Set(MyVar= ??? )

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

спросил 2017-02-17 16:45:14 +0400

pvk Gravatar pvk
61 5 7
http://sp-it.ru/

2 Ответа

1
exten => 999,1,Read(myvar,myfile)

pro-sip*CLI> core show application read

-= Info about application 'Read' =-

[Synopsis] Read a variable.

[Description] Reads a #-terminated string of digits a certain number of times from the user in to the given <variable>. This application sets the following channel variable upon completion: ${READSTATUS}: This is the status of the read operation. OK ERROR HANGUP INTERRUPTED SKIPPED TIMEOUT

[Syntax] Read(variable[,filename[&filename2[&...]][,maxdigits[,options[,attempts[,timeout]]]]])

[Arguments] variable The input digits will be stored in the given <variable> name. filename file(s) to play before reading digits or tone with option i maxdigits Maximum acceptable number of digits. Stops reading after <maxdigits> have been entered (without requiring the user to press the '#' key). Defaults to '0' - no limit - wait for the user press the '#' key. Any value below '0' means the same. Max accepted value is '255'. options s: to return immediately if the line is not up.

i: to play  filename as an indication tone from your "indication
s.conf".

n: to read digits even if the line is not up.

attempts If greater than '1', that many <attempts> will be made in the event no data is entered. timeout The number of seconds to wait for a digit response. If greater than '0', that value will override the default timeout. Can be floating point.

[See Also] SendDTMF()

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

ответил 2017-02-17 23:56:07 +0400

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

Comments

Спасибо! То, что нужно!

pvk ( 2017-02-18 04:28:32 +0400 )редактировать

на будущее, с консоли можно сделать core show applications или core show applications like something. Не потратите время на вопросы.

meral ( 2017-02-18 17:25:12 +0400 )редактировать
0

exten => 999,n,Set(MyVar=${EXTEN})

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

ответил 2017-02-17 17:38:59 +0400

Leksnsk Gravatar Leksnsk flag of Russian Federation
155 2 3
http://google.ru/

Ваш ответ

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 ленту новостей

Статистика

Задан: 2017-02-17 16:45:14 +0400

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

Обновлен: Feb 17 '17

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