|
@ -248,6 +248,7 @@ class asterisk_server(orm.Model): |
|
|
def test_ami_connection(self, cr, uid, ids, context=None): |
|
|
def test_ami_connection(self, cr, uid, ids, context=None): |
|
|
assert len(ids) == 1, 'Only 1 ID' |
|
|
assert len(ids) == 1, 'Only 1 ID' |
|
|
ast_server = self.browse(cr, uid, ids[0], context=context) |
|
|
ast_server = self.browse(cr, uid, ids[0], context=context) |
|
|
|
|
|
ast_manager = False |
|
|
try: |
|
|
try: |
|
|
ast_manager = Manager.Manager( |
|
|
ast_manager = Manager.Manager( |
|
|
(ast_server.ip_address, ast_server.port), |
|
|
(ast_server.ip_address, ast_server.port), |
|
@ -258,14 +259,11 @@ class asterisk_server(orm.Model): |
|
|
_("Connection Test Failed!"), |
|
|
_("Connection Test Failed!"), |
|
|
_("Here is the error message: %s" % e)) |
|
|
_("Here is the error message: %s" % e)) |
|
|
finally: |
|
|
finally: |
|
|
try: |
|
|
|
|
|
if ast_manager: |
|
|
if ast_manager: |
|
|
ast_manager.Logoff() |
|
|
ast_manager.Logoff() |
|
|
except Exception: |
|
|
|
|
|
pass |
|
|
|
|
|
raise orm.except_orm( |
|
|
raise orm.except_orm( |
|
|
_("Connection Test Successfull!"), |
|
|
_("Connection Test Successfull!"), |
|
|
_("OpenERP can successfully login to the Asterisk Manager " |
|
|
|
|
|
|
|
|
_("Odoo can successfully login to the Asterisk Manager " |
|
|
"Interface.")) |
|
|
"Interface.")) |
|
|
|
|
|
|
|
|
def _get_calling_number(self, cr, uid, context=None): |
|
|
def _get_calling_number(self, cr, uid, context=None): |
|
|