Commit 5a5058bb48 for asterisk.org
commit 5a5058bb48b5bf57fbfd8a453e0dd9d1be681646
Author: Tinet-mucw <mucw@ti-net.com.cn>
Date: Mon Nov 2 22:45:40 2026 -0800
res_pjsip: Pass the monitor matcher through register_replace.
ast_sip_transport_monitor_register_replace() dropped the caller-supplied
matcher and always passed NULL to register_replace_key(). Duplicate
monitors were then compared by pointer, so a new contact monitor was
appended on every registration instead of replacing the existing one.
Monitors accumulated on a reliable transport until that transport closed.
Fixes: #2270
diff --git a/res/res_pjsip/pjsip_transport_events.c b/res/res_pjsip/pjsip_transport_events.c
index 5aeb8f87b4..6c91aed1fa 100644
--- a/res/res_pjsip/pjsip_transport_events.c
+++ b/res/res_pjsip/pjsip_transport_events.c
@@ -496,7 +496,7 @@ enum ast_transport_monitor_reg ast_sip_transport_monitor_register_replace(pjsip_
char key[IP6ADDR_COLON_PORT_BUFLEN];
AST_SIP_MAKE_REMOTE_IPADDR_PORT_STR(transport, key);
- return ast_sip_transport_monitor_register_replace_key(key, cb, ao2_data, NULL);
+ return ast_sip_transport_monitor_register_replace_key(key, cb, ao2_data, matches);
}
enum ast_transport_monitor_reg ast_sip_transport_monitor_register_replace_key(const char *transport_key,