Browse Source

Initial import.

Long life to the asterisk_click2dial module for OpenERP !
6.0
Alexis de Lattre 14 years ago
commit
760f4387c0
  1. 23
      asterisk_click2dial/__init__.py
  2. 48
      asterisk_click2dial/__terp__.py
  3. 276
      asterisk_click2dial/asterisk_click2dial.py
  4. 26
      asterisk_click2dial/asterisk_click2dial_demo.xml
  5. 64
      asterisk_click2dial/asterisk_server_view.xml
  6. 334
      asterisk_click2dial/i18n/asterisk_click2dial.pot
  7. 328
      asterisk_click2dial/i18n/fr_FR.po
  8. 83
      asterisk_click2dial/res_partner_view.xml
  9. 21
      asterisk_click2dial/res_users_view.xml
  10. 29
      asterisk_click2dial/security/asterisk_server_security.xml

23
asterisk_click2dial/__init__.py

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Asterisk Click2Dial module for OpenERP
# Copyright (C) 2010 Alexis de Lattre <alexis@via.ecp.fr>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import asterisk_click2dial

48
asterisk_click2dial/__terp__.py

@ -0,0 +1,48 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Asterisk Click2dial module for OpenERP
# Copyright (C) 2010 Alexis de Lattre <alexis@via.ecp.fr>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': 'Asterisk Click2dial',
'version': '0.1',
'category': 'Generic Modules/Others',
'license': 'AGPL-3',
'description': """This module adds a 'dial' button in the partner address
view so that users can directly dial a phone number through Asterisk. This feature is usually known as 'click2dial'.
Here is how it works :
1) In OpenERP, the user clicks on the 'dial' button next to a phone number field in the Partner address view.
2) Asterisk makes the user's phone ring.
3) The user answers his own phone (if he doesn't, the process stops here).
4) Asterisk dials the phone number found in OpenERP in place of the user.
5) If the remote party answers, the user can talk to his correspondent.
Documentation for this module is available on the Akretion Web site : http://www.akretion.com/""",
'author': 'Alexis de Lattre',
'website': 'http://www.akretion.com/',
'depends': ['base'],
'init_xml': [],
'update_xml': ['asterisk_server_view.xml', 'res_users_view.xml', 'res_partner_view.xml', 'security/asterisk_server_security.xml'],
'demo_xml': ['asterisk_click2dial_demo.xml'],
'installable': True,
'active': False,
}

276
asterisk_click2dial/asterisk_click2dial.py

@ -0,0 +1,276 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Asterisk Click2dial module for OpenERP
# Copyright (C) 2010 Alexis de Lattre <alexis@via.ecp.fr>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# TODO list :
# Wait time don't seem to be taken into account
from osv import osv, fields
# Lib required to open a socket towards Asterisk
import socket
# Lib required to print logs
import netsvc
class asterisk_server(osv.osv):
_name = "asterisk.server"
_description = "Asterisk Servers"
_columns = {
'name' : fields.char('Asterisk server name', size=50, required=True, help="Asterisk server name."),
'ip_address' : fields.char('Asterisk IP addr. or DNS', size=50, required=True, help="IPv4 address or DNS name of the Asterisk server."),
'port' : fields.integer('Port', required=True, help="TCP port on which the Asterisk Manager Interface listens. Defined in /etc/asterisk/manager.conf on Asterisk."),
'out_prefix' : fields.char('Out prefix', size=4, help="Prefix to dial to place outgoing calls. If you don't use a prefix to place outgoing calls, leave empty."),
'national_prefix' : fields.char('National prefix', size=4, help="Prefix for national phone calls (don't include the 'out prefix'). For e.g., in France, the phone numbers look like '01 41 98 12 42' : the National prefix is '0'."),
'international_prefix' : fields.char('International prefix', size=4, help="Prefix to add to make international phone calls (don't include the 'out prefix'). For e.g., in France, the International prefix is '00'."),
'country_prefix' : fields.char('My country prefix', size=4, help="Phone prefix of the country where the Asterisk server is located. For e.g. the phone prefix for France is '33'. If the phone number to dial starts with the 'My country prefix', OpenERP will remove the country prefix from the phone number and add the 'out prefix' followed by the 'national prefix'. If the phone number to dial doesn't start with the 'My country prefix', OpenERP will add the 'out prefix' followed by the 'international prefix'."),
'login' : fields.char('AMI login', size=30, required=True, help="Login that OpenERP will use to communicate with the Asterisk Manager Interface. Refer to /etc/asterisk/manager.conf on your Asterisk server."),
'password' : fields.char('AMI password', size=30, required=True, help="Password that Asterisk will use to communicate with the Asterisk Manager Interface. Refer to /etc/asterisk/manager.conf on your Asterisk server."),
'context' : fields.char('Dialplan context', size=50, required=True, help="Asterisk dialplan context from which the calls will be made. Refer to /etc/asterisk/extensions.conf on your Asterisk server."),
'wait_time' : fields.integer('Wait time (sec)', required=True, help="Amount of time (in seconds) Asterisk will try to reach the user's phone before hanging up."),
'extension_priority' : fields.integer('Extension priority', required=True, help="Priority of the extension in the Asterisk dialplan. Refer to /etc/asterisk/extensions.conf on your Asterisk server."),
'alert-info' : fields.char('Alert-Info SIP header', size=40, help="Set Alert-Info header in SIP request to user's IP Phone. If empty, the Alert-Info header will not be added. You can use it to have a special ring tone for click2dial, for example you could choose a silent ring tone."),
'company_id' : fields.many2one('res.company', 'Company', help="Company who uses the Asterisk server."),
}
_defaults = {
'port': lambda *a: 5038, # Default AMI port
'out_prefix': lambda *a: '0',
'national_prefix': lambda *a: '0',
'international_prefix': lambda *a: '00',
'extension_priority': lambda *a: 1,
'wait_time': lambda *a: 15,
}
def _only_digits(self, cr, uid, ids, prefix, can_be_empty):
for i in ids:
prefix_to_check = self.read(cr, uid, i, [prefix])[prefix]
if prefix_to_check == False:
if can_be_empty:
return True
else:
return False
else:
if not prefix_to_check.isdigit():
return False
return True
def _only_digits_out_prefix(self, cr, uid, ids):
return self._only_digits(cr, uid, ids, 'out_prefix', True)
def _only_digits_country_prefix(self, cr, uid, ids):
return self._only_digits(cr, uid, ids, 'country_prefix', False)
def _only_digits_national_prefix(self, cr, uid, ids):
return self._only_digits(cr, uid, ids, 'national_prefix', True)
def _only_digits_international_prefix(self, cr, uid, ids):
return self._only_digits(cr, uid, ids, 'international_prefix', False)
def _check_wait_time(self, cr, uid, ids):
for i in ids:
wait_time_to_check = self.read(cr, uid, i, ['wait_time'])['wait_time']
if wait_time_to_check < 1 or wait_time_to_check > 120:
return False
return True
def _check_extension_priority(self, cr, uid, ids):
for i in ids:
extension_priority_to_check = self.read(cr, uid, i, ['extension_priority'])['extension_priority']
if extension_priority_to_check < 1:
return False
return True
def _check_port(self, cr, uid, ids):
for i in ids:
port_to_check = self.read(cr, uid, i, ['port'])['port']
if port_to_check > 65535 or port_to_check < 1:
return False
return True
# TODO : is it possible to read the field name inside the constraint
# function in order to avoid using as many functions as fields to
# check prefix ?
_constraints = [
(_only_digits_out_prefix, "Only use digits for the 'out prefix' or leave empty", ['out_prefix']),
(_only_digits_country_prefix, "Only use digits for the 'country prefix'", ['country_prefix']),
(_only_digits_national_prefix, "Only use digits for the 'national prefix' or leave empty", ['national_prefix']),
(_only_digits_international_prefix, "Only use digits for 'international prefix'", ['international_prefix']),
(_check_wait_time, "You should enter a 'Wait time' value between 1 and 120 seconds", ['wait_time']),
(_check_extension_priority, "The 'extension priority' must be a positive value", ['extension_priority']),
(_check_port, 'TCP ports range from 1 to 65535', ['port']),
]
# This function is dedicated to the transformation of the number
# available in OpenERP to the number that Asterisk should dial.
# You may have to inherit this function in another module specific
# for your company if you are not happy with the way I reformat
# the OpenERP numbers.
def reformat_number(self, cr, uid, ids, erp_number, ast_server, context):
logger = netsvc.Logger()
invalid_format_msg = "The phone number is not written in valid international format. Example of valid international format : +33 1 41 98 12 42"
# Let's call the variable tmp_number now
tmp_number = erp_number
logger.notifyChannel('asterisk_click2dial', netsvc.LOG_DEBUG, 'Number before reformat = ' + tmp_number)
# First, we remove all stupid caracters and spaces
try:
for i in [' ', '.', '(', ')', '[', ']', '-', '/']:
tmp_number = tmp_number.replace(i, '')
except:
raise osv.except_osv('Invalid phone number', invalid_format_msg)
# Remove the starting '+' of the number
if tmp_number[0]=='+':
tmp_number = tmp_number.replace('+','')
logger.notifyChannel('asterisk_click2dial', netsvc.LOG_DEBUG, 'Number after removal of special char = ' + tmp_number)
else:
raise osv.except_osv('Invalid phone number', invalid_format_msg)
# At this stage, 'tmp_number' should only contain digits
if not tmp_number.isdigit():
raise osv.except_osv('Invalid phone number', invalid_format_msg)
# Before starting to use prefix, we convert empty prefix whose value
# is False to an empty string
country_prefix = (ast_server.country_prefix or '')
national_prefix = (ast_server.national_prefix or '')
international_prefix = (ast_server.international_prefix or '')
out_prefix = (ast_server.out_prefix or '')
logger.notifyChannel('asterisk_click2dial', netsvc.LOG_DEBUG, 'Country prefix = ' + country_prefix)
if country_prefix == tmp_number[0:len(country_prefix)]:
# If the number is a national number,
# remove 'my country prefix' and add 'national prefix'
tmp_number = (national_prefix) + tmp_number[len(country_prefix):len(tmp_number)]
logger.notifyChannel('asterisk_click2dial', netsvc.LOG_DEBUG, 'National prefix = ' + national_prefix + ' - Number with national prefix = ' + tmp_number)
else:
# If the number is an international number,
# add 'international prefix'
tmp_number = international_prefix + tmp_number
logger.notifyChannel('asterisk_click2dial', netsvc.LOG_DEBUG, 'International prefix = ' + international_prefix + ' - Number with international prefix = ' + tmp_number)
# Add 'out prefix' to all numbers - Caution : out prefix can be False
tmp_number = out_prefix + tmp_number
logger.notifyChannel('asterisk_click2dial', netsvc.LOG_DEBUG, 'Out prefix = ' + out_prefix)
logger.notifyChannel('asterisk_click2dial', netsvc.LOG_DEBUG, 'Number that will be sent to Asterisk = ' + tmp_number)
return tmp_number
# Open the socket to the Asterisk Manager Interface
# and send instructions to Dial to Asterisk
def dial(self, cr, uid, ids, erp_number, context):
logger = netsvc.Logger()
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
# Check if the number to dial is not empty
if not erp_number:
raise osv.except_osv('Error', 'There is no phone number !')
# We check if the user has an Asterisk server configured
if not user.asterisk_server_id.id:
raise osv.except_osv('No Asterisk server configured for the current user', "You must associate an Asterisk server to the current user.")
else:
ast_server = user.asterisk_server_id
# We check if the current user has a chan type
if not user.asterisk_chan_type:
raise osv.except_osv('No channel type configured for the current user', "You must configure an Asterisk channel type for the current user.")
# We check if the current user has an internal number
if not user.internal_number:
raise osv.except_osv('No internal phone number configured for the current user', "You must configure an internal phone number for the current user.")
# Convert the phone number in the format that will be sent to Asterisk
ast_number = self.reformat_number(cr, uid, ids, erp_number, ast_server, context=context)
logger.notifyChannel('asterisk_click2dial', netsvc.LOG_DEBUG, 'User dialing : channel = ' + user.asterisk_chan_type + '/' + user.internal_number + ' - Callerid = ' + user.callerid)
logger.notifyChannel('asterisk_click2dial', netsvc.LOG_DEBUG, 'Asterisk server = ' + ast_server.ip_address + ':' + str(ast_server.port))
# Connect to the Asterisk Manager Interface
try:
ast_ip = socket.gethostbyname(str(ast_server.ip_address))
except:
raise osv.except_osv('Wrong DNS', "Can't resolve the DNS name of the Asterisk server.")
try:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect((ast_ip, ast_server.port))
sock.send('Action: login\r\n')
sock.send('Events: off\r\n')
sock.send('Username: '+str(ast_server.login)+'\r\n')
sock.send('Secret: '+str(ast_server.password)+'\r\n\r\n')
sock.send('Action: originate\r\n')
sock.send('Channel: ' + str(user.asterisk_chan_type) + '/' + str(user.internal_number)+'\r\n')
sock.send('WaitTime: '+str(ast_server.wait_time)+'\r\n')
sock.send('CallerId: '+str(user.callerid)+'\r\n')
sock.send('Exten: '+str(ast_number)+'\r\n')
sock.send('Context: '+str(ast_server.context)+'\r\n')
if not ast_server.alert-info and user.asterisk_chan_type == 'SIP':
sock.send('Variable: SIPAddHeader=Alert-Info: '+str(ast_server.alert-info)+'\r\n')
sock.send('Priority: '+str(ast_server.extension_priority)+'\r\n\r\n')
sock.send('Action: Logoff\r\n\r\n')
sock.close()
except:
logger.notifyChannel('asterisk_click2dial', netsvc.LOG_WARNING, "Click2dial failed : unable to connect to Asterisk")
raise osv.except_osv('Asterisk server unreachable', "The connection from OpenERP to the Asterisk server failed. Please check the configuration on OpenERP and on Asterisk.")
logger.notifyChannel('asterisk_click2dial', netsvc.LOG_INFO, "Asterisk Click2Dial from " + user.internal_number + ' to ' + ast_number)
asterisk_server()
class res_users(osv.osv):
_name = "res.users"
_inherit = "res.users"
_columns = {
'internal_number' : fields.char('Internal number', size=15, help="User's internal phone number."),
'callerid' : fields.char('Caller ID', size=50, help="Caller ID used for the calls initiated by this user."),
'asterisk_chan_type' : fields.selection([('SIP', 'SIP'), ('IAX2', 'IAX2'), ('DAHDI', 'DAHDI'), ('Zap', 'Zap'), ('Skinny', 'Skinny'), ('MGCP', 'MGCP'), ('mISDN', 'mISDN'), ('H323', 'H323')], 'Asterisk channel type', help="Asterisk channel type, as used in the Asterisk dialplan. If the user has a regular IP phone, the channel type is 'SIP'."),
'asterisk_server_id' : fields.many2one('asterisk.server', 'Asterisk server', help="Asterisk server on which the user's phone is connected."),
}
_defaults = {
'asterisk_chan_type': lambda *a: 'SIP',
}
res_users()
class res_partner_address(osv.osv):
_name = "res.partner.address"
_inherit ="res.partner.address"
# Functions called by the button "Dial" in the partner address view
def action_dial_phone(self, cr, uid, ids, context):
erp_number = self.read(cr, uid, ids, ['phone'], context=context)[0]['phone']
self.pool.get('asterisk.server').dial(cr, uid, ids, erp_number, context)
def action_dial_mobile(self, cr, uid, ids, context):
erp_number = self.read(cr, uid, ids, ['mobile'], context=context)[0]['mobile']
self.pool.get('asterisk.server').dial(cr, uid, ids, erp_number, context)
res_partner_address()
class res_company(osv.osv):
_name = "res.company"
_inherit = "res.company"
_columns = {
'asterisk_server_ids' : fields.one2many('asterisk.server', 'company_id', 'Asterisk servers', help="List of Asterisk servers.")
}
res_company()

26
asterisk_click2dial/asterisk_click2dial_demo.xml

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<record id="demo_ast_server" model="asterisk.server">
<field name="name">Akretion Asterisk IPBX</field>
<field name="ip_address">asterisk.akretion.com</field>
<field name="country_prefix">33</field>
<field name="login">click2dial</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_root" model="res.users">
<field name="internal_number">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="callerid">Demo user &lt;0141984212&gt;</field>
<field name="asterisk_server_id" ref="demo_ast_server"/>
</record>
</data>
</openerp>

64
asterisk_click2dial/asterisk_server_view.xml

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_asterisk_server_company_form" model="ir.ui.view">
<field name="name">asterisk.server.company</field>
<field name="model">res.company</field>
<field name="inherit_id" ref="base.view_company_form" />
<field name="arch" type="xml">
<notebook>
<page position="inside" string="IPBX">
<separator colspan="4" string="Asterisk servers for click2dial" />
<field nolabel="1" name="asterisk_server_ids" />
</page>
</notebook>
</field>
</record>
<record id="view_asterisk_server_form" model="ir.ui.view">
<field name="name">asterisk.server.form</field>
<field name="model">asterisk.server</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Asterisk servers">
<field name="name" select="1" />
<field name="ip_address" select="1" />
<field name="port" select="2" />
<field name="login" select="2" />
<field name="password" password="True" />
<field name="context" />
<field name="extension_priority" />
<field name="out_prefix" />
<field name="national_prefix" />
<field name="international_prefix" />
<field name="country_prefix" select="1" />
<field name="alert-info" />
<field name="wait_time" />
</form>
</field>
</record>
<record id="view_asterisk_server_tree" model="ir.ui.view">
<field name="name">asterisk.server.tree</field>
<field name="model">asterisk.server</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Asterisk servers">
<field name="name" />
<field name="ip_address" />
<field name="port" />
<field name="country_prefix" />
</tree>
</field>
</record>
<record id="action_asterisk_server" model="ir.actions.act_window">
<field name="name">Asterisk Servers</field>
<field name="res_model">asterisk.server</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
</data>
</openerp>

334
asterisk_click2dial/i18n/asterisk_click2dial.pot

@ -0,0 +1,334 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * asterisk_click2dial
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.14\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2010-09-10 20:38:35+0000\n"
"PO-Revision-Date: 2010-09-10 20:38:35+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: asterisk_click2dial
#: constraint:asterisk.server:0
msgid "The 'extension priority' must be a positive value"
msgstr ""
#. module: asterisk_click2dial
#: field:asterisk.server,password:0
msgid "AMI password"
msgstr ""
#. module: asterisk_click2dial
#: selection:res.users,asterisk_chan_type:0
msgid "SIP"
msgstr ""
#. module: asterisk_click2dial
#: field:asterisk.server,international_prefix:0
msgid "International prefix"
msgstr ""
#. module: asterisk_click2dial
#: help:asterisk.server,ip_address:0
msgid "IPv4 address or DNS name of the Asterisk server."
msgstr ""
#. module: asterisk_click2dial
#: selection:res.users,asterisk_chan_type:0
msgid "mISDN"
msgstr ""
#. module: asterisk_click2dial
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: asterisk_click2dial
#: view:res.partner:0
#: view:res.partner.address:0
msgid "Dial"
msgstr ""
#. module: asterisk_click2dial
#: constraint:asterisk.server:0
msgid "Only use digits for the 'country prefix'"
msgstr ""
#. module: asterisk_click2dial
#: field:res.users,asterisk_server_id:0
msgid "Asterisk server"
msgstr ""
#. module: asterisk_click2dial
#: help:res.users,asterisk_server_id:0
msgid "Asterisk server on which the user's phone is connected."
msgstr ""
#. module: asterisk_click2dial
#: model:ir.actions.act_window,name:asterisk_click2dial.action_asterisk_server
#: model:ir.model,name:asterisk_click2dial.model_asterisk_server
msgid "Asterisk Servers"
msgstr ""
#. module: asterisk_click2dial
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
msgstr ""
#. module: asterisk_click2dial
#: selection:res.users,asterisk_chan_type:0
msgid "DAHDI"
msgstr ""
#. module: asterisk_click2dial
#: help:asterisk.server,extension_priority:0
msgid "Priority of the extension in the Asterisk dialplan. Refer to /etc/asterisk/extensions.conf on your Asterisk server."
msgstr ""
#. module: asterisk_click2dial
#: field:res.users,callerid:0
msgid "Caller ID"
msgstr ""
#. module: asterisk_click2dial
#: model:ir.module.module,description:asterisk_click2dial.module_meta_information
msgid "The module adds dial button in partner address\n"
"so that you can directly dial a phone number through Asterisk.\n"
"Documentation is available on the Arkretion Web site http://[TODO]"
msgstr ""
#. module: asterisk_click2dial
#: help:asterisk.server,name:0
msgid "Asterisk server name."
msgstr ""
#. module: asterisk_click2dial
#: view:res.partner:0
#: view:res.partner.address:0
msgid "Mobile : "
msgstr ""
#. module: asterisk_click2dial
#: field:asterisk.server,login:0
msgid "AMI login"
msgstr ""
#. module: asterisk_click2dial
#: view:res.company:0
msgid "Asterisk servers for click2dial"
msgstr ""
#. module: asterisk_click2dial
#: field:asterisk.server,wait_time:0
msgid "Wait time (sec)"
msgstr ""
#. module: asterisk_click2dial
#: field:asterisk.server,context:0
msgid "Dialplan context"
msgstr ""
#. module: asterisk_click2dial
#: field:asterisk.server,extension_priority:0
msgid "Extension priority"
msgstr ""
#. module: asterisk_click2dial
#: field:asterisk.server,company_id:0
msgid "Company"
msgstr ""
#. module: asterisk_click2dial
#: help:asterisk.server,country_prefix:0
msgid "Phone prefix of the country where the Asterisk server is located. For e.g. the phone prefix for France is '33'. If the phone number to dial starts with the 'My country prefix', OpenERP will remove the country prefix from the phone number and add the 'out prefix' followed by the 'national prefix'. If the phone number to dial doesn't start with the 'My country prefix', OpenERP will add the 'out prefix' followed by the 'international prefix'."
msgstr ""
#. module: asterisk_click2dial
#: help:asterisk.server,out_prefix:0
msgid "Prefix to dial to place outgoing calls. If you don't use a prefix to place outgoing calls, leave empty."
msgstr ""
#. module: asterisk_click2dial
#: selection:res.users,asterisk_chan_type:0
msgid "Zap"
msgstr ""
#. module: asterisk_click2dial
#: help:asterisk.server,context:0
msgid "Asterisk dialplan context from which the calls will be made. Refer to /etc/asterisk/extensions.conf on your Asterisk server."
msgstr ""
#. module: asterisk_click2dial
#: help:res.users,callerid:0
msgid "Caller ID used for the calls initiated by this user."
msgstr ""
#. module: asterisk_click2dial
#: selection:res.users,asterisk_chan_type:0
msgid "IAX2"
msgstr ""
#. module: asterisk_click2dial
#: view:res.company:0
msgid "IPBX"
msgstr ""
#. module: asterisk_click2dial
#: model:ir.module.module,shortdesc:asterisk_click2dial.module_meta_information
msgid "Asterisk Click2dial"
msgstr ""
#. module: asterisk_click2dial
#: help:res.company,asterisk_server_ids:0
msgid "List of Asterisk servers."
msgstr ""
#. module: asterisk_click2dial
#: selection:res.users,asterisk_chan_type:0
msgid "MGCP"
msgstr ""
#. module: asterisk_click2dial
#: selection:res.users,asterisk_chan_type:0
msgid "Skinny"
msgstr ""
#. module: asterisk_click2dial
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: asterisk_click2dial
#: help:res.users,internal_number:0
msgid "User's internal phone number."
msgstr ""
#. module: asterisk_click2dial
#: help:asterisk.server,national_prefix:0
msgid "Prefix for national phone calls (don't include the 'out prefix'). For e.g., in France, the phone numbers look like '01 41 98 12 42' : the National prefix is '0'."
msgstr ""
#. module: asterisk_click2dial
#: help:asterisk.server,port:0
msgid "TCP port on which the Asterisk Manager Interface listens. Defined in /etc/asterisk/manager.conf on Asterisk."
msgstr ""
#. module: asterisk_click2dial
#: help:asterisk.server,international_prefix:0
msgid "Prefix to add to make international phone calls (don't include the 'out prefix'). For e.g., in France, the International prefix is '00'."
msgstr ""
#. module: asterisk_click2dial
#: field:res.users,internal_number:0
msgid "Internal number"
msgstr ""
#. module: asterisk_click2dial
#: field:res.users,asterisk_chan_type:0
msgid "Asterisk channel type"
msgstr ""
#. module: asterisk_click2dial
#: field:asterisk.server,out_prefix:0
msgid "Out prefix"
msgstr ""
#. module: asterisk_click2dial
#: constraint:asterisk.server:0
msgid "TCP ports range from 1 to 65535"
msgstr ""
#. module: asterisk_click2dial
#: view:res.partner:0
#: view:res.partner.address:0
msgid "Phone : "
msgstr ""
#. module: asterisk_click2dial
#: help:asterisk.server,company_id:0
msgid "Company who uses the Asterisk server."
msgstr ""
#. module: asterisk_click2dial
#: constraint:asterisk.server:0
msgid "Only use digits for the 'out prefix' or leave empty"
msgstr ""
#. module: asterisk_click2dial
#: field:asterisk.server,ip_address:0
msgid "Asterisk IP addr. or DNS"
msgstr ""
#. module: asterisk_click2dial
#: help:asterisk.server,password:0
msgid "Password that Asterisk will use to communicate with the Asterisk Manager Interface. Refer to /etc/asterisk/manager.conf on your Asterisk server."
msgstr ""
#. module: asterisk_click2dial
#: constraint:asterisk.server:0
msgid "Only use digits for 'international prefix'"
msgstr ""
#. module: asterisk_click2dial
#: selection:res.users,asterisk_chan_type:0
msgid "H323"
msgstr ""
#. module: asterisk_click2dial
#: field:asterisk.server,national_prefix:0
msgid "National prefix"
msgstr ""
#. module: asterisk_click2dial
#: field:asterisk.server,country_prefix:0
msgid "My country prefix"
msgstr ""
#. module: asterisk_click2dial
#: view:asterisk.server:0
#: field:res.company,asterisk_server_ids:0
msgid "Asterisk servers"
msgstr ""
#. module: asterisk_click2dial
#: help:asterisk.server,login:0
msgid "Login that OpenERP will use to communicate with the Asterisk Manager Interface. Refer to /etc/asterisk/manager.conf on your Asterisk server."
msgstr ""
#. module: asterisk_click2dial
#: field:asterisk.server,name:0
msgid "Asterisk server name"
msgstr ""
#. module: asterisk_click2dial
#: help:asterisk.server,wait_time:0
msgid "Amount of time (in seconds) Asterisk will try to reach the user's phone before hanging up."
msgstr ""
#. module: asterisk_click2dial
#: help:res.users,asterisk_chan_type:0
msgid "Asterisk channel type, as used in the Asterisk dialplan. If the user has a regular IP phone, the channel type is 'SIP'."
msgstr ""
#. module: asterisk_click2dial
#: constraint:asterisk.server:0
msgid "Only use digits for the 'national prefix' or leave empty"
msgstr ""
#. module: asterisk_click2dial
#: field:asterisk.server,port:0
msgid "Port"
msgstr ""
#. module: asterisk_click2dial
#: constraint:asterisk.server:0
msgid "You should enter a 'Wait time' value between 1 and 120 seconds"
msgstr ""

328
asterisk_click2dial/i18n/fr_FR.po

@ -0,0 +1,328 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * asterisk_click2dial
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 5.0.14\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2010-09-10 20:15:08+0000\n"
"PO-Revision-Date: 2010-09-10 20:15:08+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: asterisk_click2dial
#: constraint:asterisk.server:0
msgid "The 'extension priority' must be a positive value"
msgstr "La priorité de l'extension doit être une valeur positive"
#. module: asterisk_click2dial
#: field:asterisk.server,password:0
msgid "AMI password"
msgstr "Mot de passe AMI"
#. module: asterisk_click2dial
#: selection:res.users,asterisk_chan_type:0
msgid "SIP"
msgstr "SIP"
#. module: asterisk_click2dial
#: field:asterisk.server,international_prefix:0
msgid "International prefix"
msgstr "Préfixe international"
#. module: asterisk_click2dial
#: help:asterisk.server,ip_address:0
msgid "IPv4 address or DNS name of the Asterisk server."
msgstr "Adresse IPv4 ou nom DNS du serveur Asterisk."
#. module: asterisk_click2dial
#: selection:res.users,asterisk_chan_type:0
msgid "mISDN"
msgstr "mISDN"
#. module: asterisk_click2dial
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr "Le nom de l'objet doit commencer avec x_ et ne pas contenir de charactères spéciaux !"
#. module: asterisk_click2dial
#: view:res.partner:0
#: view:res.partner.address:0
msgid "Dial"
msgstr "Appeler"
#. module: asterisk_click2dial
#: constraint:asterisk.server:0
msgid "Only use digits for the 'country prefix'"
msgstr "N'utiliser que des chiffres pour le préfixe du pays"
#. module: asterisk_click2dial
#: field:res.users,asterisk_server_id:0
msgid "Asterisk server"
msgstr "Serveur Asterisk"
#. module: asterisk_click2dial
#: help:res.users,asterisk_server_id:0
msgid "Asterisk server on which the user's phone is connected."
msgstr "Serveur Asterisk sur lequel le téléphone de l'utilisateur est connecté."
#. module: asterisk_click2dial
#: model:ir.actions.act_window,name:asterisk_click2dial.action_asterisk_server
#: model:ir.model,name:asterisk_click2dial.model_asterisk_server
msgid "Asterisk Servers"
msgstr "Serveurs Asterisk"
#. module: asterisk_click2dial
#: constraint:ir.actions.act_window:0
msgid "Invalid model name in the action definition."
msgstr "Invalid model name in the action definition."
#. module: asterisk_click2dial
#: selection:res.users,asterisk_chan_type:0
msgid "DAHDI"
msgstr "DAHDI"
#. module: asterisk_click2dial
#: help:asterisk.server,extension_priority:0
msgid "Priority of the extension in the Asterisk dialplan. Refer to /etc/asterisk/extensions.conf on your Asterisk server."
msgstr "Priorité de l'extension dans le dialplan d'Asterisk. Cf /etc/asterisk/extensions.conf sur le serveur Asterisk."
#. module: asterisk_click2dial
#: field:res.users,callerid:0
msgid "Caller ID"
msgstr "Identification de l'appelant"
#. module: asterisk_click2dial
#: help:asterisk.server,name:0
msgid "Asterisk server name."
msgstr "Nom du serveur Asterisk."
#. module: asterisk_click2dial
#: view:res.partner:0
#: view:res.partner.address:0
msgid "Mobile : "
msgstr "Portable : "
#. module: asterisk_click2dial
#: field:asterisk.server,login:0
msgid "AMI login"
msgstr "Nom d'utilisateur AMI"
#. module: asterisk_click2dial
#: view:res.company:0
msgid "Asterisk servers for click2dial"
msgstr "Serveurs Asterisk pour le click2dial"
#. module: asterisk_click2dial
#: field:asterisk.server,wait_time:0
msgid "Wait time (sec)"
msgstr "Temps d'attente (sec)"
#. module: asterisk_click2dial
#: field:asterisk.server,context:0
msgid "Dialplan context"
msgstr "Contexte du dialplan"
#. module: asterisk_click2dial
#: field:asterisk.server,extension_priority:0
msgid "Extension priority"
msgstr "Priorité de l'extension"
#. module: asterisk_click2dial
#: field:asterisk.server,company_id:0
msgid "Company"
msgstr "Société"
#. module: asterisk_click2dial
#: help:asterisk.server,country_prefix:0
msgid "Phone prefix of the country where the Asterisk server is located. For e.g. the phone prefix for France is '33'. If the phone number to dial starts with the 'My country prefix', OpenERP will remove the country prefix from the phone number and add the 'out prefix' followed by the 'national prefix'. If the phone number to dial doesn't start with the 'My country prefix', OpenERP will add the 'out prefix' followed by the 'international prefix'."
msgstr "Préfixe téléphonique du pays dans lequel est situé le serveur Asterisk. Par exemple, le préfixe téléphonique de la France est '33'. Si le numéro de téléphone à appeler commence par le préfixe du pays, OpenERP supprimera ce préfixe du numéro de téléphone à composer et ajoutera le préfixe pour l'extérieur suivi par le préfixe national. Si le numéro de téléphone à appeler ne commence pas par le préfixe du pays, OpenERP ajoutera le préfixe pour l'extérieur suivi par le préfixe international."
#. module: asterisk_click2dial
#: selection:res.users,asterisk_chan_type:0
msgid "Skinny"
msgstr "Skinny"
#. module: asterisk_click2dial
#: help:asterisk.server,context:0
msgid "Asterisk dialplan context from which the calls will be made. Refer to /etc/asterisk/extensions.conf on your Asterisk server."
msgstr "Contexte du dialplan d'Asterisk depuis lequel les appels seront initiés. Cf /etc/asterisk/extensions.conf sur le serveur Asterisk."
#. module: asterisk_click2dial
#: help:res.users,callerid:0
msgid "Caller ID used for the calls initiated by this user."
msgstr "'Caller ID' des appels passés par l'utilisateur."
#. module: asterisk_click2dial
#: selection:res.users,asterisk_chan_type:0
msgid "IAX2"
msgstr "IAX2"
#. module: asterisk_click2dial
#: view:res.company:0
msgid "IPBX"
msgstr "IPBX"
#. module: asterisk_click2dial
#: model:ir.module.module,shortdesc:asterisk_click2dial.module_meta_information
msgid "Asterisk Click2dial"
msgstr "Asterisk Click2dial"
#. module: asterisk_click2dial
#: help:res.company,asterisk_server_ids:0
msgid "List of Asterisk servers."
msgstr "Liste des serveurs Asterisk."
#. module: asterisk_click2dial
#: selection:res.users,asterisk_chan_type:0
msgid "MGCP"
msgstr "MGCP"
#. module: asterisk_click2dial
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr "XML non valide pour l'architecture de la vue"
#. module: asterisk_click2dial
#: help:res.users,internal_number:0
msgid "User's internal phone number."
msgstr "Numéro de téléphone interne de l'utilisateur."
#. module: asterisk_click2dial
#: constraint:asterisk.server:0
msgid "You should enter a 'Wait time' value between 1 and 120 seconds"
msgstr "Vous devez entrer un temps d'attente compris entre 1 et 120 secondes"
#. module: asterisk_click2dial
#: help:asterisk.server,port:0
msgid "TCP port on which the Asterisk Manager Interface listens. Defined in /etc/asterisk/manager.conf on Asterisk."
msgstr "Port TCP sur lequel écoute l'interface du Manager Asterisk. Cf /etc/asterisk/manager.conf sur le serveur Asterisk."
#. module: asterisk_click2dial
#: help:asterisk.server,international_prefix:0
msgid "Prefix to add to make international phone calls (don't include the 'out prefix'). For e.g., in France, the International prefix is '00'."
msgstr "Préfixe à ajouter pour passer des appels vers l'étranger (ne pas inclure le préfixe pour l'extérieur). Par exemple, en France, le préfixe pour l'international est '00'."
#. module: asterisk_click2dial
#: help:asterisk.server,national_prefix:0
msgid "Prefix for national phone calls (don't include the 'out prefix'). For e.g., in France, the phone numbers look like '01 41 98 12 42' : the National prefix is '0'."
msgstr "Préfixe pour les appels nationaux (ne pas inclure le préfixe pour l'extérieur). Par exemple, en France, les numéros de téléphone sont du type '01 41 98 12 42' ; le préfixe national est '0'."
#. module: asterisk_click2dial
#: field:res.users,internal_number:0
msgid "Internal number"
msgstr "Numéro interne"
#. module: asterisk_click2dial
#: field:res.users,asterisk_chan_type:0
msgid "Asterisk channel type"
msgstr "Type de canal Asterisk"
#. module: asterisk_click2dial
#: field:asterisk.server,out_prefix:0
msgid "Out prefix"
msgstr "Préfixe pour l'extérieur"
#. module: asterisk_click2dial
#: constraint:asterisk.server:0
msgid "TCP ports range from 1 to 65535"
msgstr "Les ports TCP vont de 1 à 65535"
#. module: asterisk_click2dial
#: view:res.partner:0
#: view:res.partner.address:0
msgid "Phone : "
msgstr "Téléphone : "
#. module: asterisk_click2dial
#: help:asterisk.server,company_id:0
msgid "Company who uses the Asterisk server."
msgstr "Société qui utilise le serveur Asterisk."
#. module: asterisk_click2dial
#: constraint:asterisk.server:0
msgid "Only use digits for the 'out prefix' or leave empty"
msgstr "N'utiliser que des chiffres pour le préfixe pour appeler vers l'extérieur ou laisser vide"
#. module: asterisk_click2dial
#: field:asterisk.server,ip_address:0
msgid "Asterisk IP addr. or DNS"
msgstr "Adr. IP ou DNS d'Asterisk"
#. module: asterisk_click2dial
#: help:asterisk.server,password:0
msgid "Password that Asterisk will use to communicate with the Asterisk Manager Interface. Refer to /etc/asterisk/manager.conf on your Asterisk server."
msgstr "Password that Asterisk will use to communicate with the Asterisk Manager Interface. Refer to /etc/asterisk/manager.conf on your Asterisk server."
#. module: asterisk_click2dial
#: help:asterisk.server,out_prefix:0
msgid "Prefix to dial to place outgoing calls. If you don't use a prefix to place outgoing calls, leave empty."
msgstr "Préfixe à composer pour appeler vers l'extérieur. Si vous n'avez pas à composer un préfixe pour appeler vers l'extérieur, laissez vide."
#. module: asterisk_click2dial
#: constraint:asterisk.server:0
msgid "Only use digits for 'international prefix'"
msgstr "N'utiliser que des chiffres pour le préfixe international"
#. module: asterisk_click2dial
#: selection:res.users,asterisk_chan_type:0
msgid "H323"
msgstr "H323"
#. module: asterisk_click2dial
#: field:asterisk.server,national_prefix:0
msgid "National prefix"
msgstr "Préfixe national"
#. module: asterisk_click2dial
#: field:asterisk.server,country_prefix:0
msgid "My country prefix"
msgstr "Préfixe du pays"
#. module: asterisk_click2dial
#: view:asterisk.server:0
#: field:res.company,asterisk_server_ids:0
msgid "Asterisk servers"
msgstr "Serveurs Asterisk"
#. module: asterisk_click2dial
#: help:asterisk.server,login:0
msgid "Login that OpenERP will use to communicate with the Asterisk Manager Interface. Refer to /etc/asterisk/manager.conf on your Asterisk server."
msgstr "Nom d'utilisateur qu'OpenERP utilisera pour communiquer avec l'interface du Manager d'Asterisk. Cf /etc/asterisk/manager.conf sur le serveur Asterisk."
#. module: asterisk_click2dial
#: field:asterisk.server,name:0
msgid "Asterisk server name"
msgstr "Nom du serveur Asterisk"
#. module: asterisk_click2dial
#: help:asterisk.server,wait_time:0
msgid "Amount of time (in seconds) Asterisk will try to reach the user's phone before hanging up."
msgstr "Temps (en secondes) pendant lequel Asterisk essayera de joindre le téléphone de l'utilisateur avant d'abandonner."
#. module: asterisk_click2dial
#: help:res.users,asterisk_chan_type:0
msgid "Asterisk channel type, as used in the Asterisk dialplan. If the user has a regular IP phone, the channel type is 'SIP'."
msgstr "Type de canal Asterisk, tel qu'utilisé dans le dialplan d'Asterisk. Si l'utilisateur a un téléphone IP classique, le type de canal est 'SIP'."
#. module: asterisk_click2dial
#: constraint:asterisk.server:0
msgid "Only use digits for the 'national prefix' or leave empty"
msgstr "N'utiliser que des chiffres pour le préfixe national ou laisser vide"
#. module: asterisk_click2dial
#: field:asterisk.server,port:0
msgid "Port"
msgstr "Port"
#. module: asterisk_click2dial
#: selection:res.users,asterisk_chan_type:0
msgid "Zap"
msgstr "Zap"

83
asterisk_click2dial/res_partner_view.xml

@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_res_partner_address_inherit_form1" model="ir.ui.view">
<field name="name">res.partner.address.inherit.form1</field>
<field name="model">res.partner.address</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.view_partner_address_form1"/>
<field name="arch" type="xml">
<data>
<field name="phone" position="replace">
<label string="Phone : " align="1.0" />
<group colspan="1" col="2">
<field name="phone" nolabel="1"/>
<button name="action_dial_phone" string="Dial" type="object"/>
</group>
</field>
<field name="mobile" position="replace">
<label string="Mobile : " align="1.0" />
<group colspan="1" col="2">
<field name="mobile" nolabel="1"/>
<button name="action_dial_mobile" string="Dial" type="object"/>
</group>
</field>
</data>
</field>
</record>
<record id="view_res_partner_address_inherit_form2" model="ir.ui.view">
<field name="name">res.partner.address.inherit.form2</field>
<field name="model">res.partner.address</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.view_partner_address_form2"/>
<field name="arch" type="xml">
<data>
<field name="phone" position="replace">
<label string="Phone : " align="1.0" />
<group colspan="1" col="2">
<field name="phone" nolabel="1"/>
<button name="action_dial_phone" string="Dial" type="object"/>
</group>
</field>
<field name="mobile" position="replace">
<label string="Mobile : " align="1.0" />
<group colspan="1" col="2">
<field name="mobile" nolabel="1"/>
<button name="action_dial_mobile" string="Dial" type="object"/>
</group>
</field>
</data>
</field>
</record>
<record id="view_res_partner_inherit_form" model="ir.ui.view">
<field name="name">res.partner.inherit.form</field>
<field name="model">res.partner</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<data>
<field name="phone" position="replace">
<label string="Phone : " align="1.0" />
<group colspan="1" col="2">
<field name="phone" nolabel="1"/>
<button name="action_dial_phone" string="Dial" type="object"/>
</group>
</field>
<field name="mobile" position="replace">
<label string="Mobile : " align="1.0" />
<group colspan="1" col="2">
<field name="mobile" nolabel="1"/>
<button name="action_dial_mobile" string="Dial" type="object"/>
</group>
</field>
</data>
</field>
</record>
</data>
</openerp>

21
asterisk_click2dial/res_users_view.xml

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_res_users_inherit_internal_number" model="ir.ui.view">
<field name="name">res.users.inherit.internal.number</field>
<field name="model">res.users</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.view_users_form"/>
<field name="arch" type="xml">
<field name="context_tz" position="after">
<field name="internal_number" select="2"/>
<field name="asterisk_chan_type"/>
<field name="callerid" select="2"/>
<field name="asterisk_server_id"/>
</field>
</field>
</record>
</data>
</openerp>

29
asterisk_click2dial/security/asterisk_server_security.xml

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<record id="ir_model_access_asterisk_server_user" model="ir.model.access">
<field name="model_id" ref="asterisk_click2dial.model_asterisk_server"/>
<field name="name" eval="&quot;&quot;&quot;asterisk.server_user&quot;&quot;&quot;" />
<field name="group_id" ref="base.group_user"/>
<field name="perm_read" eval="1"/>
<field name="perm_write" eval="0"/>
<field name="perm_unlink" eval="0"/>
<field name="perm_create" eval="0"/>
</record>
<record id="ir_model_access_asterisk_server_system" model="ir.model.access">
<field name="model_id" ref="asterisk_click2dial.model_asterisk_server"/>
<field name="name" eval="&quot;&quot;&quot;asterisk.server_system&quot;&quot;&quot;"/>
<field name="group_id" ref="base.group_system"/>
<field name="perm_read" eval="1"/>
<field name="perm_write" eval="1"/>
<field name="perm_unlink" eval="1"/>
<field name="perm_create" eval="1"/>
</record>
</data>
</openerp>
Loading…
Cancel
Save