Hi all!<br><br>I try to get data from OpenSIPS via mi_datagram module.<br><br>In opensips.cfg I set:<br><br>loadmodule "mi_datagram.so"<br>modparam("mi_datagram", "socket_name", "udp:<a href="http://192.168.2.1:5059">192.168.2.1:5059</a>")<br>
modparam("mi_datagram", "children_count", 3)<br><br>Ok, OpenSIPS starts and listens port 5059.<br><br>Then I try to get some data with PHP. For example:<br><br>$command = ":uptime:\n\n";<br>
<br>$socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);<br>$ret = "";<br>$from = "";<br>$port = "";<br><br>if ($socket)<br>{<br>// socket_set_option($socket, SOL_SOCKET, SO_RCVTIMEO, array("sec" => 0, "usec" => 50000));<br>
<br> socket_sendto($socket, $command, strlen($command), 0, '192.168.2.1', 5059);<br><br> while ((socket_recvfrom($socket, $ret, 10, 0, $from, $port)))<br> {<br>// echo "Received from $from, port $port\n";<br>
echo $ret;<br> }<br>}<br><br>But this code hangs after receiving first 10 bytes. If I set large buffer (65535 bytes instead of 10 bytes), whole reply is received properly.<br><br>So, is it my bug in PHP script? Or OpenSIPS doesn't work correctly with UDP? I've read that UDP support in mi_datagram is broken. Is it still true?<br>