先贴路由脚本:
log_level=3
xlog_level=3
log_stderror=yes
socket=udp:127.0.0.1:5060
mpath="/usr/lib64/opensips/modules"
loadmodule "signaling.so"
loadmodule "sl.so"
loadmodule "tm.so"
modparam("tm", "fr_timeout", 5)
modparam("tm", "fr_inv_timeout", 30)
modparam("tm", "restart_fr_on_each_reply", 0)
modparam("tm", "onreply_avp_mode", 1)
loadmodule "event_datagram.so"
loadmodule "proto_udp.so"
route{
send_reply(200,"OK");
exit;
}
startup_route{
subscribe_event("E_MY_EVENT", "udp:127.0.0.1:1234");
route(FIRE_TEST);
}
route[FIRE_TEST]{
$avp(attr) = 3;
$avp(attr) = 5;
raise_event("E_MY_EVENT", $avp(attr));
}
启动`nc -l -u 1234`
再启动opensips
nc收到的是:
{"jsonrpc":"2.0","method":"E_MY_EVENT"}
但`"params": [3, 5]`没有收到,不知道问题出在哪里