[asterisk-commits] mmichelson: branch group/issue8824 r144752 - /team/group/issue8824/channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Sep 26 15:57:10 CDT 2008


Author: mmichelson
Date: Fri Sep 26 15:57:09 2008
New Revision: 144752

URL: http://svn.digium.com/view/asterisk?view=rev&rev=144752
Log:
Use Asterisk's IP address as the host portion of the SIP
URI we send in a Diversion header.

I also removed an annoying NOTICE I had placed in the
add_diversion_header function


Modified:
    team/group/issue8824/channels/chan_sip.c

Modified: team/group/issue8824/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/group/issue8824/channels/chan_sip.c?view=diff&rev=144752&r1=144751&r2=144752
==============================================================================
--- team/group/issue8824/channels/chan_sip.c (original)
+++ team/group/issue8824/channels/chan_sip.c Fri Sep 26 15:57:09 2008
@@ -9138,15 +9138,14 @@
 	reason = sip_reason_code_to_str(pvt->owner->redirecting.reason);
 
 	if (ast_strlen_zero(diverting_number)) {
-		ast_log(LOG_NOTICE, "No diverting number??\n");
 		return;
 	}
 
 	/* We at least have a number to place in the Diversion header, which is enough */
 	if (ast_strlen_zero(diverting_name)) {
-		snprintf(header_text, sizeof(header_text), "<sip:%s@%s>;reason=\"%s\"", diverting_number, pvt->fromdomain, reason);
+		snprintf(header_text, sizeof(header_text), "<sip:%s@%s>;reason=\"%s\"", diverting_number, ast_inet_ntoa(pvt->ourip.sin_addr), reason);
 	} else {
-		snprintf(header_text, sizeof(header_text), "\"%s\" <sip:%s@%s>;reason=\"%s\"", diverting_name, diverting_number, pvt->fromdomain, reason);
+		snprintf(header_text, sizeof(header_text), "\"%s\" <sip:%s@%s>;reason=\"%s\"", diverting_name, diverting_number, ast_inet_ntoa(pvt->ourip.sin_addr), reason);
 	}
 
 	add_header(req, "Diversion", header_text);




More information about the asterisk-commits mailing list