瀏覽代碼

ims_registrar_pcscf: reconfig ipsec in save pending

- Reconfig ipsec tunnels for each new pending contact.
  If there are no registered contacts remove all SAs/Policies.
Aleksandar Yosifov 6 年之前
父節點
當前提交
b34d06ffbe
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/modules/ims_registrar_pcscf/save.c

+ 2 - 0
src/modules/ims_registrar_pcscf/save.c

@@ -363,6 +363,8 @@ int save_pending(struct sip_msg* _m, udomain_t* _d) {
 
 	ul.lock_udomain(_d, &ci.via_host, ci.via_port, ci.via_prot);
 	if (ul.get_pcontact(_d, &ci, &pcontact) != 0) { //need to insert new contact
+		ipsec_pcscf.ipsec_reconfig(); // try to clean all ipsec SAs/Policies if there is no registered contacts
+
 		LM_DBG("Adding pending pcontact: <%.*s>\n", c->uri.len, c->uri.s);
 		ci.reg_state=PCONTACT_REG_PENDING;
 		if (ul.insert_pcontact(_d, &c->uri, &ci, &pcontact) != 0) {