Skip to content
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

Merged
merged 184 commits into from
May 5, 2024

Conversation

luisDIXMIT
Copy link

Standard migration.

@etobella

Alexis de Lattre added 30 commits April 16, 2024 15:56
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
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
mymage and others added 8 commits April 16, 2024 15:56
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/
@luisDIXMIT luisDIXMIT force-pushed the 16.0-mig-asterisk_click2dial branch from 7dab335 to e899cc2 Compare April 16, 2024 13:58
Copy link
Member

@etobella etobella left a 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,
Copy link
Contributor

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

Copy link
Member

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

Copy link
Contributor

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"),
Copy link
Contributor

@cvinh cvinh Apr 17, 2024

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(
Copy link
Contributor

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

Copy link
Author

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!

@luisDIXMIT luisDIXMIT force-pushed the 16.0-mig-asterisk_click2dial branch from e899cc2 to 0295aec Compare April 19, 2024 07:44
@etobella etobella mentioned this pull request May 5, 2024
3 tasks
@etobella
Copy link
Member

etobella commented May 5, 2024

/ocabot migration asterisk_click2dial

@OCA-git-bot OCA-git-bot added this to the 16.0 milestone May 5, 2024
@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@nimarosa
Copy link
Contributor

nimarosa commented May 5, 2024

Tested and working ok. Merging.

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 16.0-ocabot-merge-pr-319-by-nimarosa-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 8212ea0 into OCA:16.0 May 5, 2024
5 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 8b3a393. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.