blak3r / yaai

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

php asteriskLogger.php error... #137

Closed ghost closed 10 years ago

ghost commented 11 years ago

Hello,

I have a little probleme... when i want to start the script php, i do : cd /var/www/custom/modules/Asterisk php asteriskLogger.php

and this is, what i have : php asteriskLogger.php php asteriskLogger.php X-Powered-By: PHP/4.4.8_pre20070816-pl1-gentoo Content-type: text/html


Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/airnatur/www/custom/modules/Asterisk/asteriskLogger.php on line 82

Maybe some packet need to download and install...

The server where are the CRM is in OVH (Kimsufi) When i test this plug'in on Virtuel server in my home, i'm no have a probleme but when i want to use in server in Ovh, i cannot start the script...

Tank you for help

Damien

blak3r commented 11 years ago

Looks like a syntax error. Perhaps my code didn't get cleanly merged. Take a look around line 82 and see if you see any thing like a string that isn't properly terminated.

Also, what code are you using.

On Tue, Jun 25, 2013 at 3:48 AM, DStel notifications@github.com wrote:

Hello,

I have a little probleme... when i want to start the script php, i do : cd /var/www/custom/modules/Asterisk php asteriskLogger.php

and this is, what i have : php asteriskLogger.php php asteriskLogger.php X-Powered-By: PHP/4.4.8_pre20070816-pl1-gentoo Content-type: text/html

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/airnatur/www/custom/modules/Asterisk/asteriskLogger.php* on line 82 *

Maybe some packet need to download and install...

The server where are the CRM is in OVH (Kimsufi) When i test this plug'in on Virtuel server in my home, i'm no have a probleme but when i want to use in server in Ovh, i cannot start the script...

Tank you for help

Damien

— Reply to this email directly or view it on GitHubhttps://github.com/blak3r/yaai/issues/137 .

ghost commented 11 years ago

Tank you for your answer quickly :-)

I'm looking and i'm not see somethink no good... it's strange... The server it's : Gentoo 2006.0 - 64 bits -Web : apache2 / php5 (suPHP) / ssl -Base : MySQL5 / phpMyAdmin

81{ 82 public $sessionid; 83 public $auth_array; 84 85 function __construct($endpoint, $something, $auth_array)

blak3r commented 11 years ago

What version?

~blake

On Jun 25, 2013, at 8:49 AM, DStel notifications@github.com wrote:

Tank you for your answer quickly :-)

I'm looking and i'm not see somethink no good... it's strange... The server it's : Gentoo 2006.0 - 64 bits -Web : apache2 / php5 (suPHP) / ssl -Base : MySQL5 / phpMyAdmin

81{ 82 public $sessionid; 83 public $auth_array; 84 85 function __construct($endpoint, $something, $auth_array)

— Reply to this email directly or view it on GitHub.

ghost commented 11 years ago

The last 2.6.0b

blak3r commented 11 years ago

Oh that's stable and been out for 8 months.

I don't really know what the problem is there. You didn't modify it at all?

~blake

On Jun 25, 2013, at 2:53 PM, DStel notifications@github.com wrote:

The last 2.6.0b

— Reply to this email directly or view it on GitHub.

ghost commented 11 years ago

Hello,

I'm not modify the file... It's not the version of php can do this problème ? I can uninstall and install again for try... Damien

ghost commented 11 years ago

Hello, Finally the problème are very easy (i'm just starting learn linux) , if i make just php5 asteriskLogger.php it work :-)

Tank you blak3r for help me

blak3r commented 11 years ago

Great!

~blake

On Jul 3, 2013, at 7:14 AM, DStel notifications@github.com wrote:

Hello, Finally the problème are very easy (i'm just starting learn linux) , if i make just php5 asteriskLogger.php it work :-)

Tank you blak3r for help me

— Reply to this email directly or view it on GitHub.

ghost commented 11 years ago

Hello,

I have one more question, i'm setup plug'in on server (SugarCrm) in local and no have problem, but i have setup Sugar on a server outside (ovh-virtual server) and i arrived to start the php asterisklogger.php but the contact not open automatic with sugar when a call arrived in the server asterisk.

Yaai working if the server Sugar are outside and not in local ?

Tanks you

blak3r commented 11 years ago

Asterisk logger must be run on the same box as sugarcrm.

On Thu, Jul 4, 2013 at 8:59 AM, DStel notifications@github.com wrote:

Hello,

I have one more question, i'm setup plug'in on server (SugarCrm) in local and no have problem, but i have setup Sugar on a server outside (ovh-virtual server) and i arrived to start the php asterisklogger.php but the contact not open automatic with sugar when a call arrived in the server asterisk.

Yaai working if the server Sugar are outside and not in local ?

Tanks you

— Reply to this email directly or view it on GitHubhttps://github.com/blak3r/yaai/issues/137#issuecomment-20475672 .

ghost commented 11 years ago

The probleme it's when i have SugarCrm and Asterisk server in the same network, the call notification working verywell. But when SugarCrm and Asterisk are not same network (one in my home and one in the netcenter) i cannot to do working the call notification.

I don't know why, no have a port must to be open because separate network...

I don't know what i can try ...

kvnhawkins commented 11 years ago

Sounds like a security configuration problem. Check to make sure iptables will let you through, if AMI is set to allow the Sugar box in and lastly test to see if there is something preventing you on the network.

You can rule all of this out by going to the box with Sugar on it and doing: telnet ip.of.asterisk,box 5038

If you see something like: $ telnet 127.0.0.1 5038 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. Asterisk Call Manager/1.0

...then you know there isn't something blocking your connection.

blak3r commented 11 years ago

Yeah good call Kevin. Thanks.

~blake

On Jul 5, 2013, at 8:20 PM, Kevin Hawkins notifications@github.com wrote:

Sounds like a security configuration problem. Check to make sure iptables will let you through, if AMI is set to allow the Sugar box in and lastly test to see if there is something preventing you on the network.

You can rule all of this out by going to the box with Sugar on it and doing: telnet ip.of.asterisk,box 5038

If you see something like: $ telnet 127.0.0.1 5038 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. Asterisk Call Manager/1.0

...then you know there isn't something blocking your connection.

— Reply to this email directly or view it on GitHub.

ghost commented 10 years ago

Tank you for your help kvnhawkins, i try to do what you tell me, and the connection telnet work very well i have the word : Asterisk Call Manager/1.3

I have rec the line of the AsteriskLogguer.php.

For the server SugarCrm in my home (Working) i have :

[2013-07-09 11:01:53] ! --- Event ----------------------------------------------------------- ! Event --> HangupRequest ! Privilege --> call,all ! Channel --> SIP/trunk_ovh-00000040 ! Uniqueid --> 1373367708.64 ! --------------------------------------------------------------------- [2013-07-09 11:01:53] ! --- Event ----------------------------------------------------------- ! Event --> Hangup ! Privilege --> call,all ! Channel --> SIP/30-00000041 ! Uniqueid --> 1373367708.65 ! CallerIDNum --> 30 ! CallerIDName --> sugar crm ! ConnectedLineNum --> 0180605404 ! ConnectedLineName --> 0180605404 ! AccountCode --> ! Cause --> 16 ! Cause-txt --> Normal Clearing ! ---------------------------------------------------------------------

+++ findCallByAsteriskDestId(1373367708.65)

! FindCallByAsteriskDestId - Found entry in asterisk_log recordId=b1550e4f-ba29-4dc2-20d3-51dbed1c6445 Looking for user extension number in: SIP/30-00000041 Channel Matched SIP/### style regex. Ext is:30

+++ findUserByAsteriskExtension(30)

! Assigned user id set to 1 Measured call duration is 0 seconds Adding INBOUND Missed (or Failed) Call, id=1373367708.65, call_id = b1550e4f-ba29-4dc2-20d3-51dbed1c6445 Contact Id already set by callListener to: cabe10ef-41fe-6341-6735-51dbd535d5b5 Establishing relation to Contacts... Call ID: b1550e4f-ba29-4dc2-20d3-51dbed1c6445 to Bean ID: cabe10ef-41fe-6341-6735-51dbd535d5b5 ! No results returned

+++ findAccountForContact(cabe10ef-41fe-6341-6735-51dbd535d5b5)

! No results returned ! Call start was 2013-07-09 11:01:46 Updating record in /Calls/ id=b1550e4f-ba29-4dc2-20d3-51dbed1c6445... NAME: \ Automatic record **

And for the server at datacenter (not working) i have :

[2013-07-09 11:05:19] ! --- Event ----------------------------------------------------------- ! Event --> HangupRequest ! Privilege --> call,all ! Channel --> SIP/trunk_ovh-00000042 ! Uniqueid --> 1373367929.66 ! --------------------------------------------------------------------- [2013-07-09 11:05:20] ! --- Event ----------------------------------------------------------- ! Event --> Hangup ! Privilege --> call,all ! Channel --> SIP/30-00000043 ! Uniqueid --> 1373367929.67 ! CallerIDNum --> 30 ! CallerIDName --> sugar crm ! ConnectedLineNum --> 0180605404 ! ConnectedLineName --> 0180605404 ! AccountCode --> ! Cause --> 16 ! Cause-txt --> Normal Clearing ! ---------------------------------------------------------------------

+++ findCallByAsteriskDestId(1373367929.67)

! FindCallByAsteriskDestId - Found entry in asterisk_log recordId=b8fa107a-813b-e88f-402f-51dbeecc588e Looking for user extension number in: SIP/30-00000043 Channel Matched SIP/### style regex. Ext is:30

+++ findUserByAsteriskExtension(30)

! Assigned user id set to 1 Measured call duration is 0 seconds Adding INBOUND Missed (or Failed) Call, id=1373367929.67, call_id = b8fa107a-813b-e88f-402f-51dbeecc588e

+++ find AccountByPhoneNumber(0180605404)

! No results returned

+++ find ContactByPhoneNumber(0180605404)

findSugarObjectByPhoneNumber: Contact query components- Phone: 0605404 RegEx: (0[^\d]_6[^\d]_0[^\d]_5[^\d]_4[^\d]_0[^\d]4[^\d])$ Found multiple contacts (3) -- all belong to same account, associating call with account ! Invalid Arguments passed to setRelationshipBetweenCallAndBean callRecordId=b8fa107a-813b-e88f-402f-51dbeecc588e, beanId=, beanType=Accounts ! Call start was 2013-07-09 11:05:09 Updating record in /Calls/ id=b8fa107a-813b-e88f-402f-51dbeecc588e... NAME: *_ Automatic record **

Somewhere it's not the same line, but i don't know how i can take conclusion with like that...

Do you see something strange ?

If no, i thing i go to try change distrib with debian.

blak3r commented 10 years ago

I don't see anything strange.

Except asterisk manager 1.3 I've never heard of. Only seen 1.0 and 1.1

~blake

On Jul 9, 2013, at 7:31 AM, DStel notifications@github.com wrote:


[

kvnhawkins commented 10 years ago

On the working (home) output it matches a contact in Sugar, in the non-working (data center) output it does not. Both output show SIP/30 being matched as the user extension receiving the call. In the version of Sugar running at the data center, did you add a user with Asterisk extension 30? It appears that different functions are running in each of these different outputs. Did you install different versions of YAAI at your home and the data center? Additionally your extension pattern on both installations is SIP/### yet you are using 2 digit extension numbers. You may want to either use SIP/## to match your 2 digit extensions or use 3 digit extensions in Asterisk.

ghost commented 10 years ago

Tanks blak3r and kvnhawkins for your answer. The configuration and version it's the same. Finally in the data center i try with the last OS Debian and it work well same in my home. I don't know why, but with OS Gentoo 2006, it not working...

Now, the call notification working very well with Debian, i have a new request.. the last :-))...

When the call arrived directly on the phone, the popup working, but when i'm make a groupCall and it's 6 phones dring same time, the popup not working.

This is the logg when just 1 phone dring (Working):

[2013-07-10 12:35:57] ! --- Event ----------------------------------------------------------- ! Event --> NewCallerid ! Privilege --> call,all ! Channel --> SIP/trunk_ovh-00000031 ! CallerIDNum --> 0180605404 ! CallerIDName --> dams ! Uniqueid --> 1373459758.49 ! CID-CallingPres --> 0 (Presentation Allowed, Not Screened) ! --------------------------------------------------------------------- 1373459758.49 CallerID Changed to: 0180605404 ! AMI Event 'Newchannel suppressed. [2013-07-10 12:35:57] ! --- Event ----------------------------------------------------------- ! Event --> Inherit ! Privilege --> call,all ! Parent --> SIP/trunk_ovh-00000031 ! Child --> SIP/30-00000032 ! --------------------------------------------------------------------- [2013-07-10 12:35:57] ! --- Event ----------------------------------------------------------- ! Event --> Dial ! Privilege --> call,all ! SubEvent --> Begin ! Channel --> SIP/trunk_ovh-00000031 ! Destination --> SIP/30-00000032 ! CallerIDNum --> 0180605404 ! CallerIDName --> dams ! ConnectedLineNum --> 0972346236 ! ConnectedLineName --> sugar crm ! UniqueID --> 1373459758.49 ! DestUniqueID --> 1373459758.50 ! Dialstring --> 30 ! ---------------------------------------------------------------------

And this is the logg when just 6 phones dring same time (Group_Appel - Not Working):

[2013-07-10 12:33:33] ! --- Event ----------------------------------------------------------- ! Event --> NewCallerid ! Privilege --> call,all ! Channel --> SIP/trunk_ovh-0000002d ! CallerIDNum --> 0180605404 ! CallerIDName --> dams ! Uniqueid --> 1373459614.45 ! CID-CallingPres --> 0 (Presentation Allowed, Not Screened) ! --------------------------------------------------------------------- 1373459614.45 CallerID Changed to: 0180605404 ! AMI Event 'Newstate suppressed. [2013-07-10 12:33:34] ! --- Event ----------------------------------------------------------- ! Event --> Join ! Privilege --> call,all ! Channel --> SIP/trunk_ovh-0000002d ! CallerIDNum --> 0180605404 ! CallerIDName --> dams ! ConnectedLineNum --> unknown ! ConnectedLineName --> unknown ! Queue --> groupe_appel ! Position --> 1 ! Count --> 1 ! Uniqueid --> 1373459614.45 ! --------------------------------------------------------------------- PHP Notice: Undefined index: UniqueID in /var/www/custom/modules/Asterisk/asteriskLogger.php on line 341 [2013-07-10 12:33:34] ! --- Event ----------------------------------------------------------- ! Event --> MusicOnHold ! Privilege --> call,all ! State --> Start ! Channel --> SIP/trunk_ovh-0000002d ! UniqueID --> 1373459614.45 ! Class --> predec ! --------------------------------------------------------------------- ! AMI Event 'Newchannel suppressed. [2013-07-10 12:33:35] ! --- Event ----------------------------------------------------------- ! Event --> Inherit ! Privilege --> call,all ! Parent --> SIP/trunk_ovh-0000002d ! Child --> SIP/30-0000002e ! ---------------------------------------------------------------------

I think YAAI take the event --> Dial and associate the "CallerIDNum" and the "Dialstring" for open the popup, but in the logg with group_appel, no have Event --> Dial...

blak3r commented 10 years ago

Kevin, really appreciate ya helping out.

Group calls are more complex. Is it a RingGroup or queue.

The popup will not appear until you answer call.

Also leave it as SIP/### it always should be three ### if I recall no matter what the extension length. ~blake

On Jul 11, 2013, at 4:50 AM, DStel notifications@github.com wrote:

Tanks blak3r and kvnhawkins for your answer. The configuration and version it's the same. Finally in the data center i try with the last OS Debian and it work well same in my home. I don't know why, but with OS Gentoo 2006, it not working...

Now, the call notification working very well with Debian, i have a new request.. the last :-))...

When the call arrived directly on the phone, the popup working, but when i'm make a groupCall and it's 6 phones dring same time, the popup not working.

This is the logg when just 1 phone dring (Working):

[2013-07-10 12:35:57] ! --- Event ----------------------------------------------------------- ! Event --> NewCallerid ! Privilege --> call,all ! Channel --> SIP/trunk_ovh-00000031 ! CallerIDNum --> 0180605404 ! CallerIDName --> dams ! Uniqueid --> 1373459758.49 ! CID-CallingPres --> 0 (Presentation Allowed, Not Screened) ! --------------------------------------------------------------------- 1373459758.49 CallerID Changed to: 0180605404 ! AMI Event 'Newchannel suppressed. [2013-07-10 12:35:57] ! --- Event ----------------------------------------------------------- ! Event --> Inherit ! Privilege --> call,all ! Parent --> SIP/trunk_ovh-00000031 ! Child --> SIP/30-00000032 ! --------------------------------------------------------------------- [2013-07-10 12:35:57] ! --- Event ----------------------------------------------------------- ! Event --> Dial ! Privilege --> call,all ! SubEvent --> Begin ! Channel --> SIP/trunk_ovh-00000031 ! Destination --> SIP/30-00000032 ! CallerIDNum --> 0180605404 ! CallerIDName --> dams ! ConnectedLineNum --> 0972346236 ! ConnectedLineName --> sugar crm ! UniqueID --> 1373459758.49 ! DestUniqueID --> 1373459758.50 ! Dialstring --> 30 ! ---------------------------------------------------------------------

And this is the logg when just 6 phones dring same time (Group_Appel - Not Working):

[2013-07-10 12:33:33] ! --- Event ----------------------------------------------------------- ! Event --> NewCallerid ! Privilege --> call,all ! Channel --> SIP/trunk_ovh-0000002d ! CallerIDNum --> 0180605404 ! CallerIDName --> dams ! Uniqueid --> 1373459614.45 ! CID-CallingPres --> 0 (Presentation Allowed, Not Screened) ! --------------------------------------------------------------------- 1373459614.45 CallerID Changed to: 0180605404 ! AMI Event 'Newstate suppressed. [2013-07-10 12:33:34] ! --- Event ----------------------------------------------------------- ! Event --> Join ! Privilege --> call,all ! Channel --> SIP/trunk_ovh-0000002d ! CallerIDNum --> 0180605404 ! CallerIDName --> dams ! ConnectedLineNum --> unknown ! ConnectedLineName --> unknown ! Queue --> groupe_appel ! Position --> 1 ! Count --> 1 ! Uniqueid --> 1373459614.45 ! --------------------------------------------------------------------- PHP Notice: Undefined index: UniqueID in /var/www/custom/modules/Asterisk/asteriskLogger.php on line 341 [2013-07-10 12:33:34] ! --- Event ----------------------------------------------------------- ! Event --> MusicOnHold ! Privilege --> call,all ! State --> Start ! Channel --> SIP/trunk_ovh-0000002d ! UniqueID --> 1373459614.45 ! Class --> predec ! --------------------------------------------------------------------- ! AMI Event 'Newchannel suppressed. [2013-07-10 12:33:35] ! --- Event ----------------------------------------------------------- ! Event --> Inherit ! Privilege --> call,all ! Parent --> SIP/trunk_ovh-0000002d ! Child --> SIP/30-0000002e ! ---------------------------------------------------------------------

I think YAAI take the event --> Dial and associate the "CallerIDNum" and the "Dialstring" for open the popup, but in the logg with group_appel, no have Event --> Dial...

— Reply to this email directly or view it on GitHub.

ghost commented 10 years ago

The extension Length it's "2" but i'm set SIP/###, reload php asterisklogguer and always i have this message but the popup working. => "just in Debian"

No have solution for the popup open before answer ?

Tank and Good Week

ghost commented 10 years ago

I want to say i set SIP/## and on the asterisklogguer are always looking SIP/### but working...

I try a lot solution for the popup open when its groupe call but i cannot... I don't know what the file i can modify for working with groupe call

Because it's very importante for us, it's all the phone dring when receved call

blak3r commented 10 years ago

I don't understand. The call popup never appears or it doesn't appear until answered.

I'll have a new release by tomorrow.

~blake

On Jul 13, 2013, at 3:52 PM, DStel notifications@github.com wrote:

I want to say i set SIP/## and on the asterisklogguer are always looking SIP/### but working...

I try a lot solution for the popup open when its groupe call but i cannot... I don't know what the file i can modify for working with groupe call

Because it's very importante for us, it's all the phone dring when receved call

— Reply to this email directly or view it on GitHub.

ghost commented 10 years ago

Sorry for my English.. It doesn't appears same if i answered.

The call notification working very well just when it's not a groupe call

I'm looking forward to see a new release tommorow ....thanks :-)

blak3r commented 10 years ago

Released.
http://www.sugarforge.org/frs/?group_id=773

If your issue is still occuring with the new release, please summarize your issue in a new thread.