[asterisk-commits] oej: branch oej/codename-pineapple r61673 - in /team/oej/codename-pineapple: ...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Apr 18 11:35:57 MST 2007


Author: oej
Date: Wed Apr 18 13:35:54 2007
New Revision: 61673

URL: http://svn.digium.com/view/asterisk?view=rev&rev=61673
Log:
Resetting automerge

Added:
    team/oej/codename-pineapple/apps/app_minivm.c
      - copied unchanged from r61671, trunk/apps/app_minivm.c
    team/oej/codename-pineapple/configs/extensions_minivm.conf.sample
      - copied unchanged from r61671, trunk/configs/extensions_minivm.conf.sample
    team/oej/codename-pineapple/configs/minivm.conf.sample
      - copied unchanged from r61671, trunk/configs/minivm.conf.sample
Modified:
    team/oej/codename-pineapple/   (props changed)
    team/oej/codename-pineapple/apps/app_dial.c
    team/oej/codename-pineapple/apps/app_speech_utils.c
    team/oej/codename-pineapple/apps/app_voicemail.c
    team/oej/codename-pineapple/channels/chan_oss.c
    team/oej/codename-pineapple/channels/chan_sip.c
    team/oej/codename-pineapple/include/asterisk/rtp.h
    team/oej/codename-pineapple/main/cdr.c
    team/oej/codename-pineapple/main/say.c

Propchange: team/oej/codename-pineapple/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/oej/codename-pineapple/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Apr 18 13:35:54 2007
@@ -1,1 +1,1 @@
-/trunk:1-61626
+/trunk:1-61672

Modified: team/oej/codename-pineapple/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/apps/app_dial.c?view=diff&rev=61673&r1=61672&r2=61673
==============================================================================
--- team/oej/codename-pineapple/apps/app_dial.c (original)
+++ team/oej/codename-pineapple/apps/app_dial.c Wed Apr 18 13:35:54 2007
@@ -92,7 +92,10 @@
 "ends the call.\n"
 "  The optional URL will be sent to the called party if the channel supports it.\n"
 "  If the OUTBOUND_GROUP variable is set, all peer channels created by this\n"
-"application will be put into that group (as in Set(GROUP()=...).\n\n"
+"application will be put into that group (as in Set(GROUP()=...).\n"
+"  If the OUTBOUND_GROUP_ONCE variable is set, all peer channels created by this\n"
+"application will be put into that group (as in Set(GROUP()=...). Unlike OUTBOUND_GROUP,\n"
+"however, the variable will be unset after use.\n\n"
 "  Options:\n"
 "    A(x) - Play an announcement to the called party, using 'x' as the file.\n"
 "    C    - Reset the CDR for this call.\n"
@@ -1274,10 +1277,15 @@
 
 	if (continue_exec)
 		*continue_exec = 0;
-
+	
 	/* If a channel group has been specified, get it for use when we create peer channels */
-	outbound_group = pbx_builtin_getvar_helper(chan, "OUTBOUND_GROUP");
-
+	if ((outbound_group = pbx_builtin_getvar_helper(chan, "OUTBOUND_GROUP_ONCE"))) {
+		outbound_group = ast_strdupa(outbound_group);
+		pbx_builtin_setvar_helper(chan, "OUTBOUND_GROUP_ONCE", NULL);
+	} else {
+		outbound_group = pbx_builtin_getvar_helper(chan, "OUTBOUND_GROUP");
+	}
+	    
 	ast_copy_flags(peerflags, &opts, OPT_DTMF_EXIT | OPT_GO_ON | OPT_ORIGINAL_CLID | OPT_CALLER_HANGUP | OPT_IGNORE_FORWARDING);
 	/* loop through the list of dial destinations */
 	rest = args.peers;

Modified: team/oej/codename-pineapple/apps/app_speech_utils.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/apps/app_speech_utils.c?view=diff&rev=61673&r1=61672&r2=61673
==============================================================================
--- team/oej/codename-pineapple/apps/app_speech_utils.c (original)
+++ team/oej/codename-pineapple/apps/app_speech_utils.c Wed Apr 18 13:35:54 2007
@@ -132,6 +132,9 @@
 	struct ast_speech_result *result = results;
 	char *tmp = NULL;
 	int nbest_num = 0, wanted_num = 0, i = 0;
+
+	if (!result)
+		return NULL;
 
 	if ((tmp = strchr(result_num, '/'))) {
 		*tmp++ = '\0';

Modified: team/oej/codename-pineapple/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/apps/app_voicemail.c?view=diff&rev=61673&r1=61672&r2=61673
==============================================================================
--- team/oej/codename-pineapple/apps/app_voicemail.c (original)
+++ team/oej/codename-pineapple/apps/app_voicemail.c Wed Apr 18 13:35:54 2007
@@ -1392,7 +1392,7 @@
 	void *fdm = MAP_FAILED;
 	size_t fdlen = -1;
 	SQLHSTMT stmt;
-	SQLINTEGER len;
+	SQLLEN len;
 	char sql[PATH_MAX];
 	char msgnums[20];
 	char fn[PATH_MAX];

Modified: team/oej/codename-pineapple/channels/chan_oss.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/channels/chan_oss.c?view=diff&rev=61673&r1=61672&r2=61673
==============================================================================
--- team/oej/codename-pineapple/channels/chan_oss.c (original)
+++ team/oej/codename-pineapple/channels/chan_oss.c Wed Apr 18 13:35:54 2007
@@ -1021,7 +1021,7 @@
 {
 	struct ast_channel *c;
 
-	c = ast_channel_alloc(1, state, o->cid_num, o->cid_name, "", o->ext, o->ctx, 0, "OSS/%s", o->device + 5);
+	c = ast_channel_alloc(1, state, o->cid_num, o->cid_name, "", ext, ctx, 0, "OSS/%s", o->device + 5);
 	if (c == NULL)
 		return NULL;
 	c->tech = &oss_tech;

Modified: team/oej/codename-pineapple/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/channels/chan_sip.c?view=diff&rev=61673&r1=61672&r2=61673
==============================================================================
--- team/oej/codename-pineapple/channels/chan_sip.c (original)
+++ team/oej/codename-pineapple/channels/chan_sip.c Wed Apr 18 13:35:54 2007
@@ -1399,6 +1399,7 @@
 static int sip_show_peer(int fd, int argc, char *argv[]);
 static int sip_show_user(int fd, int argc, char *argv[]);
 static int sip_show_registry(int fd, int argc, char *argv[]);
+static int sip_unregister(int fd, int argc, char *argv[]);
 static int sip_show_settings(int fd, int argc, char *argv[]);
 static const char *subscription_type2str(enum subscriptiontype subtype) attribute_pure;
 static const struct cfsubscription_types *find_subscription_type(enum subscriptiontype subtype);
@@ -4721,6 +4722,8 @@
 	for (p = dialoglist; p; p = p->next) {
 		/* In pedantic, we do not want packets with bad syntax to be connected to a PVT */
 		int found = FALSE;
+		if (ast_strlen_zero(p->callid))
+			continue;
 		if (req->method == SIP_REGISTER)
 			found = (!strcmp(p->callid, callid));
 		else 
@@ -6014,7 +6017,7 @@
 		snprintf(tmp, sizeof(tmp), "%d", p->expiry);
 		add_header(resp, "Expires", tmp);
 		if (p->expiry) {	/* Only add contact if we have an expiry time */
-			char contact[256];
+			char contact[BUFSIZ];
 			snprintf(contact, sizeof(contact), "%s;expires=%d", p->our_contact, p->expiry);
 			add_header(resp, "Contact", contact);	/* Not when we unregister */
 		}
@@ -7046,7 +7049,7 @@
 /*! \brief Check Contact: URI of SIP message */
 static void extract_uri(struct sip_pvt *p, struct sip_request *req)
 {
-	char stripped[256];
+	char stripped[BUFSIZ];
 	char *c;
 
 	ast_copy_string(stripped, get_header(req, "Contact"), sizeof(stripped));
@@ -8208,7 +8211,7 @@
 /*! \brief Save contact header for 200 OK on INVITE */
 static int parse_ok_contact(struct sip_pvt *pvt, struct sip_request *req)
 {
-	char contact[250]; 
+	char contact[BUFSIZ]; 
 	char *c;
 
 	/* Look for brackets */
@@ -10938,6 +10941,25 @@
 	return RESULT_SUCCESS;
 #undef FORMAT
 #undef FORMAT2
+}
+
+/*! \brief Unregister (force expiration) a SIP peer in the registry via CLI */
+static int sip_unregister(int fd, int argc, char *argv[])
+{
+	struct sip_peer *peer;
+	int load_realtime = 0;
+
+	if (argc != 3)
+		return RESULT_SHOWUSAGE;
+	
+	if ((peer = find_peer(argv[2], NULL, load_realtime))) {
+		expire_register(peer);
+		ast_cli(fd, "Unregistered peer \'%s\'\n\n", argv[2]);
+	} else {
+		ast_cli(fd, "Attempted to unregister an unknown peer \'%s\' via CLI\n", argv[2]);
+	}
+	
+	return 0;
 }
 
 /*! \brief List global settings for the SIP channel */
@@ -11940,6 +11962,10 @@
 "Usage: sip show registry\n"
 "       Lists all registration requests and status.\n";
 
+static const char sip_unregister_usage[] =
+"Usage: sip unregister <peer>\n"
+"       Unregister (force expiration) a SIP peer from the registry\n";
+
 static const char debug_usage[] = 
 "Usage: sip debug\n"
 "       Enables dumping of SIP packets for debugging purposes\n\n"
@@ -12238,7 +12264,7 @@
 /*! \brief Parse 302 Moved temporalily response */
 static void parse_moved_contact(struct sip_pvt *p, struct sip_request *req)
 {
-	char tmp[256];
+	char tmp[BUFSIZ];
 	char *s, *e;
 	char *domain;
 
@@ -18063,6 +18089,10 @@
 	sip_show_registry, "List SIP registration status",
 	show_reg_usage },
 
+	{ { "sip", "unregister", NULL },
+	sip_unregister, "Unregister (force expiration) a SIP peer from the registery\n",
+	sip_unregister_usage },
+
 	{ { "sip", "show", "settings", NULL },
 	sip_show_settings, "Show SIP global settings",
 	show_settings_usage },

Modified: team/oej/codename-pineapple/include/asterisk/rtp.h
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/include/asterisk/rtp.h?view=diff&rev=61673&r1=61672&r2=61673
==============================================================================
--- team/oej/codename-pineapple/include/asterisk/rtp.h (original)
+++ team/oej/codename-pineapple/include/asterisk/rtp.h Wed Apr 18 13:35:54 2007
@@ -84,16 +84,17 @@
 	AST_LIST_ENTRY(ast_rtp_protocol) list;
 };
 
+/*! \brief RTCP quality report storage */
 struct ast_rtp_quality {
-	unsigned int local_ssrc;          /* Our SSRC */
-	unsigned int local_lostpackets;   /* Our lost packets */
-	double       local_jitter;        /* Our calculated jitter */
-	unsigned int local_count;         /* Number of received packets */
-	unsigned int remote_ssrc;         /* Their SSRC */
-	unsigned int remote_lostpackets;  /* Their lost packets */
-	double       remote_jitter;       /* Their reported jitter */
-	unsigned int remote_count;        /* Number of transmitted packets */
-	double       rtt;                 /* Round trip time */
+	unsigned int local_ssrc;          /*!< Our SSRC */
+	unsigned int local_lostpackets;   /*!< Our lost packets */
+	double       local_jitter;        /*!< Our calculated jitter */
+	unsigned int local_count;         /*!< Number of received packets */
+	unsigned int remote_ssrc;         /*!< Their SSRC */
+	unsigned int remote_lostpackets;  /*!< Their lost packets */
+	double       remote_jitter;       /*!< Their reported jitter */
+	unsigned int remote_count;        /*!< Number of transmitted packets */
+	double       rtt;                 /*!< Round trip time */
 };
 
 /*! RTP callback structure */

Modified: team/oej/codename-pineapple/main/cdr.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/main/cdr.c?view=diff&rev=61673&r1=61672&r2=61673
==============================================================================
--- team/oej/codename-pineapple/main/cdr.c (original)
+++ team/oej/codename-pineapple/main/cdr.c Wed Apr 18 13:35:54 2007
@@ -512,6 +512,8 @@
 
 void ast_cdr_merge(struct ast_cdr *to, struct ast_cdr *from)
 {
+	struct ast_cdr *tcdr;
+	
 	if (!to || !from)
 		return;
 	
@@ -587,15 +589,15 @@
 		ast_copy_string(to->dst, from->dst, sizeof(to->dst));
 		from->dst[0] = 0; /* theft */
 	}
-	if (!to->amaflags && from->amaflags) {
+	if (ast_test_flag(from, AST_CDR_FLAG_LOCKED) || (!to->amaflags && from->amaflags)) {
 		to->amaflags = from->amaflags;
 		from->amaflags = 0; /* theft */
 	}
-	if (ast_strlen_zero(to->accountcode) && !ast_strlen_zero(from->accountcode)) {
+	if (ast_test_flag(from, AST_CDR_FLAG_LOCKED) || (ast_strlen_zero(to->accountcode) && !ast_strlen_zero(from->accountcode))) {
 		ast_copy_string(to->accountcode, from->accountcode, sizeof(to->accountcode));
 		from->accountcode[0] = 0; /* theft */
 	}
-	if (ast_strlen_zero(to->userfield) && !ast_strlen_zero(from->userfield)) {
+	if (ast_test_flag(from, AST_CDR_FLAG_LOCKED) || (ast_strlen_zero(to->userfield) && !ast_strlen_zero(from->userfield))) {
 		ast_copy_string(to->userfield, from->userfield, sizeof(to->userfield));
 		from->userfield[0] = 0; /* theft */
 	}
@@ -612,6 +614,16 @@
 		ast_set_flag(to, AST_CDR_FLAG_CHILD);
 	if (ast_test_flag(from, AST_CDR_FLAG_POST_DISABLED))
 		ast_set_flag(to, AST_CDR_FLAG_POST_DISABLED);
+
+	/* last, but not least, we need to merge any forked CDRs to the 'to' cdr */
+	while (from->next) {
+		/* just rip 'em off the 'from' and insert them on the 'to' */
+		tcdr = from->next;
+		from->next = tcdr->next;
+		tcdr->next = NULL;
+		/* tcdr is now ripped from the current list; */
+		ast_cdr_append(to, tcdr);
+	}
 }
 
 void ast_cdr_start(struct ast_cdr *cdr)
@@ -817,8 +829,9 @@
 
 	ast_string_field_set(chan, accountcode, account);
 	for ( ; cdr ; cdr = cdr->next) {
-		if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED))
+		if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
 			ast_copy_string(cdr->accountcode, chan->accountcode, sizeof(cdr->accountcode));
+		}
 	}
 	return 0;
 }

Modified: team/oej/codename-pineapple/main/say.c
URL: http://svn.digium.com/view/asterisk/team/oej/codename-pineapple/main/say.c?view=diff&rev=61673&r1=61672&r2=61673
==============================================================================
--- team/oej/codename-pineapple/main/say.c (original)
+++ team/oej/codename-pineapple/main/say.c Wed Apr 18 13:35:54 2007
@@ -1113,7 +1113,7 @@
 		} else if (num < 80) {
 			snprintf(fn, sizeof(fn), "digits/60");
 			if ((num % 10) == 1) playa++;
-			num = num - 60;
+			num -= 60;
 		} else if (num < 100) {
 			snprintf(fn, sizeof(fn), "digits/80");
 			num = num - 80;



More information about the asterisk-commits mailing list