Browse Source

Do much of the cleanup work requested by Eric Caudal.

Remove an accidentally left in rebase problem.
pull/101/head
Trever L. Adams 9 years ago
parent
commit
481fbda4d1
  1. 1
      README.md
  2. 77
      asterisk_logcall/README.rst
  3. 25
      asterisk_logcall/__openerp__.py
  4. 1
      asterisk_logcall/models/__init__.py
  5. 25
      asterisk_logcall/models/asterisk_server.py
  6. 78
      crm_voip_logcall/README.rst
  7. 25
      crm_voip_logcall/__openerp__.py
  8. 23
      crm_voip_logcall/models/crm_voip_logcall.py
  9. 5
      freeswitch_click2dial/freeswitch_click2dial.py
  10. 75
      freeswitch_logcall/README.rst
  11. 25
      freeswitch_logcall/__openerp__.py
  12. 23
      freeswitch_logcall/models/freeswitch_server.py
  13. 15
      hr_recruitment_phone_log/README.rst
  14. 1
      hr_recruitment_phone_log/__openerp__.py
  15. 4
      hr_recruitment_phone_log/models/recruitment.py
  16. 100
      logcall/README.rst
  17. 25
      logcall/__openerp__.py
  18. 1
      logcall/models/__init__.py
  19. 25
      logcall/models/crm_phonecall.py
  20. 39
      logcall/scripts/asterisk_logcall.py
  21. 4
      logcall/scripts/fusionpbx_get_recording.pl
  22. 2
      logcall/security/ir.model.access.csv
  23. 1
      logcall/views/crm_phonecall_view.xml

1
README.md

@ -30,7 +30,6 @@ addon | version | summary
[base_phone_popup](base_phone_popup/) | 9.0.1.0.0 | Pop-up the related form view to the user on incoming calls
[crm_phone](crm_phone/) | 9.0.1.0.0 | Validate phone numbers in CRM
[event_phone](event_phone/) | 9.0.1.0.0 | Validate phone numbers in Events
[freeswitch_click2dial](freeswitch_click2dial/) | 9.0.1.0.0 | FreeSWITCH-Odoo telephony connector (click2dial)
[hr_phone](hr_phone/) | 9.0.1.0.0 | Validate phone numbers in HR
[hr_recruitment_phone](hr_recruitment_phone/) | 9.0.1.0.0 | Validate phone numbers in HR Recruitment

77
asterisk_logcall/README.rst

@ -1,6 +1,81 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
=======================
Asterisk Phone Log-call
=========================
=======================
This bridge adds an option to the Asterisk IPBX servers for the URL to pull
down call recordings. It also adds an option for time jitter compensation
for use when automatically merging call records.
Installation
============
To install this module, you need to simply click install.
Configuration
=============
To configure this module, you need to go to the configuration page for the
Asterisk IPBX server in question, within Odoo, make sure to edit the ucp_url
field to be a url template for call recordings.
The following macros are allowed:
{odoo_type} (inbound, outbound)
{odoo_src} (source phone number)
{odoo_dst} (destination number)
{odoo_duration} (length of call)
{odoo_start} (start time of call in seconds since epoch)
{odoo_filename} (file name on server)
{odoo_uniqueid} (Asterisk UUID of call)
Make sure to set time jitter compensation which is the number of seconds to
subtract from new call start and add to new call end, for call merging, to
compensate for system/database load and time drift between Asterisk server
and Odoo/Odoo database server(s). 5 seconds is likely a good start. Above 10
seconds you get into the realm where you may have distinct calls confused.
20 - 30 seconds begins to guarantee this. It is best to keep this low and use
a method to keep time synced.
Known issues / Roadmap
======================
None at this time.
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 smashing it by providing a detailed and welcomed feedback.
Credits
=======
Images
------
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
Contributors
------------
* Trever L. Adams <trever.adams@gmail.com>
Maintainer
----------
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
This module is maintained by the OCA.
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.
To contribute to this module, please visit https://odoo-community.org.

25
asterisk_logcall/__openerp__.py

@ -1,29 +1,10 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Phone Log-call module for Odoo/OpenERP
# Copyright (C) 2016 credativ Ltd (<http://credativ.co.uk>).
# Copyright (C) 2016 Trever L. Adams
#
# 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/>.
#
##############################################################################
# (c) 2016 Trever L. Adams
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': 'Asterisk Phone Log-call',
'version': '9.0.0.1.0',
'version': '9.0.1.0.0',
'category': 'Phone',
'license': 'AGPL-3',
'summary': 'Necessary bridge between log-call and Asterisk Click2dial',

1
asterisk_logcall/models/__init__.py

@ -1,2 +1 @@
from . import asterisk_server

25
asterisk_logcall/models/asterisk_server.py

@ -1,24 +1,7 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Phone Log-call module for Odoo/OpenERP
# Copyright (C) 2016 credativ Ltd (<http://credativ.co.uk>).
# Copyright (C) 2016 Trever L. Adams
#
# 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/>.
#
##############################################################################
# (c) 2016 credativ ltd.
# (c) 2016 Trever L. Adams
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import models, fields, api
import logging
@ -37,7 +20,7 @@ class AsteriskServer(models.Model):
"(source phone number}, {odoo_dst} (destination number), "
"{odoo_duration} (length of call), {odoo_start} (start time of call "
"in seconds since epoch), {odoo_filename} (file name on server), "
"{odoo_uniqueid} (FreeSWITCH UUID of call).")
"{odoo_uniqueid} (Asterisk UUID of call).")
server_jitter_correction = fields.Integer(
string='Time jitter compensation', required=True,
help='Number of seconds to subtract from new call start and add to '

78
crm_voip_logcall/README.rst

@ -1,4 +1,80 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
=======================
CRM VoIP Phone Log-call
=======================
This bridge pulls in a configuration option for use by logcall. This enables linking to call recordings in the logcall functionality.
This bridge in a configuration option for use by logcall. This enables linking
to call recordings in the logcall functionality.
Installation
============
To install this module, you need to simply click install.
Configuration
=============
To configure this module, you need to go to the configuration page for the
CRM Voip module, within Odoo, make sure to edit the ucp_url field to be a url
template for call recordings.
The following macros are allowed:
{odoo_type} (inbound, outbound)
{odoo_src} (source phone number)
{odoo_dst} (destination number)
{odoo_duration} (length of call)
{odoo_start} (start time of call in seconds since epoch)
{odoo_filename} (file name on server)
{odoo_uniqueid} (Asterisk UUID of call)
Make sure to set time jitter compensation which is the number of seconds to
subtract from new call start and add to new call end, for call merging, to
compensate for system/database load and time drift between Asterisk server
and Odoo/Odoo database server(s). 5 seconds is likely a good start. Above 10
seconds you get into the realm where you may have distinct calls confused.
20 - 30 seconds begins to guarantee this. It is best to keep this low and use
a method to keep time synced.
Known issues / Roadmap
======================
None at this time.
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 smashing it by providing a detailed and welcomed feedback.
Credits
=======
Images
------
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
Contributors
------------
* Trever L. Adams <trever.adams@gmail.com>
Maintainer
----------
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
This module is maintained by the OCA.
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.
To contribute to this module, please visit https://odoo-community.org.

25
crm_voip_logcall/__openerp__.py

@ -1,29 +1,12 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Phone Log-call module for Odoo/OpenERP
# Copyright (C) 2016 credativ Ltd (<http://credativ.co.uk>).
# Copyright (C) 2016 Trever L. Adams
#
# 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/>.
#
##############################################################################
# (c) 2016 credativ Ltd (<http://credativ.co.uk>).
# (c) 2016 Trever L. Adams
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': 'CRM Voip Phone Log-call',
'version': '9.0.0.1.0',
'version': '9.0.1.0.0',
'category': 'Phone',
'license': 'AGPL-3',
'summary': 'Necessary bridge between log-call and CRM VoIP module',

23
crm_voip_logcall/models/crm_voip_logcall.py

@ -1,24 +1,7 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Phone Log-call module for Odoo/OpenERP
# Copyright (C) 2016 credativ Ltd (<http://credativ.co.uk>).
# Copyright (C) 2016 Trever L. Adams
#
# 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/>.
#
##############################################################################
# (c) 2016 credativ Ltd (<http://credativ.co.uk>).
# (c) 2016 Trever L. Adams
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import models, api
import logging

5
freeswitch_click2dial/freeswitch_click2dial.py

@ -173,12 +173,7 @@ class FreeSWITCHServer(models.Model):
try:
is_fq_res = user.resource.rfind('@')
if is_fq_res > 0:
<<<<<<< d8cf9efb5fd18748d1901978041bb8f34ee1717b
resource = user.resource[0:is_fq_res]
=======
resource = user.resource[0:is_fq_res+1]
_logger.error("is_fq_res: %d, resource is %s\n", is_fq_res, resource)
>>>>>>> Thank you to Alexandr Usov and Stanislav Sinyagin for testing and ideas.
else:
resource = user.resource
request = "channels like /" + re.sub(r'/', r':', resource) + \

75
freeswitch_logcall/README.rst

@ -1,6 +1,81 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
=========================
FreeSWITCH Phone Log-call
=========================
This bridge adds an option to the FreeSWITCH servers for the URL to pull
down call recordings. It also adds an option for time jitter compensation
for use when automatically merging call records.
Installation
============
To install this module, you need to simply click install.
Configuration
=============
To configure this module, you need to go to the configuration page for the
FreeSWITCH server in question, within Odoo, make sure to edit the ucp_url
field to be a url template for call recordings.
The following macros are allowed:
{odoo_type} (inbound, outbound)
{odoo_src} (source phone number)
{odoo_dst} (destination number)
{odoo_duration} (length of call)
{odoo_start} (start time of call in seconds since epoch)
{odoo_filename} (file name on server)
{odoo_uniqueid} (FreeSWITCH UUID of call)
Make sure to set time jitter compensation which is the number of seconds to
subtract from new call start and add to new call end, for call merging, to
compensate for system/database load and time drift between FreeSWITCH server
and Odoo/Odoo database server(s). 5 seconds is likely a good start. Above 10
seconds you get into the realm where you may have distinct calls confused.
20 - 30 seconds begins to guarantee this. It is best to keep this low and use
a method to keep time synced.
Known issues / Roadmap
======================
None at this time.
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 smashing it by providing a detailed and welcomed feedback.
Credits
=======
Images
------
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
Contributors
------------
* Trever L. Adams <trever.adams@gmail.com>
Maintainer
----------
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
This module is maintained by the OCA.
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.
To contribute to this module, please visit https://odoo-community.org.

25
freeswitch_logcall/__openerp__.py

@ -1,29 +1,12 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Phone Log-call module for Odoo/OpenERP
# Copyright (C) 2016 credativ Ltd (<http://credativ.co.uk>).
# Copyright (C) 2016 Trever L. Adams
#
# 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/>.
#
##############################################################################
# (c) 2016 credativ Ltd (<http://credativ.co.uk>).
# (c) 2016 Trever L. Adams
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': 'FreeSwitch Phone Log-call',
'version': '9.0.0.1.0',
'version': '9.0.1.0.0',
'category': 'Phone',
'license': 'AGPL-3',
'summary': 'Necessary bridge between log-call and FreeSWITCH Click2dial',

23
freeswitch_logcall/models/freeswitch_server.py

@ -1,24 +1,7 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Phone Log-call module for Odoo/OpenERP
# Copyright (C) 2016 credativ Ltd (<http://credativ.co.uk>).
# Copyright (C) 2016 Trever L. Adams
#
# 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/>.
#
##############################################################################
# (c) 2016 credativ Ltd (<http://credativ.co.uk>).
# (c) 2016 Trever L. Adams
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import models, fields, api
import logging

15
hr_recruitment_phone_log/README.rst

@ -2,11 +2,11 @@
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
==========================
Show phonecalls on partner
==========================
===============================
Show phonecalls on HR Applicant
===============================
This module restores the phonecall list on the partner view.
This module restores the phonecall list on the hr applicant view.
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
@ -27,6 +27,7 @@ Contributors
------------
* Ondřej Kuzník <ondrej.kuznik@credativ.co.uk>
* Trever L. Adams <trever.adams@gmail.com>
Maintainer
----------
@ -42,3 +43,9 @@ mission is to support the collaborative development of Odoo features and
promote its widespread use.
To contribute to this module, please visit 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.
To contribute to this module, please visit https://odoo-community.org.

1
hr_recruitment_phone_log/__openerp__.py

@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
# (c) 2016 credativ ltd. - Ondřej Kuzník
# (c) 2016 Trever L. Adams
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{

4
hr_recruitment_phone_log/models/recruitment.py

@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# (c) 2016 Trever L. Adams
# (c) 2016 credativ ltd. - Ondřej Kuzník
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
@ -15,7 +16,8 @@ class CrmPhonecall(models.Model):
class HrApplicant(models.Model):
_inherit = 'hr.applicant'
phonecall_ids = fields.One2many('crm.phonecall', 'hr_applicant_id', string='Phone Calls')
phonecall_ids = fields.One2many('crm.phonecall', 'hr_applicant_id',
string='Phone Calls')
phonecall_count = fields.Integer(
compute='_count_phonecalls', string='Number of Phonecalls',
readonly=True)

100
logcall/README.rst

@ -1,5 +1,10 @@
Phone Log-call
=================
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
========
Log-call
========
When a call has completed within Asterisk, FreeSWITCH or similar
a callback can be added in a hangup handler to call a script
@ -16,3 +21,94 @@ and end of the new call plus jitter. It keep the data making the call the
longest. It will keep the original attachment, ignoring a new one. It will
append the new call description to the old making sure that the old ends with
a new line.
Installation
============
To install this module, you need to simply click install.
Configuration
=============
To configure this module, you need to go to the configuration page for the
FreeSWITCH server in question, within Odoo, make sure to edit the ucp_url
field to be a url template for call recordings.
The following macros are allowed:
{odoo_type} (inbound, outbound)
{odoo_src} (source phone number}
{odoo_dst} (destination number)
{odoo_duration} (length of call)
{odoo_start} (start time of call in seconds since epoch)
{odoo_filename} (file name on server)
{odoo_uniqueid} (FreeSWITCH UUID of call)
Make sure to set time jitter compensation which is the number of seconds to
subtract from new call start and add to new call end, for call merging, to
compensate for system/database load and time drift between FreeSWITCH server
and Odoo/Odoo database server(s). 5 seconds is likely a good start. Above 10
seconds you get into the realm where you may have distinct calls confused.
20 - 30 seconds begins to guarantee this. It is best to keep this low and use
a method to keep time synced.
Usage
=====
To use this module, you will need to use one of the scripts in logcall/scripts
which is appropriate for your server. You will also need Asterisk Logcall,
FreeSWITCH Logcall, or something similar to provide ucp_url and
server_jitter_compensation. Configure those.
Note: the scripts, properly used, will work in most situations. Adjust for your
local conditions. Please, contribute useful changes.
For users who wish to enable automatic call logging, they will need to set the
"Automatically Log Incoming Calls" preference.
The user that will be handling to call backs should have "Phone System
Integration and Logging" checked. It probably should be the same user you use
for caller pop-up and Caller ID notification from other modules in
connector-telephony. It should have no other permissions or group memberships
besides what is set by those mentioned here.
Known issues / Roadmap
======================
None at this time.
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 smashing it by providing a detailed and welcomed feedback.
Credits
=======
Images
------
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
Contributors
------------
* Trever L. Adams <trever.adams@gmail.com>
* Ondřej Kuzník <ondrej.kuznik@credativ.co.uk>
Maintainer
----------
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
This module is maintained by the OCA.
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.
To contribute to this module, please visit https://odoo-community.org.

25
logcall/__openerp__.py

@ -1,29 +1,12 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Phone Log-call module for Odoo/OpenERP
# Copyright (C) 2016 credativ Ltd (<http://credativ.co.uk>).
# Copyright (C) 2016 Trever L. Adams
#
# 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/>.
#
##############################################################################
# (c) 2016 credativ ltd. - Ondřej Kuzník
# (c) 2016 Trever L. Adams
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
{
'name': 'Phone Log-call',
'version': '9.0.0.1.0',
'version': '9.0.1.0.0',
'category': 'Phone',
'license': 'AGPL-3',
'summary': 'Allow a call to be logged in Odoo',

1
logcall/models/__init__.py

@ -1,2 +1 @@
from . import crm_phonecall

25
logcall/models/crm_phonecall.py

@ -1,24 +1,7 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Phone Log-call module for Odoo/OpenERP
# Copyright (C) 2016 credativ Ltd (<http://credativ.co.uk>).
# Copyright (C) 2016 Trever L. Adams
#
# 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/>.
#
##############################################################################
# (c) 2016 credativ ltd. - Ondřej Kuzník
# (c) 2016 Trever L. Adams
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import models, fields, api, _
from datetime import datetime, timedelta
@ -148,7 +131,7 @@ class PhoneCommon(models.AbstractModel):
if phonecalls[0]['description']:
if phonecalls[0]['description'].find(odoo_description) != -1:
odoo_description = phonecalls[0]['description'] + '\n' + \
odoo_description
odoo_description
else:
odoo_description = phonecalls[0]['description']
if phonecalls[0]['recording_id']:

39
logcall/scripts/asterisk_logcall.py

@ -1,20 +1,9 @@
#! /usr/bin/python
# -*- encoding: utf-8 -*-
# Copyright (C) 2010-2015 Alexis de Lattre <alexis.delattre@akretion.com>
# Copyright (C) 2016 credativ Ltd (<http://credativ.co.uk>).
#
# 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/>.
# (c) 2010-2015 Alexis de Lattre <alexis.delattre@akretion.com>
# (c) 2016 credativ Ltd (<http://credativ.co.uk>).
# (c) 2016 Trever L. Adams
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
"""
Log a call and recording within Asterisk
@ -95,6 +84,7 @@ options = [
'help': "Password of the OpenERP user. Default = 'demo'"},
]
def stdout_write(string):
'''Wrapper on sys.stdout.write'''
sys.stdout.write(string.encode(sys.stdout.encoding or 'utf-8', 'replace'))
@ -112,6 +102,7 @@ def stderr_write(string):
sys.stdout.flush()
return True
def main(options, arguments):
# AGI passes parameters to the script on standard input
@ -162,8 +153,11 @@ def main(options, arguments):
odoo = odoorpc.ODOO(options.server, proto, options.port)
odoo.login(options.database, options.username, options.password)
res = odoo.execute(
'phone.common', 'log_call_and_recording', odoo_type, odoo_src, odoo_dst, odoo_duration, odoo_start, odoo_filename, odoo_uniqueid, odoo_description)
stdout_write('VERBOSE "Called method %s, returned %s"\n' % (method, res))
'phone.common', 'log_call_and_recording', odoo_type, odoo_src,
odoo_dst, odoo_duration, odoo_start, odoo_filename,
odoo_uniqueid, odoo_description)
stdout_write('VERBOSE "Called method %s, returned %s"\n' %
(method, res))
except:
stdout_write(
'VERBOSE "Could not connect to OpenERP in JSON-RPC"\n')
@ -180,8 +174,11 @@ def main(options, arguments):
try:
res = sock.execute(
options.database, options.userid, options.password,
'phone.common', 'log_call_and_recording', odoo_type, odoo_src, odoo_dst, odoo_duration, odoo_start, odoo_filename, odoo_uniqueid, odoo_description)
stdout_write('VERBOSE "Called method %s, returned %s"\n' % (method, res))
'phone.common', 'log_call_and_recording', odoo_type, odoo_src,
odoo_dst, odoo_duration, odoo_start, odoo_filename,
odoo_uniqueid, odoo_description)
stdout_write('VERBOSE "Called method %s, returned %s"\n' %
(method, res))
except:
stdout_write('VERBOSE "Could not connect to OpenERP in XML-RPC"\n')
@ -189,8 +186,8 @@ def main(options, arguments):
if __name__ == '__main__':
usage = "Usage: asterisk_logcall.py [options] login1 login2 login3 ..."
epilog = "Script written by Craig Gowing based on work by Alexis de Lattre. "
"Published under the GNU AGPL licence."
epilog = "Script written by Craig Gowing based on work by Alexis de "
"Lattre. Published under the GNU AGPL licence."
description = "This is an AGI script that sends a query to OpenERP. "
parser = OptionParser(usage=usage, epilog=epilog, description=description)
for option in options:

4
logcall/scripts/fusionpbx_get_recording.pl

@ -66,7 +66,7 @@ else {
print "Connection: close\n";
print "Content-Type: text/html\n\n";
print "<H1>Error </H1>\n";
print "The file ".$args{"file"}." does not exists in the server<br>\n";
print "Please contact to the administrator for more info.\n\n";
print "The file ".$args{"file"}." does not exist on the server<br>\n";
print "Please contact the administrator for more info.\n\n";
}

2
logcall/security/ir.model.access.csv

@ -5,4 +5,4 @@ phone_system_integration_ir_attachment_create,Create access on ir.attachment for
phone_system_integration_mail.message_create,Create access on mail.message for phone system integration and call logging,mail.model_mail_message,group_phone_system_integration,1,1,1,0
phone_system_integration_mail.message_create,Create access on mail.followers for phone system integration and call logging,mail.model_mail_followers,group_phone_system_integration,1,1,1,0
phone_system_integration_res_partner_write,Write access on res.partner for phone system integration and call logging,base.model_res_partner,group_phone_system_integration,1,1,0,0
phone_system_integration_crm_lead_write,Write access on crm.lead for phone system integration and call logging,sale_crm.model_crm_lead,group_phone_system_integration,1,1,0,0
phone_system_integration_crm_lead_write,Write access on crm.lead for phone system integration and call logging,crm.model_crm_lead,group_phone_system_integration,1,1,0,0

1
logcall/views/crm_phonecall_view.xml

@ -33,6 +33,7 @@
<record id="crm_phonecall_search_logcall" model="ir.ui.view">
<field name="name">crm.phonecall.search</field>
<field name="model">crm.phonecall</field>
<field name="inherit_id" ref="crm_phone.crm_phonecall_search"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='date']" position="after">
<field name="end_date"/>

Loading…
Cancel
Save