[asterisk-commits] twilson: branch group/srtp r182406 - in /team/group/srtp: apps/ channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Mar 16 18:59:08 CDT 2009


Author: twilson
Date: Mon Mar 16 18:59:04 2009
New Revision: 182406

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=182406
Log:
Address mmichelsons review

Modified:
    team/group/srtp/apps/app_dial.c
    team/group/srtp/channels/chan_sip.c
    team/group/srtp/channels/sdp_crypto.c
    team/group/srtp/channels/sip_srtp.c

Modified: team/group/srtp/apps/app_dial.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/srtp/apps/app_dial.c?view=diff&rev=182406&r1=182405&r2=182406
==============================================================================
--- team/group/srtp/apps/app_dial.c (original)
+++ team/group/srtp/apps/app_dial.c Mon Mar 16 18:59:04 2009
@@ -1512,7 +1512,8 @@
 {
 	struct prompt_data one, two;
 	pthread_t thread1 = AST_PTHREADT_NULL, thread2 = AST_PTHREADT_NULL;
-	int *ret, res;
+	int res;
+	void *ret = &res;
 
 	one.chan = chan;
 	two.chan = peer;
@@ -1521,10 +1522,10 @@
 
 	ast_pthread_create(&thread1, NULL, play_prompts_cb, &one);
 	ast_pthread_create(&thread2, NULL, play_prompts_cb, &two);
-	pthread_join(thread1, (void **)&ret);
-	res = *ret;
-	pthread_join(thread2, (void **)&ret);
-	res |= *ret;
+	pthread_join(thread1, ret);
+	res = *(int *)ret;
+	pthread_join(thread2, ret);
+	res |= *(int *)ret;
 
 	return res;
 }
@@ -2037,7 +2038,7 @@
 							ast_set_flag64(peerflags, OPT_GO_ON);
 					}
 				} else if (!strncasecmp(macro_result, "PLAY_CALLER:", 12) && (prompt1 = ast_strdupa(macro_result + 12))) {
-					ast_answer(chan); /* Macro has completed, so peer has answered */
+					__ast_answer(chan, 0, 0); /* Macro has completed, so peer has answered */
 					ast_stream_and_wait(chan, prompt1, "");
 				} else if (!strncasecmp(macro_result, "PLAY_BOTH:", 10) && (prompt1 = ast_strdupa(macro_result + 10))) {
 					char *prompt2 = prompt1;
@@ -2047,7 +2048,7 @@
 						prompt2 = prompt1;
 					}
 
-					ast_answer(chan);
+					__ast_answer(chan, 0, 0);
 
 					ast_channel_unlock(peer);
 					if (play_prompts(chan, peer, prompt1, prompt2)) {

Modified: team/group/srtp/channels/chan_sip.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/srtp/channels/chan_sip.c?view=diff&rev=182406&r1=182405&r2=182406
==============================================================================
--- team/group/srtp/channels/chan_sip.c (original)
+++ team/group/srtp/channels/chan_sip.c Mon Mar 16 18:59:04 2009
@@ -7417,6 +7417,7 @@
 	int newnoncodeccapability;
 	int numberofmediastreams = 0;
 	int debug = sip_debug_test_pvt(p);
+
 	int secure_audio = FALSE;
 	int secure_video = FALSE;
 
@@ -19945,20 +19946,6 @@
 	}
 }
 
-static const char* transport_to_str(enum sip_transport type)
-{
-	switch(type) {
-	case SIP_TRANSPORT_UDP :
-		return "udp";
-	case SIP_TRANSPORT_TCP :
-		return "tcp";
-	case SIP_TRANSPORT_TLS :
-		return "tls";
-	default :
-		return "unknown";
-	}
-}
-
 static int acf_channel_read(struct ast_channel *chan, const char *funcname, char *preparse, char *buf, size_t buflen)
 {
 	struct sip_pvt *p = chan->tech_pvt;
@@ -20061,7 +20048,7 @@
 	} else if (!strcasecmp(args.param, "secure_media")) {
 		snprintf(buf, buflen, "%d", p->srtp ? 1 : 0);
 	} else if (!strcasecmp(args.param, "transport")) {
-		ast_copy_string(buf, transport_to_str(p->socket.type), buflen);
+		ast_copy_string(buf, get_transport(p->socket.type), buflen);
 	} else {
 		res = -1;
 	}

Modified: team/group/srtp/channels/sdp_crypto.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/srtp/channels/sdp_crypto.c?view=diff&rev=182406&r1=182405&r2=182406
==============================================================================
--- team/group/srtp/channels/sdp_crypto.c (original)
+++ team/group/srtp/channels/sdp_crypto.c Mon Mar 16 18:59:04 2009
@@ -34,8 +34,8 @@
 
 #define SRTP_MASTER_LEN 30
 #define SRTP_MASTERKEY_LEN 16
-#define SRTP_MASTERSALT_LEN (SRTP_MASTER_LEN - SRTP_MASTERKEY_LEN)
-#define SRTP_MASTER_LEN64 ((SRTP_MASTER_LEN * 8 + 5) / 6 + 1)
+#define SRTP_MASTERSALT_LEN ((SRTP_MASTER_LEN) - (SRTP_MASTERKEY_LEN))
+#define SRTP_MASTER_LEN64 (((SRTP_MASTER_LEN) * 8 + 5) / 6 + 1)
 
 struct sdp_crypto {
 	char *a_crypto;

Modified: team/group/srtp/channels/sip_srtp.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/srtp/channels/sip_srtp.c?view=diff&rev=182406&r1=182405&r2=182406
==============================================================================
--- team/group/srtp/channels/sip_srtp.c (original)
+++ team/group/srtp/channels/sip_srtp.c Mon Mar 16 18:59:04 2009
@@ -48,4 +48,5 @@
 		sdp_crypto_destroy(srtp->crypto);
 	}
 	srtp->crypto = NULL;
+	ast_free(srtp);
 }




More information about the asterisk-commits mailing list