[asterisk-commits] russell: branch bbryant/sip-tcptls r73765 - /team/bbryant/sip-tcptls/channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jul 6 15:57:57 CDT 2007


Author: russell
Date: Fri Jul  6 15:57:56 2007
New Revision: 73765

URL: http://svn.digium.com/view/asterisk?view=rev&rev=73765
Log:
make get_transport an inline function instead of a macro

Modified:
    team/bbryant/sip-tcptls/channels/chan_sip.c

Modified: team/bbryant/sip-tcptls/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/bbryant/sip-tcptls/channels/chan_sip.c?view=diff&rev=73765&r1=73764&r2=73765
==============================================================================
--- team/bbryant/sip-tcptls/channels/chan_sip.c (original)
+++ team/bbryant/sip-tcptls/channels/chan_sip.c Fri Jul  6 15:57:56 2007
@@ -1306,7 +1306,6 @@
 static int sip_senddigit_begin(struct ast_channel *ast, char digit);
 static int sip_senddigit_end(struct ast_channel *ast, char digit, unsigned int duration);
 
-#define get_transport(t) ( ( t & SIP_TRANSPORT_UDP ) ? "UDP" : ( t & SIP_TRANSPORT_TCP ) ? "TCP" : "TLS" )
 static int handle_request_do(struct sip_request *req, struct sockaddr_in *sin);
 static int sip_standard_port(struct sip_socket s);
 static void sip_prepare_socket(struct sip_pvt *p);
@@ -2088,6 +2087,19 @@
 	return res;
 }
 
+static inline const char *get_transport(enum sip_transport t)
+{
+	switch (t) {
+	case SIP_TRANSPORT_UDP:
+		return "UDP";
+	case SIP_TRANSPORT_TCP:
+		return "TCP";
+	case SIP_TRANSPORT_TLS:
+		return "TLS";
+	}
+
+	return "UNKNOWN";
+}
 
 /*! \brief Build a Via header for a request */
 static void build_via(struct sip_pvt *p)




More information about the asterisk-commits mailing list