serfreeman1337 / asterlink

Asterisk integration with Bitrix24 and SuiteCRM
MIT License
29 stars 18 forks source link

EOF error #16

Open shep-k-a opened 1 year ago

shep-k-a commented 1 year ago

PBX Version:16.0.40.4 PBX Distro:12.7.8-2306-1.sng7 Asterisk Version:18.19.0 SuiteCRM 8.4.0

When installing the module in a clean SuiteCRM, the module works fine. I am making changes in my SuiteCRM and since then I get an EOF error in the asterlink module on FreePBX. What could this be related to?

Deleting /extensions/asterlink, /cache and even completely reinstalling the module does not give results 1

serfreeman1337 commented 1 year ago

"EOF" indicates that there is no users with extension number set in their profiles. Check "Asterisk Extension" field in user profile.

shep-k-a commented 1 year ago

I have 4 users, all with an extension. OK, this is a test thread, so I deleted all users except the administrator. The extension is specified. The error does not go away. How can I track it?

serfreeman1337 commented 1 year ago

image

"204 Not Content" (and hence nondescript "End Of File" error) will happen if this query returns no results: https://github.com/serfreeman1337/asterlink/blob/4dd6d5fd1e9bfb26f3cd433c88481be1c18c5292/connect/suitecrm/suitecrm-asterlink-module/modules/AsterLink/AsterLinkEntryPoint.php#L29-L35

You can try to run this query manually to see if there is any results: SELECT user_name,users_cstm.asterlink_ext_c FROM users LEFT JOIN users_cstm ON users_cstm.id_c = users.id;'

shep-k-a commented 1 year ago

Here is the answer and it seems logical

image

This is the log of the initial launch with a clean SuiteCRM 8.4.0

level=info msg=AsterLink
level=info msg="Setting log level" fields.level=trace
level=info msg="Using SuiteCRM Connector"
level=trace method=GET suite=true url="http://crm.local/index.php?entryPoint=AsterLinkEntryPoint&action=get_ext_users"
level=trace msg="200 OK" method=GET suite=true url="http://crm.local/index.php?entryPoint=AsterLinkEntryPoint&action=get_ext_users"
level=info msg="User list updated" suite=true users="map[1001:1]"
level=info msg="Enabling web server" addr="192.168.1.139:5678" suite=true
level=info msg="Established connection with AMI" fields.msg="Asterisk Call Manager/7.0.3"

After I change my SuiteCRM (adding users, changing standard modules, etc.) I get this error.

level=info msg=AsterLink
level=info msg="Setting log level" fields.level=trace
level=info msg="Using SuiteCRM Connector"
level=trace method=GET suite=true url="http://crm.local/index.php?entryPoint=AsterLinkEntryPoint&action=get_ext_users"
level=trace msg="204 No Content" method=GET suite=true url="http://crm.local/index.php?entryPoint=AsterLinkEntryPoint&action=get_ext_users"
level=error msg=EOF suite=true
level=info msg="Enabling web server" addr="192.168.1.139:5678" suite=true
level=info msg="Established connection with AMI" fields.msg="Asterisk Call Manager/7.0.3"

I really liked the work of your module, but this error prevents it from being put into operation

serfreeman1337 commented 1 year ago

SELECT user_name,users_cstm.asterlink_ext_c FROM users LEFT JOIN users_cstm ON users_cstm.id_c = users.id;' Here is the answer and it seems logical

Does this query return the same result after adding more users/changing modules ? You didn't install any other 3rd party modules ?

shep-k-a commented 11 months ago

Hello, I'm sorry, I was going on vacation, so I couldn't answer. I couldn’t figure out the problem on version SuiteCRM 8; I didn’t install any third-party modules. That is, only crm and asterlink. But, yesterday, for testing, I tried the latest version of SuiteCRM 7 (7.14.1) and to be honest, I liked the speed of work more than in the 8th version and the Asterlink works fine, but 2 questions arose:

  1. Is it normal that every time you refresh the page or switch to another module, asterlink breaks and re-establishes the connection on the new port? (when testing SuiteCRM 8 this did not happen, the connection occurred only during authorization and disconnection after logging out) image

  2. How can I create a connection between calls through asterlink and contacts created through the asterlink button? image

I click on ---create --- when making a call, I create a contact, but in the “Calls” module the “Contact” and “Related to” fields are still empty. image

Thank you in advance

serfreeman1337 commented 11 months ago
  1. Yes. SuiteCRM 7 reloads pages when you switch between them. It shouldn't be a problem. Also some modules support AJAX loading (like Leads or Contacts) and switching between them should keep the connection. Also opening another tab should keep the connection as well.

  2. Current "--- create ---" button only opens "create" form and populates phone filed, nothing more. It will be improved in the next releases.