<div dir="ltr">Hello Team,<br><br>We are using Kamailio 5.4.7 (DMQ + Presence) modules. We want to replicate all subscribe from server-1(Presence) to server-2(Presence).Replication worked perfectly fine but we noticed that after replicate the subscribe event both the presence server are generating the NOTIFY which should not. <br><br>Can you please guide us where we made the mistake or how we can just replicate the subscribe information to other server using DMQ module?<br><br>Please find the configuration<br><br><br>SERVER-1 (Presence)<br>========================<br><br>### presence_dialoginfo params ###<br>modparam("presence_dialoginfo", "force_single_dialog", 1)<br><br><br>######## presence params #########<br>modparam("presence", "db_table_lock_type", 0)<br>modparam("presence", "db_url", DBURL_LOCAL)<br>modparam("presence", "db_update_period", 30)<br>modparam("presence", "send_fast_notify", 1)<br>modparam("presence", "clean_period", 100)<br>modparam("presence", "subs_db_mode", 3)<br>modparam("presence", "timeout_rm_subs", 0) //new/<br>modparam("presence", "notifier_poll_rate", 20) //new//<br>modparam("presence", "waitn_time",1)<br>modparam("presence", "fetch_rows", 1000)<br>modparam("presence", "presentity_table", "presentity")<br>modparam("presence", "active_watchers_table", "active_watchers")<br>modparam("presence", "watchers_table", "watchers")<br>modparam("presence", "max_expires", 3600)<br>modparam("presence", "server_address", "sip:presence@VAR_LOCAL_IP:SIP_PORT")<br>modparam("presence", "notifier_processes", 0)<br>modparam("presence", "publ_cache", 1)<br>modparam("presence", "subs_htable_size", 15)<br>modparam("presence", "pres_htable_size", 15)<br>modparam("presence", "delete_same_subs", 1)<br>modparam("presence", "timer_mode", 0)<br>modparam("presence", "force_delete", 1)<br>modparam("presence", "enable_dmq", 1)<br><br>######## presence_xml params ######<br>modparam("presence_xml", "db_url", DBURL_LOCAL)<br>modparam("presence_xml", "force_active", 1)<br>#modparam("presence_xml", "disable_presence",1)<br><br>#--- dmq db param ----<br>modparam("dmq","server_address","sip:VAR_LOCAL_IP:SIP_PORT")<br>modparam("dmq", "notification_address", DMQ_NOTIFY_ADDR1)<br>modparam("dmq", "num_workers", 4)<br>modparam("dmq", "multi_notify", 1)<br>modparam("dmq", "ping_interval", 60)<br><br>if(is_method("KDMQ")) {<br>              dmq_handle_message();<br> }<br>route[HANDLE_PRESENCE] {<br><br>        if (! t_newtran())<br>        {<br>                sl_reply_error();<br>                exit;<br>        }<br><br>        if(is_method("PUBLISH"))<br>        {<br>                if ($hdr(Event) == "message-summary") {<br>                        if($hdr(P-Flags)=~"1") {<br>                                remove_hf("Event");<br>                                append_hf("Event: dialog\r\n");<br>                                msg_apply_changes();    <br>                                remove_hf("Content-Type");<br>                                append_hf("Content-Type: application/dialog-info+xml\r\n");<br>                                msg_apply_changes();   <br>                        } <br>                }<br><br>                if((search_hf("To", "queue+", "a")) && is_present_hf("SIP-If-Match")){<br>                        remove_hf("SIP-If-Match");<br>                        msg_apply_changes();    <br>                }<br>                xlog("L_ERR","(xhttp:request) : HANDLE_PUBLISH_FUN \n");<br>                handle_publish();<br>                t_release();<br>        } else if( is_method("SUBSCRIBE")) {<br><br>                handle_subscribe();<br>            if(!dmq_is_from_node()) dmq_t_replicate();<br>                t_release();<br>        }<br>        exit;<br>}<br><br>SERVER-2 (Presence)<br>======================<br><br>### presence_dialoginfo params ###<br>modparam("presence_dialoginfo", "force_single_dialog", 1)<br><br><br>######## presence params #########<br>modparam("presence", "db_table_lock_type", 0)<br>modparam("presence", "db_url", DBURL_LOCAL)<br>modparam("presence", "db_update_period", 30)<br>modparam("presence", "send_fast_notify", 1)<br>modparam("presence", "clean_period", 100)<br>modparam("presence", "subs_db_mode", 3)<br>modparam("presence", "timeout_rm_subs", 0) //new/<br>modparam("presence", "notifier_poll_rate", 20) //new//<br>modparam("presence", "waitn_time",1)<br>modparam("presence", "fetch_rows", 1000)<br>modparam("presence", "presentity_table", "presentity")<br>modparam("presence", "active_watchers_table", "active_watchers")<br>modparam("presence", "watchers_table", "watchers")<br>modparam("presence", "max_expires", 3600)<br>modparam("presence", "server_address", "sip:presence@VAR_LOCAL_IP:SIP_PORT")<br>modparam("presence", "notifier_processes", 0)<br>modparam("presence", "publ_cache", 1)<br>modparam("presence", "subs_htable_size", 15)<br>modparam("presence", "pres_htable_size", 15)<br>modparam("presence", "delete_same_subs", 1)<br>modparam("presence", "timer_mode", 0)<br>modparam("presence", "force_delete", 1)<br>modparam("presence", "enable_dmq", 1)<br><br>######## presence_xml params ######<br>modparam("presence_xml", "db_url", DBURL_LOCAL)<br>modparam("presence_xml", "force_active", 1)<br>#modparam("presence_xml", "disable_presence",1)<br><br>#--- dmq db param ----<br>modparam("dmq","server_address","sip:VAR_LOCAL_IP:SIP_PORT")<br>modparam("dmq", "notification_address", DMQ_NOTIFY_ADDR1)<br>modparam("dmq", "num_workers", 4)<br>modparam("dmq", "multi_notify", 1)<br>modparam("dmq", "ping_interval", 60)<br>if(is_method("KDMQ")) {<br>          dmq_handle_message();<br> }<br>route[HANDLE_PRESENCE] {<br><br>        if (! t_newtran())<br>        {<br>                sl_reply_error();<br>                exit;<br>        }<br><br>        if(is_method("PUBLISH"))<br>        {<br>                if ($hdr(Event) == "message-summary") {<br>                        if($hdr(P-Flags)=~"1") {<br>                                remove_hf("Event");<br>                                append_hf("Event: dialog\r\n");<br>                                msg_apply_changes();    <br>                                remove_hf("Content-Type");<br>                                append_hf("Content-Type: application/dialog-info+xml\r\n");<br>                                msg_apply_changes();   <br>                        } <br>                }<br><br>                if((search_hf("To", "queue+", "a")) && is_present_hf("SIP-If-Match")){<br>                        remove_hf("SIP-If-Match");<br>                        msg_apply_changes();    <br>                }<br>                xlog("L_ERR","(xhttp:request) : HANDLE_PUBLISH_FUN \n");<br>                handle_publish();<br>                t_release();<br>        } else if( is_method("SUBSCRIBE")) {<br><br>                handle_subscribe();<br>            if(!dmq_is_from_node()) dmq_t_replicate();<br>                t_release();<br>        }<br>        exit;<br>}<br><br><br>version: kamailio 5.4.7 (x86_64/linux) a19fe1<br>flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED<br>ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB<br>poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.<br>id: a19fe1 <br>compiled on 00:05:09 Oct 21 2021 with gcc 8.3.0<br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">Hardik Patel<div><br></div></div></div></div></div></div>