Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
3874 Vistas

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?

Avatar
Descartar
Autor

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

thank you, sir

Mejor respuesta

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/


Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
11
jul 25
18494
1
jun 19
8327
1
nov 17
6432
1
jun 17
4989
1
sept 21
3915