Module: kamailio
Branch: 5.5
Commit: 063bceefc411e2841b7507d9f366a45d62cfbe00
URL:
https://github.com/kamailio/kamailio/commit/063bceefc411e2841b7507d9f366a45…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2023-07-17T11:17:02+02:00
ipops: create container items if not found for srv and naptr functions
- GH #3419
(cherry picked from commit 7971d825361bee29d65fcea69f2978d7af31eeaa)
(cherry picked from commit 408643ec916bc00f9f9447952e553d129f8ec896)
(cherry picked from commit 771fcd42e315376c9d3c16bb63983a72e508be18)
---
Modified: src/modules/ipops/ipops_pv.c
---
Diff:
https://github.com/kamailio/kamailio/commit/063bceefc411e2841b7507d9f366a45…
Patch:
https://github.com/kamailio/kamailio/commit/063bceefc411e2841b7507d9f366a45…
---
diff --git a/src/modules/ipops/ipops_pv.c b/src/modules/ipops/ipops_pv.c
index 6e9d86b5a6a..5151dfd39dc 100644
--- a/src/modules/ipops/ipops_pv.c
+++ b/src/modules/ipops/ipops_pv.c
@@ -633,7 +633,7 @@ static sr_srv_item_t *_sr_srv_list = NULL;
*
* INPUT:
* Arg (1) = pvid string pointer
- * Arg (2) = find flag; <>0=search only
+ * Arg (2) = find flag; 0 - add if not found; 1 - search only
* OUTPUT: srv record pointer; NULL=not found
**********/
@@ -1022,9 +1022,9 @@ int srv_update_pv (str *srvcname, str *pvid)
LM_DBG ("service name missing: %.*s\n", srvcname->len, srvcname->s);
return -2;
}
- pitem = sr_srv_add_item (pvid, 1);
- if (!pitem) {
- LM_DBG ("pvid not found: %.*s\n", pvid->len, pvid->s);
+ pitem = sr_srv_add_item(pvid, 0);
+ if(!pitem) {
+ LM_DBG("pvid not found: %.*s\n", pvid->len, pvid->s);
return -3;
}
@@ -1185,7 +1185,7 @@ static sr_naptr_item_t *_sr_naptr_list = NULL;
*
* INPUT:
* Arg (1) = pvid string pointer
- * Arg (2) = find flag; <>0=search only
+ * Arg (2) = find flag; 0 - add if not found, 1 - search only
* OUTPUT: naptr record pointer; NULL=not found
**********/
@@ -1491,9 +1491,9 @@ int naptr_update_pv(str *naptrname, str *pvid)
LM_DBG ("naptr name missing: %.*s\n", naptrname->len, naptrname->s);
return -2;
}
- pitem = sr_naptr_add_item(pvid, 1);
- if (!pitem) {
- LM_DBG ("pvid not found: %.*s\n", pvid->len, pvid->s);
+ pitem = sr_naptr_add_item(pvid, 0);
+ if(!pitem) {
+ LM_DBG("pvid not found: %.*s\n", pvid->len, pvid->s);
return -3;
}