Repository
OCA/connector-telephony · module folder · Try on Runboat
Module version
1.0.0
Category
Phone
Folder size
0.49 MB
License
AGPL-3
Application
Yes
Auto-installable
No
Website
https://github.com/OCA/connector-telephony
Last tracking update
2026-08-07 08:23:04
Authors
Akretion, Odoo Community Association (OCA)
Maintainers
Akretion, Odoo Community Association (OCA)
Committers
Weblate, OCA-git-bot, oca-ci, Luis Rodriguez
Odoo dependencies
OCA/connector-telephony:
odoo/odoo:
- web
- bus
Python dependencies
requests, phonenumbers
System dependencies
None
Required by
None
Description
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.

Code Analysis

Views touched (5)
XML IDNameModelTypeStatus
view_asterisk_server_form asterisk.server.form asterisk.server form New
view_asterisk_server_search asterisk.server.search asterisk.server search New
view_asterisk_server_tree asterisk.server.tree asterisk.server tree New
view_users_form asterisk_click2dial.res.users.form res.users form Inherits base_phone.view_users_form
view_users_form_simple_modif asterisk_click2dial.users.preferences.form res.users form Inherits base_phone.view_users_form_simple_modif
HTTP endpoints (1)
Route(s)HandlerAuthTypeMethodsFlags
/asterisk_click2dial/get_record_from_my_channel AsteriskClick2dialController.get_record_from_my_channel user json ALL
Models touched (3)

New fields (12)
  • active Boolean
    default=True
  • alert_info Char
    help="Set Alert-Info header in SIP request to user's IP Phone for the click2dial feature. If empty, the Alert-Info header will not be added. You can use it to have a special ring tone for click2dial (a silent one !) or to activate auto-answer for example." string='Alert-Info SIP Header'
  • company_id Many2one → res.company
    default=<expr> help='Company who uses the Asterisk server.' string='Company' args: 'res.company'
  • context Char
    help='Asterisk dialplan context from which the calls will be made. Refer to /etc/asterisk/extensions.conf on your Asterisk server.' required=True string='Dialplan Context'
  • extension_priority Integer
    default=1 help='Priority of the extension in the Asterisk dialplan. Refer to /etc/asterisk/extensions.conf on your Asterisk server.' required=True
  • ip_address Char
    required=True string='Asterisk IP address or DNS'
  • login Char
    help='Login that Odoo will use to communicate with the Asterisk REST Interface. Refer to /etc/asterisk/ari.conf on your Asterisk server.' required=True string='ARI Login'
  • name Char
    required=True string='Asterisk Server Name'
  • out_prefix Char
    help="Prefix to dial to make outgoing calls. If you don't use a prefix to make outgoing calls, leave empty." size=4
  • password Char
    help='Password that Odoo will use to communicate with the Asterisk REST Interface. Refer to /etc/asterisk/ari.conf on your Asterisk server.' required=True string='ARI Password'
  • port Integer
    default=8088 help='TCP port on which the Asterisk REST Interface listens. Defined in /etc/asterisk/ari.conf on Asterisk.' required=True
  • wait_time Integer
    default=15 help="Amount of time (in seconds) Asterisk will try to reach the user's phone before hanging up." required=True
Public methods (2)
  • get_record_from_my_channel(self)
    @api.model
  • test_ari_connection(self)

New fields (0)

No new fields.

Public methods (1)
  • click2dial(self, erp_number)
    @api.model

New fields (10)
  • alert_info Char
    help="Set a user-specific Alert-Info header in SIP request to user's IP Phone for the click2dial feature. If empty, the Alert-Info header will not be added. You can use it to have a special ring tone for click2dial (a silent one !) or to activate auto-answer for example." string='User-specific Alert-Info SIP Header'
  • asterisk_chan_name Char
    compute='_compute_asterisk_chan_name' store=True string='Asterisk Channel Name'
  • asterisk_chan_type Selection
    default='PJSIP' help="Asterisk channel type, as used in the Asterisk dialplan. If the user has a regular IP phone, the channel type is probably 'PJSIP'." string='Asterisk Channel Type' args: [('PJSIP', 'PJSIP'), ('SIP', 'SIP'), ('IAX2', 'IAX2'), ('DAHDI', 'DAHDI'), ('Zap', 'Zap'), ('Skinny', 'Skinny'), ('MGCP', 'MGCP'), ('mISDN', 'mISDN'), ('H323', 'H323'), ('SCCP', 'SCCP')]
  • asterisk_server_id Many2one → asterisk.server
    help="Asterisk server on which the user's phone is connected. If you leave this field empty, it will use the first Asterisk server of the user's company." string='Asterisk Server' args: 'asterisk.server'
  • callerid Char
    copy=False help='Caller ID used for the calls initiated by this user.' string='Caller ID'
  • cdraccount Char
    help='Call Detail Record (CDR) account used for billing this user.' string='CDR Account'
  • dial_suffix Char
    help='User-specific dial suffix such as aa=2wb for SCCP auto answer.' string='User-specific Dial Suffix'
  • internal_number Char
    copy=False help="User's internal phone number."
  • resource Char
    copy=False help="Resource name for the channel type selected. For example, if you use 'Dial(PJSIP/phone1)' in your Asterisk dialplan to ring the SIP phone of this user, then the resource name for this user is 'phone1'. For a SIP phone, the phone number is often used as resource name, but not always." string='Resource Name'
  • variable Char
    help="Set a user-specific 'Variable' field in the Asterisk Manager Interface 'originate' request for the click2dial feature. If you want to have several variable headers, separate them with '|'." string='User-specific Variable'
Public methods (1)
  • get_asterisk_server_from_user(self)
    Returns an asterisk.server recordset

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Loading…

Status
Open migration PR — not merged yet for this version
CI status
green — ready to merge
Open since
28 days ago
Last activity
28 days ago
Repository
OCA/connector-telephony
Pull request
[18.0][MIG] asterisk_click2dial (#373)