Module: sip-router
Branch: master
Commit: 3bf32dc0003b447a5695be5ff9d22d70f393c62f
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=3bf32dc…
Author: Charles Chance <charles.chance(a)sipcentric.com>
Committer: Charles Chance <charles.chance(a)sipcentric.com>
Date: Tue Sep 9 23:52:46 2014 +0100
dmq: include resolved IP address in RPC list_nodes output
---
modules/dmq/dmq.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/modules/dmq/dmq.c b/modules/dmq/dmq.c
index 06d9cfb..c773e1f 100644
--- a/modules/dmq/dmq.c
+++ b/modules/dmq/dmq.c
@@ -343,12 +343,16 @@ static void dmq_rpc_list_nodes(rpc_t *rpc, void *c)
{
void *h;
dmq_node_t* cur = node_list->nodes;
+ char ip[IP6_MAX_STR_SIZE + 1];
while(cur) {
+ memset(ip, 0, IP6_MAX_STR_SIZE + 1);
+ ip_addr2sbuf(&cur->ip_address, ip, IP6_MAX_STR_SIZE);
if (rpc->add(c, "{", &h) < 0) goto error;
- if (rpc->struct_add(h, "SSddd",
+ if (rpc->struct_add(h, "SSsddd",
"host", &cur->uri.host,
"port", &cur->uri.port,
+ "resolved_ip", ip,
"status", cur->status,
"last_notification", cur->last_notification,
"local", cur->local) < 0) goto error;