Thursday, December 30, 2010

Incoming Call Issue in Vtigercrm using Elastix(Solved )

General approach to fixing Vtiger CRM incoming calls pop-up is to compare Logs and AsteriskClient.php logic. It appears some values may not match or get lost due to Asterisk configuration or version. Not so importaint why - more importaint to make it working as it is.

Initial steps


A.Webserver
1. Have Vtiger installed
2. Setup php.ini value for 30 seconds or similiar value (but not 600 seconds) - this will save your time waiting for logs to appear on screen and enable you to make changes faster. Restart webserver to apply changes (if necessary).



Start catching:

Catching done mainly by analyzing logs. So in order to do it lets approach to logs.
Plan:
1. See how event logs looks like when you make no calls.
2. See how events logs looks like when you make calls.
3. Understand how AsteriskClient.php analyze this log and make pop-ups (not) pop-up.

Execution:
1. See how event logs looks like when you make no calls.

- Start AsteriskClient.php by putting in your web browser similiar address
like http://vt-test.xx/cron/modules/PBXManager/AsteriskClient.php
Browser will behave like it keep opening this address with empty screen but keep waiting till php-script AsteriskClient.php will be stopped by webserver (you remember we changed php.ini value max_execution_time to 30 seconds to make this happen faster).

- Make no calls
- See what events log looks like

This sceen must be something like this - this is how your log looks like when you make no calls:

Right state

Wrong state

It means either you have manager.conf (in Asterisk) either Vtiger PBXManager configured wrong here:

So we need to achieve Right state - as described above. Only when you have Right state - it worth to continue.


2. See how events logs looks like when you make calls.
Now, after php-script is stopped and you have Right state on screen, make it run again (can just click refresh in browser) and make call to your Asterisk number. You must hear the ring, wait few seconds and denie call (hungup). Now wait till php-script AsteriskClient.php in your browser will stop and show Calling log. This may look something like this:


In this time I was calling from SIP-client 3898276589 to 008220773653 (associated with 8220773653). This is only one call done. When you have dozens of calls this turns to real mess. Now If you saw such log - you can continue to analize.


3. Understand how AsteriskClient.php analyze this log and make pop-ups (not) pop-up.
Actually popup not appear but 1 main reason - AsteriskClient.php "loose" some data necessary to generate window. This happens due to some Asterisk call manager syntax differences (i assume) from version to version. So to make it working - you need to change AsteriskClient.php the way not to "loose" this data.

For the moment I assume you don't see popup. So now is time to have a look at AsteriskClient.php and try to understand why popup not appeared. This quite non linear and intuitive process of working with log and with php-code. Result you saw in previour article regarding Vtiger popup. Now just some tips:
- Assume AsteriskClient.php "sees" the same log as you see on the screen Calling log. It analyzes only this data - not more not less.
- try to understand logic of AsteriskClient.php and check where it loose some data by putting php-command "echo" with some text info or variables like this.



- have a look at Log and this part of code:
Log


 Similiar values marked by similiar color. So main task to analyze whole login of AsteriskClient.php and compare it to your Log - may be some values have different names or may be you don't have them at all, but wothout them AsteriskClient.php not pass your request further to so wanted pop-up.

 

 

No comments:

Post a Comment