[asterisk-commits] oej: branch oej/invitestate r47594 - in /team/oej/invitestate: ./ apps/ cdr/ ...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Nov 14 03:42:09 MST 2006


Author: oej
Date: Tue Nov 14 04:42:08 2006
New Revision: 47594

URL: http://svn.digium.com/view/asterisk?view=rev&rev=47594
Log:
Reset branch

Modified:
    team/oej/invitestate/   (props changed)
    team/oej/invitestate/apps/app_sms.c
    team/oej/invitestate/cdr/cdr_pgsql.c
    team/oej/invitestate/channels/chan_sip.c
    team/oej/invitestate/channels/chan_zap.c
    team/oej/invitestate/res/res_odbc.c

Propchange: team/oej/invitestate/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Nov 14 04:42:08 2006
@@ -1,1 +1,1 @@
-/branches/1.2:1-47514
+/branches/1.2:1-47590

Modified: team/oej/invitestate/apps/app_sms.c
URL: http://svn.digium.com/view/asterisk/team/oej/invitestate/apps/app_sms.c?view=diff&rev=47594&r1=47593&r2=47594
==============================================================================
--- team/oej/invitestate/apps/app_sms.c (original)
+++ team/oej/invitestate/apps/app_sms.c Tue Nov 14 04:42:08 2006
@@ -1050,7 +1050,7 @@
 		unsigned char p = 2;
 		h->omsg[0] = 0x91;		  /* SMS_DATA */
 		if (h->smsc) {			 /* deliver */
-			h->omsg[p++] = (more ? 4 : 0);
+			h->omsg[p++] = (more ? 4 : 0) + ((h->udhl > 0) ? 0x40 : 0);
 			p += packaddress (h->omsg + p, h->oa);
 			h->omsg[p++] = h->pid;
 			h->omsg[p++] = h->dcs;

Modified: team/oej/invitestate/cdr/cdr_pgsql.c
URL: http://svn.digium.com/view/asterisk/team/oej/invitestate/cdr/cdr_pgsql.c?view=diff&rev=47594&r1=47593&r2=47594
==============================================================================
--- team/oej/invitestate/cdr/cdr_pgsql.c (original)
+++ team/oej/invitestate/cdr/cdr_pgsql.c Tue Nov 14 04:42:08 2006
@@ -64,8 +64,8 @@
 
 AST_MUTEX_DEFINE_STATIC(pgsql_lock);
 
-PGconn		*conn;
-PGresult	*result;
+PGconn		*conn = NULL;
+PGresult	*result = NULL;
 
 static int pgsql_log(struct ast_cdr *cdr)
 {

Modified: team/oej/invitestate/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/invitestate/channels/chan_sip.c?view=diff&rev=47594&r1=47593&r2=47594
==============================================================================
--- team/oej/invitestate/channels/chan_sip.c (original)
+++ team/oej/invitestate/channels/chan_sip.c Tue Nov 14 04:42:08 2006
@@ -8154,7 +8154,7 @@
 		print_group(fd, peer->pickupgroup, 0);
 		ast_cli(fd, "  Mailbox      : %s\n", peer->mailbox);
 		ast_cli(fd, "  VM Extension : %s\n", peer->vmexten);
-		ast_cli(fd, "  LastMsgsSent : %d\n", peer->lastmsgssent);
+		ast_cli(fd, "  LastMsgsSent : %d/%d\n", (peer->lastmsgssent & 0x7fff0000) >> 16, peer->lastmsgssent & 0xffff);
 		ast_cli(fd, "  Call limit   : %d\n", peer->call_limit);
 		ast_cli(fd, "  Dynamic      : %s\n", (ast_test_flag(&peer->flags_page2, SIP_PAGE2_DYNAMIC)?"Yes":"No"));
 		ast_cli(fd, "  Callerid     : %s\n", ast_callerid_merge(cbuf, sizeof(cbuf), peer->cid_name, peer->cid_num, "<unspecified>"));
@@ -10872,7 +10872,8 @@
 	struct ast_channel *bridged_to;
 	char iabuf[INET_ADDRSTRLEN];
 	
-	if (p->pendinginvite && !ast_test_flag(p, SIP_OUTGOING) && !ignore) {
+	/* If we have an INCOMING invite that we haven't answered, terminate that transaction */
+	if (p->pendinginvite && !ast_test_flag(p, SIP_OUTGOING) && !ignore && !p->owner) {
 		p->invitestate = INV_TERMINATED;
 		transmit_response_reliable(p, "487 Request Terminated", &p->initreq, 1);
 	}
@@ -11490,7 +11491,7 @@
 	time(&peer->lastmsgcheck);
 	
 	/* Return now if it's the same thing we told them last time */
-	if (((newmsgs << 8) | (oldmsgs)) == peer->lastmsgssent) {
+	if (((newmsgs > 0x7fff ? 0x7fff0000 : (newmsgs << 16)) | (oldmsgs > 0xffff ? 0xffff : oldmsgs)) == peer->lastmsgssent) {
 		return 0;
 	}
 	
@@ -11499,7 +11500,7 @@
 		ast_log(LOG_WARNING, "Unable to build sip pvt data for MWI\n");
 		return -1;
 	}
-	peer->lastmsgssent = ((newmsgs << 8) | (oldmsgs));
+	peer->lastmsgssent = ((newmsgs > 0x7fff ? 0x7fff0000 : (newmsgs << 16)) | (oldmsgs > 0xffff ? 0xffff : oldmsgs));
 	if (create_addr_from_peer(p, peer)) {
 		/* Maybe they're not registered, etc. */
 		sip_destroy(p);

Modified: team/oej/invitestate/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/oej/invitestate/channels/chan_zap.c?view=diff&rev=47594&r1=47593&r2=47594
==============================================================================
--- team/oej/invitestate/channels/chan_zap.c (original)
+++ team/oej/invitestate/channels/chan_zap.c Tue Nov 14 04:42:08 2006
@@ -6268,7 +6268,9 @@
 		case SIG_FXOLS:
 		case SIG_FXOGS:
 		case SIG_FXOKS:
-		        zt_set_hook(i->subs[SUB_REAL].zfd, ZT_OFFHOOK);
+			res = zt_set_hook(i->subs[SUB_REAL].zfd, ZT_OFFHOOK);
+			if (res && (errno == EBUSY))
+				break;
 			if (i->cidspill) {
 				/* Cancel VMWI spill */
 				free(i->cidspill);

Modified: team/oej/invitestate/res/res_odbc.c
URL: http://svn.digium.com/view/asterisk/team/oej/invitestate/res/res_odbc.c?view=diff&rev=47594&r1=47593&r2=47594
==============================================================================
--- team/oej/invitestate/res/res_odbc.c (original)
+++ team/oej/invitestate/res/res_odbc.c Tue Nov 14 04:42:08 2006
@@ -140,6 +140,7 @@
 
 				ast_log(LOG_WARNING, "SQL Execute error %d! Attempting a reconnect...\n", res);
 				SQLFreeHandle(SQL_HANDLE_STMT, stmt);
+				stmt = NULL;
 
 				ast_mutex_lock(&obj->lock);
 				obj->up = 0;



More information about the asterisk-commits mailing list