Skip to content

Commit

Permalink
Merge PR #317 into 17.0
Browse files Browse the repository at this point in the history
Signed-off-by dreispt
  • Loading branch information
OCA-git-bot committed May 18, 2024
2 parents 2cf9d9f + c45252d commit 49313b1
Show file tree
Hide file tree
Showing 49 changed files with 13,732 additions and 0 deletions.
145 changes: 145 additions & 0 deletions asterisk_click2dial/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
==================
Asterisk connector
==================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:70c4fbe57dbcfd18cf15685ed8361c0af932e8f5c65668c39a947eeccfd1cc1e
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fconnector--telephony-lightgray.png?logo=github
:target: https://github.com/OCA/connector-telephony/tree/17.0/asterisk_click2dial
:alt: OCA/connector-telephony
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/connector-telephony-17-0/connector-telephony-17-0-asterisk_click2dial
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/connector-telephony&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

The technical name of this module is **asterisk_click2dial**, but this
module implements much more than a simple *click2dial* ! This module
adds 3 functionalities:

1. It adds a *Dial* button in the partner form view so that users can
directly dial a phone number through Asterisk. This feature is
usually known as *click2dial*. Here is how it works :

- In Odoo, the user clicks on the *Dial* button next to a phone
number field in the partner form view (or any form view with a
phone number).
- Odoo connects to the Asterisk Manager Interface and Asterisk makes
the user's phone ring.
- The user answers his own phone (if he doesn't, the process stops
here).
- Asterisk dials the phone number found in Odoo in place of the
user.
- If the remote party answers, the user can talk to his
correspondent.

2. It adds the ability to show the name of the calling party on the
screen of your IP phone on incoming phone calls if the presented
phone number is present in the partner/leads/employees/... of Odoo.
Here is how it works:

- On incoming phone calls, the Asterisk dialplan executes an AGI
script **set_name_incoming_timeout.sh**.
- The *set_name_incoming_timeout.sh* script calls the
*set_name_agi.py* script with a short timeout.
- The *set_name_agi.py* script will make an XML-RPC request on the
Odoo server to try to find the name of the person corresponding to
the phone number presented by the calling party.
- If it finds the name, it is set as the CallerID name of the call,
so as to be presented on the IP phone of the user.

It also works on outgoing calls, so as to display the name of the
callee on the SIP phone of the caller. For that, you should use the
script *set_name_outgoing_timeout.sh*.

3. It adds a phone icon (*Open Caller*) in the top menu bar to get the
partner/lead/candidate/event registrations corresponding to the
calling party in one click. Here is how it works :

- When the user clicks on the phone icon, Odoo sends a query to the
Asterisk Manager Interface to get a list of the current phone
calls.
- If it finds a phone call involving the user's phone, it gets the
phone number of the calling party.
- It searches the phone number of the calling party in the
Partners/Leads/Candidates/Event Registrations of Odoo. If a record
matches, it takes you to the form view of this record. If no
record matchs, it opens a wizard which proposes to create a new
Partner with the presented phone number as *Phone* or *Mobile*
number or update an existing Partner.

It is possible to get a pop-up of the record corresponding to the
calling party without any action from the user via the module
*base_phone_popup*.

A detailed documentation for this module is available on `this
page <http://www.akretion.com/products-and-services/openerp-asterisk-voip-connector>`__
of Akretion's Web site.

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/connector-telephony/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/connector-telephony/issues/new?body=module:%20asterisk_click2dial%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Akretion

Contributors
------------

- Alexis de Lattre <[email protected]>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-alexis-via| image:: https://github.com/alexis-via.png?size=40px
:target: https://github.com/alexis-via
:alt: alexis-via

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-alexis-via|

This module is part of the `OCA/connector-telephony <https://github.com/OCA/connector-telephony/tree/17.0/asterisk_click2dial>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions asterisk_click2dial/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import controller
33 changes: 33 additions & 0 deletions asterisk_click2dial/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2010-2021 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Asterisk connector",
"version": "17.0.1.0.0",
"category": "Phone",
"license": "AGPL-3",
"summary": "Asterisk-Odoo connector",
"author": "Akretion,Odoo Community Association (OCA)",
"maintainers": ["alexis-via"],
"website": "https://github.com/OCA/connector-telephony",
"depends": ["base_phone"],
"external_dependencies": {"python": ["requests"]},
"data": [
"views/asterisk_server.xml",
"views/res_users.xml",
"security/ir.model.access.csv",
"security/asterisk_security.xml",
],
"demo": ["demo/asterisk_click2dial_demo.xml"],
"qweb": ["static/src/xml/asterisk_click2dial.xml"],
"application": True,
"installable": True,
"assets": {
"web.assets_backend": [
"asterisk_click2dial/static/src/scss/*.scss",
"asterisk_click2dial/static/src/components/**/*.js",
"asterisk_click2dial/static/src/components/**/*.xml",
],
},
}
15 changes: 15 additions & 0 deletions asterisk_click2dial/controller.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2014-2021 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <[email protected]>
# Copyright 2015-2018 Juris Malinens (port to v9)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import http


class AsteriskClick2dialController(http.Controller):
@http.route(
"/asterisk_click2dial/get_record_from_my_channel", type="json", auth="user"
)
def get_record_from_my_channel(self, **kw):
res = http.request.env["asterisk.server"].get_record_from_my_channel()
return res
35 changes: 35 additions & 0 deletions asterisk_click2dial/demo/asterisk_click2dial_demo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2010-2021 Akretion France (http://www.akretion.com/)
@author: Alexis de Lattre <[email protected]>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo noupdate="1">


<record id="demo_ast_server" model="asterisk.server">
<field name="name">My Asterisk</field>
<field name="ip_address">localhost</field>
<field name="login">odoo</field>
<field name="password">mypassword</field>
<field name="context">from-internal</field>
<field name="alert_info">info=&lt;Bellcore-dr5&gt;</field>
<field name="company_id" ref="base.main_company" />
</record>

<record id="base.user_admin" model="res.users">
<field name="internal_number">11</field>
<field name="resource">11</field>
<field name="callerid">Administrator &lt;0141981242&gt;</field>
<field name="asterisk_server_id" ref="demo_ast_server" />
</record>

<record id="base.user_demo" model="res.users">
<field name="internal_number">12</field>
<field name="resource">12</field>
<field name="callerid">Demo user &lt;0141984212&gt;</field>
<field name="asterisk_server_id" ref="demo_ast_server" />
</record>


</odoo>
Loading

0 comments on commit 49313b1

Please sign in to comment.