[asterisk-commits] oej: branch oej/pinepacketrequest r219203 - in /team/oej/pinepacketrequest: ....

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Sep 17 10:49:15 CDT 2009


Author: oej
Date: Thu Sep 17 10:49:10 2009
New Revision: 219203

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=219203
Log:
Resolve conflict. Blame file.

Removed:
    team/oej/pinepacketrequest/contrib/firmware/iax/iaxy.bin
Modified:
    team/oej/pinepacketrequest/   (props changed)
    team/oej/pinepacketrequest/UPGRADE.txt
    team/oej/pinepacketrequest/apps/app_followme.c
    team/oej/pinepacketrequest/apps/app_voicemail.c
    team/oej/pinepacketrequest/channels/chan_dahdi.c
    team/oej/pinepacketrequest/channels/chan_sip.c
    team/oej/pinepacketrequest/main/pbx.c

Propchange: team/oej/pinepacketrequest/
------------------------------------------------------------------------------
    automerge = http://www.codename-pineapple.org/

Propchange: team/oej/pinepacketrequest/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

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

Modified: team/oej/pinepacketrequest/UPGRADE.txt
URL: http://svn.asterisk.org/svn-view/asterisk/team/oej/pinepacketrequest/UPGRADE.txt?view=diff&rev=219203&r1=219202&r2=219203
==============================================================================
--- team/oej/pinepacketrequest/UPGRADE.txt (original)
+++ team/oej/pinepacketrequest/UPGRADE.txt Thu Sep 17 10:49:10 2009
@@ -19,6 +19,12 @@
 ===========================================================
 
 From 1.6.2 to 1.6.3:
+
+* The firmware for the IAXy has been removed from Asterisk.  It can be
+  downloaded from http://downloads.digium.com/pub/iaxy/.  To have Asterisk
+  install the firmware into its proper location, place the firmware in the
+  contrib/firmware/iax/ directory in the Asterisk source tree before running
+  "make install".
 
 * There have been some changes to the IAX2 protocol to address the security
   concerns documented in the security advisory AST-2009-006.  Please see the

Modified: team/oej/pinepacketrequest/apps/app_followme.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/oej/pinepacketrequest/apps/app_followme.c?view=diff&rev=219203&r1=219202&r2=219203
==============================================================================
--- team/oej/pinepacketrequest/apps/app_followme.c (original)
+++ team/oej/pinepacketrequest/apps/app_followme.c Thu Sep 17 10:49:10 2009
@@ -835,6 +835,10 @@
 			if (outbound) {
 				ast_set_callerid(outbound, caller->cid.cid_num, caller->cid.cid_name, caller->cid.cid_num);
 				ast_channel_inherit_variables(tpargs->chan, outbound);
+				ast_channel_datastore_inherit(tpargs->chan, outbound);
+				ast_string_field_set(outbound, language, tpargs->chan->language);
+				ast_string_field_set(outbound, accountcode, tpargs->chan->accountcode);
+				ast_string_field_set(outbound, musicclass, tpargs->chan->musicclass);
 				ast_verb(3, "calling %s\n", dialarg);
 				if (!ast_call(outbound,dialarg,0)) {
 					tmpuser->ochan = outbound;

Modified: team/oej/pinepacketrequest/apps/app_voicemail.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/oej/pinepacketrequest/apps/app_voicemail.c?view=diff&rev=219203&r1=219202&r2=219203
==============================================================================
--- team/oej/pinepacketrequest/apps/app_voicemail.c (original)
+++ team/oej/pinepacketrequest/apps/app_voicemail.c Thu Sep 17 10:49:10 2009
@@ -1068,28 +1068,27 @@
  * \param vmu The voicemail user to change the password for.
  * \param password The new value to be set to the password for this user.
  * 
- * This only works if the voicemail user has a unique id, and if there is a realtime engine configured.
+ * This only works if there is a realtime engine configured.
  * This is called from the (top level) vm_change_password.
  *
  * \return zero on success, -1 on error.
  */
 static int change_password_realtime(struct ast_vm_user *vmu, const char *password)
 {
-	int res;
-	if (!ast_strlen_zero(vmu->uniqueid)) {
-		if (strlen(password) > 10) {
-			ast_realtime_require_field("voicemail", "password", RQ_CHAR, strlen(password), SENTINEL);
-		}
-		res = ast_update2_realtime("voicemail", "context", vmu->context, "mailbox", vmu->mailbox, SENTINEL, "password", password, SENTINEL);
-		if (res > 0) {
-			ast_copy_string(vmu->password, password, sizeof(vmu->password));
-			res = 0;
-		} else if (!res) {
-			res = -1;
-		}
-		return res;
-	}
-	return -1;
+	int res = -1;
+	if (!strcmp(vmu->password, password)) {
+		/* No change (but an update would return 0 rows updated, so we opt out here) */
+		return 0;
+	}
+
+	if (strlen(password) > 10) {
+		ast_realtime_require_field("voicemail", "password", RQ_CHAR, strlen(password), SENTINEL);
+	}
+	if (ast_update2_realtime("voicemail", "context", vmu->context, "mailbox", vmu->mailbox, SENTINEL, "password", password, SENTINEL) > 0) {
+		ast_copy_string(vmu->password, password, sizeof(vmu->password));
+		res = 0;
+	}
+	return res;
 }
 
 /*!

Modified: team/oej/pinepacketrequest/channels/chan_dahdi.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/oej/pinepacketrequest/channels/chan_dahdi.c?view=diff&rev=219203&r1=219202&r2=219203
==============================================================================
--- team/oej/pinepacketrequest/channels/chan_dahdi.c (original)
+++ team/oej/pinepacketrequest/channels/chan_dahdi.c Thu Sep 17 10:49:10 2009
@@ -9922,7 +9922,6 @@
 static struct dahdi_pvt *handle_init_event(struct dahdi_pvt *i, int event)
 {
 	int res;
-	int thread_spawned = 0;
 	pthread_t threadid;
 	struct ast_channel *chan;
 
@@ -9976,8 +9975,6 @@
 						if (res < 0)
 							ast_log(LOG_WARNING, "Unable to play congestion tone on channel %d\n", i->channel);
 						ast_hangup(chan);
-					} else {
-						thread_spawned = 1;
 					}
 				} else
 					ast_log(LOG_WARNING, "Unable to create channel\n");
@@ -10019,8 +10016,6 @@
 					ast_log(LOG_WARNING, "Unable to play congestion tone on channel %d\n", i->channel);
 				}
 				ast_hangup(chan);
-			} else {
-				thread_spawned = 1;
 			}
 			break;
 		default:
@@ -10109,8 +10104,6 @@
 					ast_log(LOG_WARNING, "Cannot allocate new structure on channel %d\n", i->channel);
 				} else if (ast_pthread_create_detached(&threadid, NULL, analog_ss_thread, chan)) {
 					ast_log(LOG_WARNING, "Unable to start simple switch thread on channel %d\n", i->channel);
-				} else {
-					thread_spawned = 1;
 				}
 			}
 			break;
@@ -10363,7 +10356,8 @@
 									struct ast_channel *chan;
 									ast_mutex_unlock(&iflock);
 									if (analog_lib_handles(i->sig, i->radio, i->oprmode)) {
-										analog_handle_init_event(i->sig_pvt, ANALOG_EVENT_DTMFCID);  
+										/* just in case this event changes or somehow destroys a channel, set doomed here too */
+										doomed = analog_handle_init_event(i->sig_pvt, ANALOG_EVENT_DTMFCID);  
 										i->dtmfcid_holdoff_state = 1;
 									} else {
 										chan = dahdi_new(i, AST_STATE_PRERING, 0, SUB_REAL, 0, 0, NULL);

Modified: team/oej/pinepacketrequest/channels/chan_sip.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/oej/pinepacketrequest/channels/chan_sip.c?view=diff&rev=219203&r1=219202&r2=219203
==============================================================================
--- team/oej/pinepacketrequest/channels/chan_sip.c (original)
+++ team/oej/pinepacketrequest/channels/chan_sip.c Thu Sep 17 10:49:10 2009
@@ -2981,12 +2981,13 @@
 		/* In order to know how much to read, we need the content-length header */
 		if (sscanf(get_header(&req, "Content-Length"), "%30d", &cl)) {
 			while (cl > 0) {
+				size_t bytes_read;
 				ast_mutex_lock(&tcptls_session->lock);
-				if (!fread(buf, MIN(sizeof(buf) - 1, cl), 1, tcptls_session->f)) {
+				if (!(bytes_read = fread(buf, 1, MIN(sizeof(buf) - 1, cl), tcptls_session->f))) {
 					ast_mutex_unlock(&tcptls_session->lock);
 					goto cleanup;
 				}
-				buf[sizeof(buf)-1] = '\0';
+				buf[bytes_read] = '\0';
 				ast_mutex_unlock(&tcptls_session->lock);
 				if (me->stop)
 					goto cleanup;
@@ -3224,7 +3225,7 @@
 static int port_str2int(const char *pt, unsigned int standard)
 {
 	int port = standard;
-	if (ast_strlen_zero(pt) || (sscanf(pt, "%30d", &port) != 1) || (port < 0)) {
+	if (ast_strlen_zero(pt) || (sscanf(pt, "%30d", &port) != 1) || (port < 1) || (port > 65535)) {
 		port = standard;
 	}
 
@@ -9402,7 +9403,7 @@
 		add_header(resp, "Expires", tmp);
 		if (p->expiry) {	/* Only add contact if we have an expiry time */
 			char contact[SIPBUFSIZE];
-			snprintf(contact, sizeof(contact), "%s;expires=%d", p->our_contact, p->expiry);
+			snprintf(contact, sizeof(contact), "%s;expires=%d", (p->method == SIP_SUBSCRIBE ? p->our_contact : p->fullcontact), p->expiry);
 			add_header(resp, "Contact", contact);	/* Not when we unregister */
 		}
 	} else if (!ast_strlen_zero(p->our_contact) && resp_needs_contact(msg, p->method)) {
@@ -13256,11 +13257,13 @@
 						res = 0;
 						break;
 					case PARSE_REGISTER_QUERY:
+						ast_string_field_set(p, fullcontact, peer->fullcontact);
 						transmit_response_with_date(p, 200, "200 OK", req);
 						peer->lastmsgssent = -1;
 						res = 0;
 						break;
 					case PARSE_REGISTER_UPDATE:
+						ast_string_field_set(p, fullcontact, peer->fullcontact);
 						update_peer(peer, p->expiry);
 						/* Say OK and ask subsystem to retransmit msg counter */
 						transmit_response_with_date(p, 200, "200 OK", req);
@@ -13294,11 +13297,13 @@
 				res = 0;
 				break;
 			case PARSE_REGISTER_QUERY:
+				ast_string_field_set(p, fullcontact, peer->fullcontact);
 				transmit_response_with_date(p, 200, "200 OK", req);
 				peer->lastmsgssent = -1;
 				res = 0;
 				break;
 			case PARSE_REGISTER_UPDATE:
+				ast_string_field_set(p, fullcontact, peer->fullcontact);
 				/* Say OK and ask subsystem to retransmit msg counter */
 				transmit_response_with_date(p, 200, "200 OK", req);
 				manager_event(EVENT_FLAG_SYSTEM, "PeerStatus", "ChannelType: SIP\r\nPeer: SIP/%s\r\nPeerStatus: Registered\r\nAddress: %s\r\nPort: %d\r\n", peer->name, ast_inet_ntoa(sin->sin_addr), ntohs(sin->sin_port));
@@ -18775,7 +18780,6 @@
 	struct ast_channel *owner;
 	int sipmethod;
 	int res = 1;
-	int ack_res;
 	const char *c = get_header(req, "Cseq");
 	/* GCC 4.2 complains if I try to cast c as a char * when passing it to ast_skip_nonblanks, so make a copy of it */
 	char *c_copy = ast_strdupa(c);
@@ -18797,16 +18801,20 @@
 		pbx_builtin_setvar_helper(owner, causevar, causeval);
 	}
 
-	/* Acknowledge whatever it is destined for */
-	if ((resp >= 100) && (resp <= 199)) {
-		ack_res = __sip_semi_ack(p, seqno, 0, sipmethod);
-	} else {
-		ack_res = __sip_ack(p, seqno, 0, sipmethod);
-	}
-
-	if (ack_res == FALSE) {
-		append_history(p, "Ignore", "Ignoring this retransmit\n");
-		return;
+	if (p->socket.type == SIP_TRANSPORT_UDP) {
+		int ack_res;
+
+		/* Acknowledge whatever it is destined for */
+		if ((resp >= 100) && (resp <= 199)) {
+			ack_res = __sip_semi_ack(p, seqno, 0, sipmethod);
+		} else {
+			ack_res = __sip_ack(p, seqno, 0, sipmethod);
+		}
+
+		if (ack_res == FALSE) {
+			append_history(p, "Ignore", "Ignoring this retransmit\n");
+			return;
+		}
 	}
 
 	/* If this is a NOTIFY for a subscription clear the flag that indicates that we have a NOTIFY pending */

Modified: team/oej/pinepacketrequest/main/pbx.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/oej/pinepacketrequest/main/pbx.c?view=diff&rev=219203&r1=219202&r2=219203
==============================================================================
--- team/oej/pinepacketrequest/main/pbx.c (original)
+++ team/oej/pinepacketrequest/main/pbx.c Thu Sep 17 10:49:10 2009
@@ -8025,7 +8025,7 @@
 			else if (e->matchcid && !tmp->matchcid)
 				res = -1;
 			else
-				res = strcasecmp(e->cidmatch, tmp->cidmatch);
+				res = ext_cmp(e->cidmatch, tmp->cidmatch);
 		}
 		if (res >= 0)
 			break;




More information about the asterisk-commits mailing list