[OpenSIPS-Users] mi_datagram - what is the correct syntax?

Chris Maciejewski chris at wima.co.uk
Tue Oct 14 16:02:50 CEST 2008


Hi,

I am trying to use mi_datagram with PHP "client". My code is:

---------------------------------
$socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);

$conn = socket_connect($socket, $config['address'], $config['port']);

$packet = ":which:\n:\n:\n";

socket_write($socket,$packet,strlen($packet));
socket_write($socket, "\r\n", strlen("\r\n"));
------------------------------------

when running the above, I can "see" with ngrep on the wire:
-------------------------------------------
#
U <src_ip>:35728 -> <dst_ip>:5555
:which:
:
:

--------------------------------------------

but in OpenSIPs log there is always:
--------------------------------------------
Oct 14 14:51:40 dev2 opensips[20536]:
ERROR:mi_datagram:identify_command: command must begin with: :
Oct 14 14:51:40 dev2 opensips[20536]:
ERROR:mi_datagram:mi_datagram_server: command not available
--------------------------------------------

Any help would be very much appreciated.

Regards,
Chris



More information about the Users mailing list