#49423 [Fbk]: fwrite doesn't send "REGISTER" to udp port 5060
| From: | sjoerd@php.net | Date: | Mon, 31 Aug 2009 16:20:37 +0000 |
| Subject: | #49423 [Fbk]: fwrite doesn't send "REGISTER" to udp port 5060 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-141752@lists.php.net to get a copy of this message | ||
ID: 49423
Updated by: sjoerd@php.net
Reported By: david dot schueler at wapkamera dot de
Status: Feedback
Bug Type: Streams related
Operating System: Gentoo Linux
PHP Version: 5.2.10
New Comment:
Thank you for your report.
I could not reproduce your problem. You say it only fails to send
something if port 5060 is used. This leads me to think this issue is
specific to your computer. Maybe another program is running on port
5060, or a firewall has blocked this port. How do you determine whether
the packet is sent?
Previous Comments:
------------------------------------------------------------------------
[2009-08-31 15:50:41] jani@php.net
And I guess you wanted to send the \r\n as line feed/break instead of
literal \r\n ? If so, you should put double quotes around the text..
------------------------------------------------------------------------
[2009-08-31 15:46:53] jani@php.net
Please try using this snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://windows.php.net/snapshots/
Works fine for me. fwrite() returns int(13).
------------------------------------------------------------------------
[2009-08-31 13:22:55] david dot schueler at wapkamera dot de
Description:
------------
If i execute the script below, it will not send the text "REGISTER"
over UDP. If the text is prepended with any other character or sent to
another port it will be transmitted successful.
Reproduce code:
---------------
<?php
$opts = array('socket' => array("bindto" => "0:5050")); // set
source
port = 5050
$context = stream_context_create($opts);
$socket = stream_socket_client("udp://127.0.0.1:5060", $errno, $error,
30, STREAM_CLIENT_CONNECT, $context);
fwrite($socket,'REGISTER \r\n');
?>
Expected result:
----------------
The text "REGISTER" followed by a line break to be send over UDP to the
given host and port.
Actual result:
--------------
Nothing happens. No packet gets generated, no error or warning is
thrown. fwrite() retuns 0.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49423&edit=1