[OpenSIPS-Users] Presence error
Michele Pinassi
michele.pinassi at unisi.it
Tue Nov 18 12:43:12 CET 2014
Hi all,
i got this error:
ERROR:presence:get_p_notify_body: Conflict - If you want to mix dialog
info with presence you have to keep the default 'presence' event
configuration with aggregation enabled
What it means ?
Here's my config:
####### Modules Section ########
#set module path
mpath="/usr/lib/opensips/modules/"
#### SIGNALING module
loadmodule "signaling.so"
#### StateLess module
loadmodule "sl.so"
#### Transaction Module
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)
#### Record Route Module
loadmodule "rr.so"
/* do not append from tag to the RR (no need for this script) */
modparam("rr", "append_fromtag", 0)
#### MAX ForWarD module
loadmodule "maxfwd.so"
#### SIP MSG OPerationS module
loadmodule "sipmsgops.so"
#### FIFO Management Interface
loadmodule "mi_fifo.so"
modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")
modparam("mi_fifo", "fifo_mode", 0666)
#### HTTPD module
#loadmodule "httpd.so"
#modparam("httpd", "ip", "127.0.0.1")
#modparam("httpd", "port", 8880)
#### XMLRPC module
#loadmodule "mi_xmlrpc_ng.so"
#modparam("mi_xmlrpc_ng", "mi_xmlrpc_ng_root", "mi")
#### SIGNALING module
loadmodule "textops.so"
#### MYSQL module
loadmodule "db_mysql.so"
#### URI module
loadmodule "uri.so"
modparam("uri", "db_url", "mysql://")
modparam("uri", "use_uri_table", 0)
modparam("uri", "use_domain", 1)
#### USeR LOCation module
loadmodule "usrloc.so"
modparam("usrloc", "nat_bflag", "NAT")
modparam("usrloc", "db_mode", 2)
#### ENUM module
loadmodule "enum.so"
modparam("enum", "domain_suffix", "e1234.arpa.")
#### REGISTRAR module
loadmodule "registrar.so"
modparam("registrar", "tcp_persistent_flag", "TCP_PERSISTENT")
modparam("registrar", "received_avp", "$avp(received_nh)")
modparam("registrar", "default_expires", 3600)
modparam("registrar", "min_expires", 60)
modparam("registrar", "max_expires", 120)
#### AUTHentication modules
loadmodule "auth.so"
loadmodule "auth_db.so"
modparam("auth_db", "calculate_ha1", yes)
modparam("auth_db", "password_column", "password")
modparam("auth_db", "load_credentials", "")
#### ALIAS module
loadmodule "alias_db.so"
modparam("alias_db", "db_url", "mysql://")
#### DOMAIN module
loadmodule "domain.so"
modparam("domain", "db_url", "mysql://")
modparam("domain", "db_mode", 1) # Use caching
modparam("auth_db|usrloc|uri", "use_domain", 1)
#### USERBLACKLIST module
loadmodule "userblacklist.so"
modparam("userblacklist", "db_url", "mysql://")
modparam("userblacklist", "use_domain", 1)
#### PRESENCE modules
loadmodule "presence.so"
loadmodule "presence_mwi.so"
loadmodule "presence_callinfo.so"
loadmodule "presence_dialoginfo.so"
modparam("presence", "db_url", "mysql://")
modparam("presence", "server_address", "sip:172.20.1.2:5060")
modparam("presence", "notify_offline_body", 1)
modparam("presence", "fallback2db", 1)
modparam("presence", "clean_period", 30)
modparam("presence", "mix_dialog_presence", 1)
#### PUA module
loadmodule "pua.so"
loadmodule "pua_dialoginfo.so"
loadmodule "pua_usrloc.so"
modparam("pua", "db_url", "mysql://")
modparam("pua_dialoginfo", "presence_server", "sip:172.20.1.2:5060")
modparam("pua_usrloc", "default_domain", "voip.unisi.it")
#### DIALOG module
loadmodule "dialog.so"
modparam("dialog", "dlg_match_mode", 1)
modparam("dialog", "default_timeout", 21600) # 6 hours timeout
modparam("dialog", "db_mode", 2)
#### NAT modules
loadmodule "nathelper.so"
modparam("nathelper", "natping_interval", 15)
modparam("nathelper", "ping_nated_only", 1)
modparam("nathelper", "received_avp", "$avp(received_nh)")
loadmodule "nat_traversal.so"
modparam("nat_traversal", "keepalive_interval", 30)
modparam("nat_traversal", "keepalive_method", "OPTIONS")
modparam("nat_traversal", "keepalive_from", "sip:keepalive at voip.unisi.it")
modparam("nat_traversal", "keepalive_state_file",
"/var/run/opensips/keepalive_state")
# loadmodule "rtpproxy.so"
loadmodule "rtpproxy.so"
modparam("rtpproxy", "rtpproxy_sock", "udp:localhost:12221")
#### DYNAMIC ROUTING module
loadmodule "drouting.so"
modparam("drouting", "db_url", "mysql://")
modparam("drouting", "use_domain", 1)
modparam("drouting", "probing_interval", 60)
modparam("drouting", "probing_from", "sip:pinger at 172.20.1.4")
modparam("drouting", "probing_method", "OPTIONS")
modparam("drouting", "probing_reply_codes", "501, 403, 404")
#### GROUP module
loadmodule "group.so"
modparam("group", "db_url", "mysql://")
modparam("group", "use_domain", 1)
#### PERMISSIONS module
loadmodule "permissions.so"
modparam("permissions", "db_url", "mysql://")
modparam("permissions", "address_table", "address")
modparam("permissions", "grp_col", "grp")
modparam("permissions", "ip_col", "ip")
modparam("permissions", "mask_col", "mask")
modparam("permissions", "port_col", "port")
modparam("permissions", "proto_col", "proto")
modparam("permissions", "info_col", "context_info")
#### B2BUA module
loadmodule "b2b_entities.so"
loadmodule "b2b_logic.so"
#### AVP module
loadmodule "avpops.so"
modparam("avpops", "db_url", "mysql://")
modparam("avpops","avp_table","usr_preferences")
#### DIALPLAN module
loadmodule "dialplan.so"
modparam("dialplan", "db_url", "mysql://")
####### Routing Logic ########
# main request routing logic
route {
force_rport();
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
}
# Verifica che l'IP provenga da una rete abilitata (address table)
if (!check_address("0","$si","$sp","$proto")) {
xlog("L_INFO","IP $si Forbidden");
sl_send_reply("403", "Forbidden");
}
if (is_method("INVITE")) {
# Table "address" to define in which group the user is, based on IP
if (!get_source_group("$var(group)") ) {
$var(group) = 3;
}
# User net group:
# 1 = Internal VoIP subnet 172.20
# 2 = External VoIP subnet but inside Unisi context 172.16 | 10.0.0
# 3 = Outside/foreign (not allowed)
xlog("L_INFO", "User net group is $var(group)
[$fd/$fu/$rd/$ru/$si]\n");
}
if (has_totag()) {
# sequential request withing a dialog should
# take the path determined by record-routing
if (loose_route()) {
# validate the sequential request against dialog
if ( $DLG_status!=NULL && !validate_dialog() ) {
xlog("In-Dialog $rm from $si (callid=$ci) is not valid
according to dialog\n");
## exit;
}
if (is_method("INVITE")) {
# even if in most of the cases is useless, do RR for
# re-INVITEs alos, as some buggy clients do change route set
# during the dialog.
record_route();
}
if (check_route_param("nat=yes"))
setflag(NAT);
# route it out to whatever destination was set by loose_route()
# in $du (destination URI).
route(relay);
} else {
if (is_method("SUBSCRIBE") && $rd == "127.0.0.1:5060") {
# in-dialog subscribe requests
route(handle_presence);
exit;
}
if ( is_method("ACK") ) {
if ( t_check_trans() ) {
# non loose-route, but stateful ACK; must be an ACK
after
# a 487 or e.g. 404 from upstream server
t_relay();
exit;
} else {
# ACK without matching transaction ->
# ignore and discard
exit;
}
}
sl_send_reply("404","Not here");
}
exit;
}
# CANCEL processing
if (is_method("CANCEL"))
{
if (t_check_trans())
t_relay();
exit;
}
t_check_trans();
if ( !(is_method("REGISTER") || is_from_gw() ) ) {
if (is_from_local()) {
if (!proxy_authorize("", "subscriber")) {
proxy_challenge("", "0");
exit;
}
if (!db_check_from()) {
sl_send_reply("403","Forbidden auth ID");
exit;
}
consume_credentials();
} else {
if (!is_uri_host_local()) {
send_reply("403","Rely forbidden");
exit;
}
}
}
# preloaded route checking
if (loose_route()) {
xlog("L_ERR", "Attempt to route with preloaded Route's
[$fu/$tu/$ru/$ci]");
if (!is_method("ACK"))
sl_send_reply("403","Preload Route denied");
exit;
}
# record routing
if (!is_method("REGISTER|MESSAGE"))
record_route();
# account only INVITEs
if (is_method("INVITE")) {
# create dialog with timeout
if ( !create_dialog() ) {
send_reply("500","Internal Server Error");
exit;
}
dialoginfo_set();
}
if (!is_uri_host_local()) {
append_hf("P-hint: outbound\r\n");
route(relay);
}
if(is_method("PUBLISH|SUBSCRIBE")) {
route(handle_presence);
}
[....]
route(relay);
}
# RELAY
route[relay] {
# for INVITEs enable some additional helper routes
if (is_method("INVITE")) {
xlog("L_INFO","Route RELAY on INVITE [$fd/$fu/$rd/$ru/$si/]\n");
dialoginfo_set();
t_on_branch("per_branch_ops");
t_on_failure("missed_call");
}
if (isflagset(NAT)) {
add_rr_param(";nat=yes");
}
if (!t_relay()) {
send_reply("500","Internal Error");
}
exit;
}
# Presence route
route[handle_presence] {
xlog("L_INFO","Route PRESENCE [$fd/$fu/$rd/$ru/$si/]\n");
if(!t_newtran()){
sl_reply_error();
exit;
}
if (is_method("PUBLISH")) {
if($hdr(Sender)!= NULL)
handle_publish("$hdr(Sender)");
else
handle_publish();
}
if (is_method("SUBSCRIBE")) {
if(search("^Event: message-summary")) {
# if there is no R-URI username, grab From URI
if(!uri=~"sip:.+@") { # add From username as R-URI username
avp_pushto("$ruri/username","$fU");
}
# fix some broken subscriptions
if(!search("^Accept: application/simple-message-summary"))
append_hf("Accept: application/simple-message-summary\r\n");
setdsturi("sip:172.20.1.5:5060");
t_relay();
} else {
# ...for anything else...
handle_subscribe();
}
}
exit;
}
branch_route[per_branch_ops] {
xlog("L_INFO","Route NEW BRANCH [$fd/$fu/$rd/$ru/$si/]\n");
}
failure_route[missed_call] {
xlog("L_INFO","Route MISSED CALL [$fd/$fu/$rd/$ru/$si/]\n");
if (t_was_cancelled()) {
exit;
}
# User set CALL FORWARD ON BUSY ?
if (t_check_status("486")) {
revert_uri();
if(avp_db_load("$ru","$avp(fwdbusy)")) {
$ru = $avp(fwdbusy);
xlog("L_INFO","User forward on BUSY to $ru\n");
} else {
# Forward call with BUSY to Asterisk
prefix("BUSY_");
rewritehostport("172.20.1.5:5060");
}
t_relay();
}
# if the failure code is "408 - timeout" or "480 - unanswered"
if (t_check_status("408|480")) {
revert_uri();
if(avp_db_load("$ru","$avp(fwdnoans)")) {
$ru = $avp(fwdnoans);
xlog("L_INFO","User forward on TIMEOUT/NOANSWER to $ru\n");
} else {
prefix("VMR_");
rewritehostport("172.20.1.5:5060");
}
t_relay();
}
# For other...
if (t_check_status("5[0-9][0-9]")) {
revert_uri();
prefix("FAILURE_");
rewritehostport("172.20.1.5:5060");
t_relay();
}
}
failure_route[next_gw] {
if (use_next_gw()) {
t_relay();
exit;
}
}
--
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)2169 - fax: 0577.(23)2053
Per trovare una soluzione rapida ai tuoi problemi tecnici
consulta le FAQ di Ateneo, http://www.faq.unisi.it
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <http://lists.opensips.org/pipermail/users/attachments/20141118/67f4ae1c/attachment.pgp>
More information about the Users
mailing list