Код: Выделить всё
CLI> core show help channel originate
There are two ways to use this command. A call can be originated between a
channel and a specific application, or between a channel and an extension in
the dialplan. This is similar to call files or the manager originate action.
Calls originated with this command are given a timeout of 30 seconds.
Usage1: channel originate <tech/data> application <appname> [appdata]
This will originate a call between the specified channel tech/data and the
given application. Arguments to the application are optional. If the given
arguments to the application include spaces, all of the arguments to the
application need to be placed in quotation marks.
Usage2: channel originate <tech/data> extension [exten@][context]
This will originate a call between the specified channel tech/data and the
given extension. If no context is specified, the 'default' context will be
used. If no extension is given, the 's' extension will be used.
извините, если не по адресу вопросvirus_net писал(а):Код: Выделить всё
CLI> core show help channel originate
+ Local channelPRIME_BBCODE_SPOILER_SHOW PRIME_BBCODE_SPOILER:There are two ways to use this command. A call can be originated between a
channel and a specific application, or between a channel and an extension in
the dialplan. This is similar to call files or the manager originate action.
Calls originated with this command are given a timeout of 30 seconds.
Usage1: channel originate <tech/data> application <appname> [appdata]
This will originate a call between the specified channel tech/data and the
given application. Arguments to the application are optional. If the given
arguments to the application include spaces, all of the arguments to the
application need to be placed in quotation marks.
Usage2: channel originate <tech/data> extension [exten@][context]
This will originate a call between the specified channel tech/data and the
given extension. If no context is specified, the 'default' context will be
used. If no extension is given, the 's' extension will be used.
+ звонок на точное время
= решение задачи и не надо никаких консольных сип клиентов
Код: Выделить всё
try:
pbx = Manager((server['address'], server['port']), server['login'], server['password'])
pbx.Originate(a, 'context', '1111', '1')
except Exception as e:
не вижу где вы это там вычитали и мне о подобном функционале originate неизвестно, по крайней мере в Asterisk 1.8loooongcat писал(а):я вычитал ,что originate может отдавать номер ошибки http://www.voip-info.org/wiki/view/Aste ... l+channels
At that point, this application will exit with
the status variable set and dialplan processing will continue.
This application sets the following channel variable before exiting:
${ORIGINATE_STATUS}: This indicates the result of the call origination.
FAILED
SUCCESS
BUSY
CONGESTION
HANGUP
RINGING
UNKNOWN: In practice, you should never see this value. Please report
it to the issue tracker if you ever see it.
Для начала сами посмотрите что отдается в AMI при возникновении ошибки, и если у вас там ест что-то на это тему, то собственно ваш вопрос стоит задать на форуме, где есть люди разбирающиеся в питонеloooongcat писал(а):или где такой вопрос задать
Код: Выделить всё
git clone https://github.com/mouseratti/py-asterisk.git
Код: Выделить всё
python setup.py install
Код: Выделить всё
#!/usr/bin/python
from Asterisk.Manager import Manager
from time import sleep
server = {
'address':'127.0.0.1',
'port':5038,
'login':'yourlogin',
'password':'yourpassword',
}
a = 'LOCAL/777@your_context'
try:
pbx = Manager((server['address'], server['port']), server['login'], server['password'])
c = pbx.Originate(a, 'your_context', '778', '1')
result = c['Response']
except Exception as e:
result = 'Fail'
#sleep(10)
if result == 'Success':
print(0)
exit()
Код: Выделить всё
[your_login]
secret=your_password
read=system,call,log,verbose,command,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate
write=system,call,log,verbose,command,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate
Код: Выделить всё
[your_context]
exten = 777,1,Answer()
same = n,Playback(demo-congrats)
same = n,Hangup()
exten = 778,1,Answer()
same = n,Echo()
same = n,Hangup()