summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlle Johansson <oej@edvina.net>2007-02-14 15:27:49 +0000
committerOlle Johansson <oej@edvina.net>2007-02-14 15:27:49 +0000
commit0653be0c33fc07f2066274c56171306b9125ca9d (patch)
tree4ecf372e6e237c553ce60839edbb6c34f9105d10
parentbc7e4c2ef2c63b5e2042c8eff87314fa58ecf823 (diff)
Add port number to SIPPEER dialplan function
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@54348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-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"