aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2007-02-14 15:27:49 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2007-02-14 15:27:49 +0000
commit554875989e2a6554a9eceb623845e250232ce86e (patch)
tree4ecf372e6e237c553ce60839edbb6c34f9105d10
parent81d103d2633029bfe1e5e83dfdc05722b2f62f0d (diff)
Add port number to SIPPEER dialplan function
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@54348 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--channels/chan_sip.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index d4713f488..92b4da339 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -11696,6 +11696,8 @@ static int function_sippeer(struct ast_channel *chan, const char *cmd, char *dat
if (!strcasecmp(colname, "ip")) {
ast_copy_string(buf, peer->addr.sin_addr.s_addr ? ast_inet_ntoa(peer->addr.sin_addr) : "", len);
+ } else if (!strcasecmp(colname, "port")) {
+ snprintf(buf, len, "%d", ntohs(peer->addr.sin_port));
} else if (!strcasecmp(colname, "status")) {
peer_status(peer, buf, len);
} else if (!strcasecmp(colname, "language")) {
@@ -11749,6 +11751,7 @@ struct ast_custom_function sippeer_function = {
.read = function_sippeer,
.desc = "Valid items are:\n"
"- ip (default) The IP address.\n"
+ "- port The port number\n"
"- mailbox The configured mailbox.\n"
"- context The configured context.\n"
"- expire The epoch time of the next expire.\n"