[asterisk-commits] rizzo: branch rizzo/astobj2 r47767 - /team/rizzo/astobj2/channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Nov 16 14:42:09 MST 2006


Author: rizzo
Date: Thu Nov 16 15:42:08 2006
New Revision: 47767

URL: http://svn.digium.com/view/asterisk?view=rev&rev=47767
Log:

print the real address in "sip show channels" for natted peers.

trunk candidate.


Modified:
    team/rizzo/astobj2/channels/chan_sip.c

Modified: team/rizzo/astobj2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/astobj2/channels/chan_sip.c?view=diff&rev=47767&r1=47766&r2=47767
==============================================================================
--- team/rizzo/astobj2/channels/chan_sip.c (original)
+++ team/rizzo/astobj2/channels/chan_sip.c Thu Nov 16 15:42:08 2006
@@ -10736,12 +10736,13 @@
 {
 	struct sip_pvt *cur = __cur;
 	struct __show_chan_arg *arg = __arg;
+	const struct sockaddr_in *dst = sip_real_dst(cur);
 
 	if (cur->subscribed == NONE && !arg->subscriptions) {
 		/* set if SIP transfer in progress */
 		const char *referstatus = cur->refer ? referstatus2str(cur->refer->status) : "";
 
-		ast_cli(arg->fd, FORMAT, ast_inet_ntoa(cur->sa.sin_addr), 
+		ast_cli(arg->fd, FORMAT, ast_inet_ntoa(dst->sin_addr), 
 			S_OR(cur->username, S_OR(cur->cid_num, "(None)")),
 			cur->callid, 
 			cur->ocseq, cur->icseq, 
@@ -10754,7 +10755,7 @@
 		arg->numchans++;
 	}
 	if (cur->subscribed != NONE && arg->subscriptions) {
-		ast_cli(arg->fd, FORMAT3, ast_inet_ntoa(cur->sa.sin_addr),
+		ast_cli(arg->fd, FORMAT3, ast_inet_ntoa(dst->sin_addr),
 			S_OR(cur->username, S_OR(cur->cid_num, "(None)")), 
 			cur->callid,
 			/* the 'complete' exten/context is hidden in the refer_to field for subscriptions */



More information about the asterisk-commits mailing list