blak3r / yaai

SugarCRM Asterisk integration
http://www.sugarforge.org/projects/yaai
GNU General Public License v3.0
81 stars 85 forks source link

internal calls not considered #203

Open tedd77 opened 9 years ago

tedd77 commented 9 years ago

Hello, I am trying to have the YAAI working on internal calls as well. Extension to extension. YAAI version 3.6.9 Could someone please help me overcome this issue?

The YAAI seems to normally detect the call then drop it since it is considered internel , message below: PHP Notice: Array to string conversion in /var/www/sugarcrm/include/nusoap/nusoap.php on line 7604 ! Successfully created CALL record with id=a5f9d781-c564-750b-9d73-54877592e9db Stripping callout prefix: Stripping callin prefix: CallerID is: 600 INTERNAL call detected, Deleting Call Record a5f9d781-c564-750b-9d73-54877592e9db ! AMI Event 'Newstate suppressed. ! AMI Event 'ExtensionStatus suppressed. ! AMI Event 'Newstate suppressed. ! AMI Event 'Newstate suppressed. [2014-12-09 22:18:47] ! --- Event ----------------------------------------------------------- ! Event --> NewAccountCode ! Privilege --> call,all ! Channel --> SIP/601-0000000a ! Uniqueid --> 1418163521.100 ! AccountCode --> ! OldAccountCode --> ! --------------------------------------------------------------------- [2014-12-09 22:18:47] ! --- Event ----------------------------------------------------------- ! Event --> Bridge ! Privilege --> call,all ! Bridgestate --> Link ! Bridgetype --> core ! Channel1 --> SIP/600-00000009 ! Channel2 --> SIP/601-0000000a ! Uniqueid1 --> 1418163521.99 ! Uniqueid2 --> 1418163521.100 ! CallerID1 --> 600 ! CallerID2 --> 601 ! --------------------------------------------------------------------- DEBUG: Entered Bridge Internal Bridge Event Detected RG-Bridge didn't match regex.

blak3r commented 9 years ago

Yes, that is the case. As you can see asterisk gives a ton of events. Especially if you have RingGroups and Queues...

Some of the processing logic just has to ignore internal to internal legs. Otherwise it gets really complex. I don't have all the issues top of mind anymore. If your system is fairly easy and you don't care about direction of the calls... You might be able to adjust them and have it work. look for areas where it's using the internal match regex.

On Tue, Dec 9, 2014 at 5:36 PM, tedd77 notifications@github.com wrote:

Hello, I am trying to have the YAAI working on internal calls as well. Extension to extension. YAAI version 3.6.9 Could someone please help me overcome this issue?

The YAAI seems to normally detect the call then drop it since it is considered internel , message below: PHP Notice: Array to string conversion in /var/www/sugarcrm/include/nusoap/nusoap.php on line 7604 ! Successfully created CALL record with id=a5f9d781-c564-750b-9d73-54877592e9db Stripping callout prefix: Stripping callin prefix: CallerID is: 600 INTERNAL call detected, Deleting Call Record a5f9d781-c564-750b-9d73-54877592e9db ! AMI Event 'Newstate suppressed. ! AMI Event 'ExtensionStatus suppressed. ! AMI Event 'Newstate suppressed. ! AMI Event 'Newstate suppressed. [2014-12-09 22:18:47] ! --- Event ----------------------------------------------------------- ! Event --> NewAccountCode ! Privilege --> call,all ! Channel --> SIP/601-0000000a ! Uniqueid --> 1418163521.100 ! AccountCode --> ! OldAccountCode --> ! --------------------------------------------------------------------- [2014-12-09 22:18:47] ! --- Event ----------------------------------------------------------- ! Event --> Bridge ! Privilege --> call,all ! Bridgestate --> Link ! Bridgetype --> core ! Channel1 --> SIP/600-00000009 ! Channel2 --> SIP/601-0000000a ! Uniqueid1 --> 1418163521.99 ! Uniqueid2 --> 1418163521.100 ! CallerID1 --> 600 ! CallerID2 --> 601 ! --------------------------------------------------------------------- DEBUG: Entered Bridge Internal Bridge Event Detected RG-Bridge didn't match regex.

— Reply to this email directly or view it on GitHub https://github.com/blak3r/yaai/issues/203.

Blake Robertson Founder, Callinize blake@callinize.com @callinize (tw)

tedd77 commented 9 years ago

Thank you for the reply. Could you please let me know where to search for the regex in question ?

blak3r commented 9 years ago

asteriskLogger.php ctrl+f internalMatch

On Wed, Dec 10, 2014 at 10:12 AM, tedd77 notifications@github.com wrote:

Thank you for the reply. Could you please let me know where to search for the regex in question ?

— Reply to this email directly or view it on GitHub https://github.com/blak3r/yaai/issues/203#issuecomment-66465319.

Blake Robertson Founder, Callinize blake@callinize.com @callinize (tw)

tedd77 commented 9 years ago

Once again I would like to thank you for taking the time and pain to reply to my posts. For outgoing calls using the click to dial I am able to find the way to make it work without any issues on internal calls as well as incoming calls from an external line is also working. I tried to look into asteriskLogger.php the Matchinternal and found many options, what I need to figure out how to prevent deleting a call when it is detected as internal. The portion of the file that needs to be modified is the following, if I am not mistaken, however I am not a coder so I will not dare to play with it:

$rgDetectRegex = "/" . $sugar_config['asterisk_rg_detect_expr'] . "/i"; $rgCellRingRegex = "/" . $sugar_config['asterisk_rg_cell_ring_expr'] . "/i"; // This detects in a RG when an outside line is called (usually for a cellphone)... for some reason the cell shows up as the Channel (aka the source)... We detect this by finding a number thats at least 7-10 characters long.. // Check if both ends of the call are internal (then delete created (\ Automatic record **) record) // 2nd condition looks for Local/RG-52-4102152497 if ((preg_match($asteriskMatchInternal, $eChannel) && preg_match($asteriskMatchInternal, $eDestination)) || preg_match($rgDetectRegex, $eDestination) || preg_match($rgCellRingRegex, $eChannel)) { deleteCall($callRecordId); logLine("INTERNAL call detected, Deleting Call Record $callRecordId\n");

blak3r commented 9 years ago

Just modify the deleteCall function to not remove any calls... (comment it all out)... I think it'll be ok otherwise. But, like i said it's a can of worms... I can't predict what issues might come up as a result.