From bb6b715287a04f4a4e71cac91a2944613d4019e0 Mon Sep 17 00:00:00 2001 From: serfreeman1337 Date: Tue, 3 Nov 2020 15:38:51 +0300 Subject: [PATCH] Update README.md Update README_suitecrm.md --- README.md | 5 ++++- README_suitecrm.md | 47 ++++++++++++++++++++++++++++++++++++---------- 2 files changed, 41 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 8c74dc7..a341204 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,8 @@ dialplan: - DCS-Incoming dial_context: Long-Distance ``` -You see `DCS-Incoming` in `ext_context` because we are dialing **queue** extensions directly from incoming context. (queue memeber config `member => PJSIP/1101` and not `member => Local/1101@Dial-Users` like in freepbx). +You see `DCS-Incoming` in `ext_context` because we are dialing **queue** extensions directly from incoming context. +(queue memeber config `member => PJSIP/1101` and not `member => Local/1101@Dial-Users` like in freepbx). ## CallerID Format Connector can format CallerID using regexp. This useful when your VoIP provider doesn't send desired format. @@ -66,6 +67,8 @@ Install asterlink under **/opt/asterlink** folder. mv conf.example.yml conf.yml nano conf.yml ``` + Note: config file is using YAML format and it requires to have proper indentation. + Use online yaml validator to check your file for errors. * Test run ```bash ./asterlink diff --git a/README_suitecrm.md b/README_suitecrm.md index 87bf344..7cd8de2 100644 --- a/README_suitecrm.md +++ b/README_suitecrm.md @@ -8,11 +8,8 @@ Features: ## Basic setup First of all, you need to setup V8 API in SuiteCRM. Follow [this](https://docs.suitecrm.com/developer/api/developer-setup-guide/json-api/#_before_you_start_calling_endpoints) guide (The "Before you start calling endpoints" part). -You may get **404 API error**, if you are using SuiteCRM with **php-fcgi**. See this: -https://github.com/salesagility/SuiteCRM/pull/8486 - -There also may be problems with contact search. See this: -https://github.com/salesagility/SuiteCRM/pull/8492 +* There might be problems with contact search. See pull request [#8492](https://github.com/salesagility/SuiteCRM/pull/8492) for solution. +* You might get **404 API error**, if you are using SuiteCRM with **php-fcgi**. See pull request [#8486](https://github.com/salesagility/SuiteCRM/pull/8486) for solution. Log calls for "Calls" module. @@ -31,22 +28,52 @@ Log calls for "Calls" module. | Data Type | Field Name | Display Label | Max Size | |-----------|------------------------|---------------------|----------| | TextField | asterlink_ext | Asterisk Extension | 64 | -* Optional: display seconds for call duration in detail view. +* Optional: display seconds for call duration in detail view. Set `customCode` for `duration_hours` in **custom\modules\Calls\metadata\detailviewdefs.php**: ```php {$fields.duration_hours.value}{$MOD.LBL_HOURS_ABBREV} {$fields.duration_minutes.value}{$MOD.LBL_MINSS_ABBREV} {$fields.asterlink_call_seconds_c.value}{$MOD.LBL_ASTERLINK_CALL_SECONDS}  ``` If this file doesn't exist, click **save & deply** on Calls DetailView layout in studio. * Update layouts as you want. -* Set asterlink_ext in users profiles. +* Set `asterlink_ext` in users profiles. * Create new **Client Credentials Client** in Administrator -> OAuth2 Clients and Tokens * Configure token ID and Secret in **config.yml** * Do a test run. You should see userids from suitecrm in console. -You need to restart asterlink app evertime you change asterisk_ext for users. +You need to restart asterlink app evertime you change `asterisk_ext` for users. + +### Call record relationships +See `relationships` key in config. +```yml + relationships: + - + module: Contacts + module_name: Contact + primary_module: false + show_create: true + name_field: full_name + phone_fields: [phone_mobile, phone_work] + - + module: Prospects + module_name: Target + primary_module: true + show_create: false + name_field: full_name + phone_fields: [phone_mobile, phone_work] + relate_once: false +``` +* `relationships` - modules to search for records in. Define every new module as shown in config example + * `module` - SuiteCRM Module ID + * `module_name` - module name, that will show on popup card + * `primary_module` - set `true`, if this module is primary in relationship to "Calls" module + * `show_create` - shows create new record link on popup card + * `name_field` - module field for found record name + * `phone_fields` - module fields to search for phone number +* `relate_once` - set `false` to search and relate records in all modules from `relationships` ## Click2Dial and Pop up card -* Configure `endpoint_addr` and `endpoint_token` in **config.yml**. `endpoint_token` is just a secret word to access asterlink endpoint. It must be equal in both **conf.yml** and **config_override.php**. +* Configure `endpoint_addr` and `endpoint_token` in **config.yml**. `endpoint_token` is just an any secret word you want. + It must be equal in both **conf.yml** and **config_override.php**. * Copy [connect/suitecrm/dist/asterlink](https://github.com/serfreeman1337/asterlink/tree/master/connect/suitecrm/dist) folder to ***suitecrm*** directory. * Add following line to the end of the **custom/modules/logic_hooks.php** file: ```php @@ -58,7 +85,7 @@ You need to restart asterlink app evertime you change asterisk_ext for users. $sugar_config['asterlink']['endpoint_url'] = 'http://my_endpoint_addr:my_endpoint_port'; $sugar_config['asterlink']['endpoint_ws'] = 'ws://my_endpoint_addr:my_endpoint_port'; ``` -* Check "***Enable click-to-call for phone numbers Information***" in SuiteCRM System Settings. +* Check "***Enable click-to-call for phone numbers Information***" in SuiteCRM System Settings. Note: SuiteCRM will only enable this for CallerID with begining plus sign. ### Apache2 endpoint proxy