跳至內容
選單
此問題已被標幟
1 回覆
3903 瀏覽次數

Hi I wanted to connect my asterisk server (13.X.X-v300) to odoo v11.0.1.0.0 using a module called asterisk_click2dial , now in the form, i typed the required info in the main form of the module, then opened the required ports, when I press the test the connection with asterisk server this error appears, " Connection Test Failed! The error message is: banner incorrect; got 'VoIP API/AMI/2.0.0', expected prefix 'Asterisk Call Manager'" and a log in the asterisk server appears "connection attempt from *.*.*.* unable to authenticate.

i traced the issue in the py-asterisk py file called Manager.py


def _authenticate(self):
'Read the server banner and attempt to authenticate.'

banner = self.file.readline().rstrip()
for enc in ('utf-8', 'latin1'):
try:
banner = banner.decode(enc)
except:
pass
if not banner.startswith(self._AST_BANNER_PREFIX):
raise Exception('banner incorrect; got %r, expected prefix %r' %
(banner, self._AST_BANNER_PREFIX))
action = {
'Username': self.username,
'Secret': self.secret
}

if not self.listen_events:
action['Events'] = 'off'

self.log.debug('Authenticating as %r/%r.', self.username, self.secret)
self._write_action('Login', action)

if self._read_packet().Response == 'Error':
raise AuthenticationFailure('authentication failed.')


as you can see the module can't pass this part of the code.

can anyone help me?

頭像
捨棄
作者

I don't have enough karma to mark this answer as an legitimate answer

thank you, sir

最佳答案

Hi!

I think that py-asterisk is too old for Asterisk 13 as it has AMI 2.0.

You can change _AST_BANNER_PREFIX from "Asterisk Call Manager" to "API/AMI/2.0.0" and it probably will work.

Also you can check another Asterisk Connector solution called Asterisk Common from the OdooPBX set.

Here it is - https://apps.odoo.com/apps/modules/14.0/asterisk_common/


頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
11
7月 25
18503
1
6月 19
8351
1
11月 17
6481
1
6月 17
4996
1
9月 21
3935