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

Chris Maciejewski chris at wima.co.uk
Tue Oct 14 18:01:34 CEST 2008


Hi Bogdan and Ovidiu ,

Thanks for help.

After changing my code to:
------------------------------------------
$socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);

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

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

socket_write($socket,$packet,strlen($packet));
- Hide quoted text -
$res = socket_read($socket,9064);

print_r($res);
-----------------------------------------

I can see in logs:
-----------------------------------------
DBG:mi_datagram:mi_datagram_server: received :which:
DBG:mi_datagram:mi_datagram_server: mi_buf is :which:   and we have
received 9 bytes
DBG:mi_datagram:identify_command: the command starts here: which:
DBG:mi_datagram:identify_command: the command is which
DBG:mi_datagram:identify_command: dtgram->len is 9
DBG:mi_datagram:identify_command: dtgram->len is 1
.....
-----------------------------------------

and finally

-----------------------------------------
.....
DBG:mi_datagram:mi_datagram_write_node: writing the name <> and value
<ds_reload>
DBG:mi_datagram:mi_datagram_write_node: writing the name <> and value
<refreshWatchers>
DBG:mi_datagram:mi_datagram_write_node: writing the name <> and value <dum>
DBG:mi_datagram:mi_datagram_server: the response: 200 OK
get_statistics reset_statistics uptime version pwd arg which ps kill
debug list_blacklists domain_reload domain_dump t_uac_dlg t_uac_cancel
t_hash t_reply ul_rm ul_rm_contact ul_dump ul_flush ul_add
ul_show_contact set_gflag reset_gflag is_gflag get_gflags
nh_enable_ping nh_enable_rtpp nh_show_rtpp ds_set_state ds_list
ds_reload refreshWatchers dum  has been sent in 358 octets
-----------------------------------------

but no data is sent back by Opensip :-( so looks like indeed UDP
implementation is broken as mentioned before by Ovidiu.

Is there any chance this will be fixed any time soon?

I will try looking into datagram_fnc.c on my own and fix this, but
with my C skills it make take very loooong until we get it fixed :-(

Regards,

Chris



More information about the Users mailing list