alaabataineh / php-rtmp-client

Automatically exported from code.google.com/p/php-rtmp-client
1 stars 0 forks source link

PHP RTMP with FMS 3.5 Question #3

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hey Man,
I was hoping you could point me in the right direction. I am trying to use
your php rtmp client and am able to make the connection to the FMS and call
the method, but I can not receive the return value from the server. I can
see that the argument is passed to the application from the FMS
administration panel but nothing in PHP.

Do I need to establish a handler in PHP like I would in AS3?

Here is my code:

require "RtmpClient.class.php";
require "debug.php";
$client = new RtmpClient();
$client->connect("myHost","myApp");

$arg1 = "hey!";

$result = $client->call("remoteMethod", array($arg1)); //do I need a
responder/handler?

var_dump($result);

$client->close();

Thank you for your time,
Bryan

Original issue reported on code.google.com by bwillia...@gmail.com on 21 Dec 2009 at 10:17

GoogleCodeExporter commented 8 years ago
I'm having the same problem. I can confirm that the call is received by the fms
server though the response is not received by php. It just waits for it for a 
while
and then the script execution time kicks in.

Anyway, great work! If you need any support, i'll be happy to help out.

Original comment by niek%sou...@gtempaccount.com on 21 Apr 2010 at 3:17

GoogleCodeExporter commented 8 years ago
I am having the exact same problem with FMS 3.5 and php5 please help! so close!

Original comment by dwasy...@gmail.com on 27 May 2010 at 4:44

GoogleCodeExporter commented 8 years ago
Same here for me - FMS 3.5, unable to decode the server response (which is 
properly received at network level).

Original comment by santi...@gmail.com on 14 Aug 2010 at 10:05

GoogleCodeExporter commented 8 years ago
Further investigating the "timeout" problem, it appears that the AMF3 
deserializer is invoked on the server response, while the encoding is actually 
AMF0. In addition, a 0x00 byte should be stripped before deserializing the 
response.

I'm attaching a patch implementing this, together with two other popular fixes:
- remove the check on $this->operations in RtmpClient.class.php;
- set to 0x00 the four bytes sent after timestamp in the C1 handshake packet 
(this was apparently not necessary, at least in my case, but the RTMP specs 
require a 32-bit NULL, so...).

Original comment by santi...@gmail.com on 25 Aug 2010 at 3:44

Attachments:

GoogleCodeExporter commented 8 years ago
Thx for the div santinod!

Original comment by nexflo@gmail.com on 12 Dec 2010 at 3:33

GoogleCodeExporter commented 8 years ago
how do i apply the patch? or is it already applied if i get the source from svn?

Original comment by kje...@gmail.com on 6 Jan 2011 at 11:26

GoogleCodeExporter commented 8 years ago
kjeske,
 assuming your local code base is in trunk/, do

cd trunk
patch -p1 < /path/to/rtmp-patch-ds1.txt

Original comment by santi...@gmail.com on 10 Jan 2011 at 2:53

GoogleCodeExporter commented 8 years ago

Original comment by qwantix@gmail.com on 21 Jan 2011 at 10:10

GoogleCodeExporter commented 8 years ago
has anyone had any luck with fms 4? i applied the patch but i still get the 
timeout.. :(

Original comment by ejur...@gmail.com on 27 Jan 2011 at 8:49

GoogleCodeExporter commented 8 years ago
Yes, I routinely use the patched code with FMS 4.

Original comment by santi...@gmail.com on 27 Jan 2011 at 9:19

GoogleCodeExporter commented 8 years ago
OK the reason that its not working is because i'm passing in an array object 
like so:
$emailData = array();
$emailData['ENTRY_NAME'] = 'test';     
$emailData["ENTRY_DATE"] = date('F jS, g:i A',time()) . " - ". date('F jS, g:i 
A',time());                                                             
$emailData['ENTRY_MESSAGE'] = 'this is a message';
$emailData['ENTRY_LOCATION'] = 'this is the location';                          

$emailData['USER_NAME'] = 'username';  
$emailData['TIME_TO_EVENT'] = '30 mins from now';
$emailData['EMAIL'] = 'test@test';
$result = $client->call('sendCalendarAlert',array('test',$emailData)); 
$client->close();                                              

but because there is alot of data (or at least the rtmpclient thinks so, it 
timesout..
but if i only send two object keys instead of the 7 it works..

why would that be??

Original comment by ejur...@gmail.com on 28 Jan 2011 at 1:41

GoogleCodeExporter commented 8 years ago
OK sorry for all the comments,
But after reading through all the issues and patches.. i ended up finding a 
patch that fixed my issue..
It would be nice if all these patches were made to the latest source so someone 
doesn't have to go and apply all the patches individually.

Cheers

Original comment by ejur...@gmail.com on 28 Jan 2011 at 2:00

GoogleCodeExporter commented 8 years ago
I still can not get a response back from the fms server after installing these 
patches. I only ever receive a NULL response.

can someone please assist in getting this going?

Original comment by kje...@gmail.com on 20 Aug 2011 at 6:32