[asterisk-commits] oej: branch oej/midcomstuff r48024 - /team/oej/midcomstuff/channels/chan_sip.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sun Nov 26 10:33:37 MST 2006


Author: oej
Date: Sun Nov 26 11:33:37 2006
New Revision: 48024

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

Modified:
    team/oej/midcomstuff/channels/chan_sip.c

Modified: team/oej/midcomstuff/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/midcomstuff/channels/chan_sip.c?view=diff&rev=48024&r1=48023&r2=48024
==============================================================================
--- team/oej/midcomstuff/channels/chan_sip.c (original)
+++ team/oej/midcomstuff/channels/chan_sip.c Sun Nov 26 11:33:37 2006
@@ -1,3 +1,4 @@
+#define SIP_MIDCOM
 /*
  * Asterisk -- An open source telephony toolkit.
  *
@@ -1639,7 +1640,8 @@
 
 static int sip_get_flag_novideo(void *p)
 {
-	return ast_test_flag((struct sip_pvt*)p, SIP_NOVIDEO);
+	struct sip_pvt *dialog = (struct sip_pvt *) p;
+	return ast_test_flag(&dialog->flags[0], SIP_NOVIDEO);
 }
 
 static int sip_cmp_sa_addr(void *p, struct sockaddr_in *addr)
@@ -1669,13 +1671,15 @@
 
 static int sip_get_capability_helper(void *p)
 {
-	return ((struct sip_pvt*)p)->jointcapability;
+	struct sip_pvt *dialog = (struct sip_pvt *) p;
+	return (dialog->jointcapability);
 }
 
 static void sip_softhangup_helper(void *p)
 {
-	if (p && ((struct sip_pvt *)p)->owner)
-		ast_softhangup(((struct sip_pvt *)p)->owner, AST_SOFTHANGUP_APPUNLOAD);
+	struct sip_pvt *dialog = (struct sip_pvt *) p;
+	if (dialog && (dialog->owner))
+		ast_softhangup(dialog->owner, AST_SOFTHANGUP_APPUNLOAD);
 }
 #endif
 
@@ -3349,7 +3353,7 @@
 #ifdef SIP_MIDCOM
         /* For callee to shutdown, send "BYE" instead of "CANCEL"
            -- this needs to be verified */
-        if (m_cb && ast_test_flag(p, SIP_OUTGOING)) 
+        if (m_cb && ast_test_flag(&p->flags[0], SIP_OUTGOING)) 
 		needcancel = 0;
 #endif
 
@@ -6020,11 +6024,10 @@
 #ifdef SIP_MIDCOM
 		if (m_cb && p->r) {
 			struct sockaddr_in redirip_hook;
-			char iabuf2[INET_ADDRSTRLEN];
 
 			m_cb->ast_get_redirip_audio_hook(p->r, &redirip_hook);
 			if (option_debug)
-				ast_log(LOG_DEBUG, "MIDCOM: Replacing %s:%d by %s:%d in SDP before sending to %s\n", ast_inet_ntoa(iabuf, sizeof(iabuf), p->redirip.sin_addr), ntohs(p->redirip.sin_port), ast_inet_ntoa(iabuf2, sizeof(iabuf2), redirip_hook.sin_addr), ntohs(redirip_hook.sin_port), p->username);
+				ast_log(LOG_DEBUG, "MIDCOM: Replacing %s:%d by %s:%d in SDP before sending to %s\n", ast_inet_ntoa(p->redirip.sin_addr), ntohs(p->redirip.sin_port), ast_inet_ntoa(redirip_hook.sin_addr), ntohs(redirip_hook.sin_port), p->username);
 			dest.sin_port = redirip_hook.sin_port;
 			dest.sin_addr = redirip_hook.sin_addr;
 		} else {
@@ -6076,11 +6079,10 @@
 #ifdef SIP_MIDCOM
 			if (m_cb && p->r) {
 				struct sockaddr_in vredirip_hook;
-				char iabuf2[INET_ADDRSTRLEN];
 
 				m_cb->ast_get_vredirip_video_hook(p->r, &vredirip_hook);
 				if (option_debug)
-					ast_log(LOG_DEBUG, "Replacing %s:%d by %s:%d in video SDP before sending to %s\n", ast_inet_ntoa(iabuf, sizeof(iabuf), p->vredirip.sin_addr), ntohs(p->vredirip.sin_port), ast_inet_ntoa(iabuf2, sizeof(iabuf2), vredirip_hook.sin_addr), ntohs(vredirip_hook.sin_port), p->username);
+					ast_log(LOG_DEBUG, "Replacing %s:%d by %s:%d in video SDP before sending to %s\n", ast_inet_ntoa(p->vredirip.sin_addr), ntohs(p->vredirip.sin_port), ast_inet_ntoa(vredirip_hook.sin_addr), ntohs(vredirip_hook.sin_port), p->username);
 				vdest.sin_port = vredirip_hook.sin_port;
 				vdest.sin_addr = vredirip_hook.sin_addr;
 		  	} else {
@@ -6384,7 +6386,7 @@
 			if (p->owner)
 				ast_queue_hangup(p->owner);
 			else
-				ast_set_flag(p, SIP_NEEDDESTROY);
+				ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
 		}
 	}
 #endif
@@ -11566,7 +11568,7 @@
 					if (p->owner)
 						ast_queue_hangup(p->owner);
 					else
-						ast_set_flag(p, SIP_NEEDDESTROY);
+						ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
 				}
 			}
 #endif
@@ -13094,11 +13096,8 @@
 				if (m_cb) {
 					if (!m_cb->handle_request_invite_hook((void *)p)) {
 						ast_log(LOG_NOTICE, "Failed to NAT for (%s)\n", get_header(req, "From"));
-						if (ignore)
-							transmit_response(p, "403 Forbidden", req);
-						else
-							transmit_response_reliable(p, "403 Forbidden", req, 1);
-						ast_set_flag(p, SIP_NEEDDESTROY);
+						transmit_response_reliable(p, "403 Forbidden", req);
+						ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
 						return 0;
 					}
 				}



More information about the asterisk-commits mailing list