-
-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[16.0] [MIG] asterisk_click2dial: Migration to 16.0 #319
Conversation
Long life to the asterisk_click2dial module for OpenERP !
- option to allow the use of phone numbers in National format, as discussed with Albert. This option is on the definition of the server. -> required a large change of the reformat number process - added exact link to documentation in module description - some clean-up
but he also made the change in the name of the SIP header ! This commit reverts this mistake.
In fact, it corresponds to the 'Timeout' instruction for the Asterisk Manager
Add French translation for these messages.
- Convert the comments for the functions to the standard style
Added "active" field on asterisk.server object. In order to access all the Asterisk servers, included the desactivated ones, I added a view dedicated to the object asterisk.server, which is accessible under Administration > Configuration.
Thanks to Bernat Brunet from NaN for pointing this out.
Make phone and mobile fields searchable Took into account some pylint coding convention suggestions
- we now handle the fact that phone numbers may contain spaces or special chars such in OpenERP, which is often the case in real life - check input number
Added a comment about the user rights.
… feature Update module description.
Update in comments
…ber in the callerID instruction to Asterisk. Patch courtesy of Marcel van der Boom. Thanks for your feedback !
Accoring to my tests and the info I got, SIP phones support UTF-8 fine - Create a command line option to convert the name from UTF-8 to ASCII (-a) - add default parameter to the help message
…a priority on the res.partner view. Better handling of check functions when there are several ids.
…rm1 and removes the "mobile" field, so I need to change the priority to this view too.
Thanks to Todd Johnson for pointing out this mistake.
…k server now inherit from the tree/form view in the company form.
Changed view names Great solution (thanks to Sebastien for finding it !) to avoid having 2 different tree&form views for asterisk server.
Larger phone field in res_partner_address (smaller 'dial' button)
. adds debug message . starts to better manage character encoding in the networking code... but I still need more info about AMI on this.
- now parses answers received from Asterisk and display errors to the user - now properly encodes the requests sent to Asterisk in ASCII (AMI doesn't support other charsets unfortunately) - required fields are now required=True - Single constraint function for all asterisk.server fields - Fields that shouldn't have non-ascii caracters are not validated if they have non-ASCII caracters (including CallerID) - clean-up error message code - if no Asterisk server is defined for a user, it takes the first Asterisk serve r defined - methods now always return something
Remove print
Currently translated at 7.6% (7 of 91 strings) Translation: connector-telephony-14.0/connector-telephony-14.0-asterisk_click2dial Translate-URL: https://translation.odoo-community.org/projects/connector-telephony-14-0/connector-telephony-14-0-asterisk_click2dial/it/
Currently translated at 8.7% (8 of 91 strings) Translation: connector-telephony-14.0/connector-telephony-14.0-asterisk_click2dial Translate-URL: https://translation.odoo-community.org/projects/connector-telephony-14-0/connector-telephony-14-0-asterisk_click2dial/sl/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: connector-telephony-14.0/connector-telephony-14.0-asterisk_click2dial Translate-URL: https://translation.odoo-community.org/projects/connector-telephony-14-0/connector-telephony-14-0-asterisk_click2dial/
Currently translated at 100.0% (91 of 91 strings) Translation: connector-telephony-14.0/connector-telephony-14.0-asterisk_click2dial Translate-URL: https://translation.odoo-community.org/projects/connector-telephony-14-0/connector-telephony-14-0-asterisk_click2dial/es/
7dab335
to
e899cc2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally
@@ -25,7 +25,7 @@ class AsteriskServer(models.Model): | |||
ip_address = fields.Char(string="Asterisk IP address or DNS", required=True) | |||
port = fields.Integer( | |||
required=True, | |||
default=5038, | |||
default=8088, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default port for AMI is 5038 indeed
8088 is for the web interface
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AMI is no longer used. It was changed on v14
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OMG, time goes fast
"tag": "display_notification", | ||
"params": { | ||
"type": "success", | ||
"message": _("Your request has been successfully sent"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you change the message ?
IMHO, the original one is better because the connexion is towards ARI
return ast_server, auth, url | ||
|
||
def test_ari_connection(self): | ||
self.ensure_one() | ||
auth = (self.login, self.password) | ||
url = "http://%s:%s/ari/asterisk/info" % (self.ip_address, self.port) | ||
url = f"http://{self.ip_address}:{self.port}/ari/asterisk/info" | ||
try: | ||
res = requests.get(url, auth=auth, timeout=TIMEOUT) | ||
except Exception as e: | ||
raise UserError from None( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have models/asterisk_server.py", line 159, in test_ari_connection
TypeError: 'NoneType' object is not callable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your review, comments attended!
e899cc2
to
0295aec
Compare
/ocabot migration asterisk_click2dial |
This PR has the |
Tested and working ok. Merging. /ocabot merge nobump |
This PR looks fantastic, let's merge it! |
Congratulations, your PR was merged at 8b3a393. Thanks a lot for contributing to OCA. ❤️ |
Standard migration.
@etobella