Module: kamailio
Branch: master
Commit: 812ad6eb4e49426197e2860b89b255fffb018b5a
URL:
https://github.com/kamailio/kamailio/commit/812ad6eb4e49426197e2860b89b255f…
Author: Xenofon Karamanos <22965395+xkaraman(a)users.noreply.github.com>
Committer: Xenofon Karamanos <22965395+xkaraman(a)users.noreply.github.com>
Date: 2024-04-09T13:32:46+03:00
ipops: Add brief comment for ptr_query
---
Modified: src/modules/ipops/ipops_mod.c
Modified: src/modules/ipops/ipops_pv.c
---
Diff:
https://github.com/kamailio/kamailio/commit/812ad6eb4e49426197e2860b89b255f…
Patch:
https://github.com/kamailio/kamailio/commit/812ad6eb4e49426197e2860b89b255f…
---
diff --git a/src/modules/ipops/ipops_mod.c b/src/modules/ipops/ipops_mod.c
index ea2669d2a19..60fd514d4fb 100644
--- a/src/modules/ipops/ipops_mod.c
+++ b/src/modules/ipops/ipops_mod.c
@@ -1298,7 +1298,18 @@ static int ki_dns_query(sip_msg_t *msg, str *naptrname, str *pvid)
}
/**
+ *! \brief Return 1 (true) if the given `ip` IP address (string or pv)
+ * could successfully be resolved to a domain and saved into `pv_name` pv.
+ * Otherwise, return negative values depending on the error.
*
+ * \param[in] msg SIP message structure.
+ * \param[in] ip IP address (string or pv) to resolve.
+ * \param[in] pv_name PV name to save the resolved domain.
+ * \returns 1 on success.
+ * \returns negative values depending on the error:
+ * \retval 1 success.
+ * \retval res -1 to -5 for bad input.
+ * \retval -6 for error in resolving the domain.
*/
static int w_ptr_query(sip_msg_t *msg, char *ip, char *pv_name)
{
diff --git a/src/modules/ipops/ipops_pv.c b/src/modules/ipops/ipops_pv.c
index 10447e84bcd..034ec696594 100644
--- a/src/modules/ipops/ipops_pv.c
+++ b/src/modules/ipops/ipops_pv.c
@@ -413,8 +413,16 @@ int dns_update_pv(str *hostname, str *name)
return 1;
}
-/*
-*
+/**
+ * \brief Updates the pointer (PTR) record for a given IP address and saves it into pv.
+ *
+ * \details This function updates the PTR record for a specified IP address, and saves
it
+ * into `name` AVP encapsulated in $ptrquery pv.
+ * It performs a reverse DNS lookup to obtain the hostname corresponding to the IP
address.
+ *
+ * @param ip_address The IP address to update the PTR record for.
+ * @param name The name of AVP to hold the information in $ptrquery pv.
+ * @return 1 on success, or a negative value on failure.
*/
int ptr_update_pv(str *ip_address, str *name)
{