[svn-commits] oej: branch group/pine-cdr-pgsql-status-trunk r288486 - in /team/group/pine-c...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Sep 22 13:57:14 CDT 2010


Author: oej
Date: Wed Sep 22 13:57:07 2010
New Revision: 288486

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=288486
Log:
Wonderful Oppurtunity - never heard of before!
==============================================

Review this branch - and you'll get the chance to win a 
FREE license of Asterisk - the leading Open Source PBX! 
If you do it before the end of the month, I'll throw in 
a FREE license of Kamailio -the super duper SIP server - 
as well!!!

https://reviewboard.asterisk.org/r/923/

Thank you for your attention. This offer is only valid within
Sweden until Oct 1 2010 for people who like Abba and are not
employees of Edvina AB or it's partners. You are only allowed
to do one review per person and will only get one ticket to
win the free license per individual. Reviewbots will not
be allowed to participate in this competition. The Swedish
requirement does not apply to people working in Huntsville, AL, USA
and Vence, France, EU. You may review in Swedish, English or
any dialect understood in the northern forestes of Orsa.

Modified:
    team/group/pine-cdr-pgsql-status-trunk/   (props changed)
    team/group/pine-cdr-pgsql-status-trunk/cdr/cdr_pgsql.c
    team/group/pine-cdr-pgsql-status-trunk/channels/chan_sip.c
    team/group/pine-cdr-pgsql-status-trunk/configs/cdr_pgsql.conf.sample
    team/group/pine-cdr-pgsql-status-trunk/main/asterisk.c

Propchange: team/group/pine-cdr-pgsql-status-trunk/
------------------------------------------------------------------------------
    automerge = http://www.codename-pineapple.org/

Propchange: team/group/pine-cdr-pgsql-status-trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Propchange: team/group/pine-cdr-pgsql-status-trunk/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Sep 22 13:57:07 2010
@@ -1,1 +1,1 @@
-/trunk:1-288207
+/trunk:1-288485

Modified: team/group/pine-cdr-pgsql-status-trunk/cdr/cdr_pgsql.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pine-cdr-pgsql-status-trunk/cdr/cdr_pgsql.c?view=diff&rev=288486&r1=288485&r2=288486
==============================================================================
--- team/group/pine-cdr-pgsql-status-trunk/cdr/cdr_pgsql.c (original)
+++ team/group/pine-cdr-pgsql-status-trunk/cdr/cdr_pgsql.c Wed Sep 22 13:57:07 2010
@@ -53,7 +53,7 @@
 
 static const char name[] = "pgsql";
 static const char config[] = "cdr_pgsql.conf";
-static char *pghostname = NULL, *pgdbname = NULL, *pgdbuser = NULL, *pgpassword = NULL, *pgdbport = NULL, *table = NULL;
+static char *pghostname = NULL, *pgdbname = NULL, *pgdbuser = NULL, *pgpassword = NULL, *pgdbport = NULL, *table = NULL, *encoding = NULL;
 static int connected = 0;
 static int maxsize = 512, maxsize2 = 512;
 static time_t connect_time = 0;
@@ -176,6 +176,9 @@
 			connected = 1;
 			connect_time = time(NULL);
 			records = 0;
+			if (PQsetClientEncoding(conn, encoding)) {
+				ast_log(LOG_WARNING, "Failed to set encoding to '%s'.  Encoding set to default '%s'\n", encoding, pg_encoding_to_char(PQclientEncoding(conn)));
+			}
 		} else {
 			pgerror = PQerrorMessage(conn);
 			ast_log(LOG_ERROR, "Unable to connect to database server %s.  Calls will not be logged!\n", pghostname);
@@ -528,6 +531,19 @@
 		return -1;
 	}
 
+	if (!(tmp = ast_variable_retrieve(cfg, "global", "encoding"))) {
+		ast_log(LOG_WARNING, "Encoding not specified.  Assuming LATIN9\n");
+		tmp = "LATIN9";
+	}
+
+	if (encoding) {
+		ast_free(encoding);
+	}
+	if (!(encoding = ast_strdup(tmp))) {
+		ast_config_destroy(cfg);
+		return -1;
+	}
+
 	if (option_debug) {
 		if (ast_strlen_zero(pghostname)) {
 			ast_debug(1, "using default unix socket\n");
@@ -548,6 +564,9 @@
 		int i, rows, version;
 		ast_debug(1, "Successfully connected to PostgreSQL database.\n");
 		connected = 1;
+		if (PQsetClientEncoding(conn, encoding)) {
+			ast_log(LOG_WARNING, "Failed to set encoding to '%s'.  Encoding set to default '%s'\n", encoding, pg_encoding_to_char(PQclientEncoding(conn)));
+		}
 		version = PQserverVersion(conn);
 
 		if (version >= 70300) {

Modified: team/group/pine-cdr-pgsql-status-trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pine-cdr-pgsql-status-trunk/channels/chan_sip.c?view=diff&rev=288486&r1=288485&r2=288486
==============================================================================
--- team/group/pine-cdr-pgsql-status-trunk/channels/chan_sip.c (original)
+++ team/group/pine-cdr-pgsql-status-trunk/channels/chan_sip.c Wed Sep 22 13:57:07 2010
@@ -18610,11 +18610,12 @@
 {
 	if (ast_test_flag(&p->flags[0], SIP_PENDINGBYE)) {
 		/* if we can't BYE, then this is really a pending CANCEL */
-		if (p->invitestate == INV_PROCEEDING || p->invitestate == INV_EARLY_MEDIA)
+		if (p->invitestate == INV_PROCEEDING || p->invitestate == INV_EARLY_MEDIA) {
+			p->invitestate = INV_CANCELLED;
 			transmit_request(p, SIP_CANCEL, p->lastinvite, XMIT_RELIABLE, FALSE);
 			/* Actually don't destroy us yet, wait for the 487 on our original
 			   INVITE, but do set an autodestruct just in case we never get it. */
-		else {
+		} else {
 			/* We have a pending outbound invite, don't send something
 				new in-transaction */
 			if (p->pendinginvite)
@@ -23594,7 +23595,7 @@
 		}  else {
 			ast_debug(1, "Ignoring too old SIP packet packet %d (expecting >= %d)\n", seqno, p->icseq);
 			if (req->method != SIP_ACK)
-				transmit_response(p, "503 Server error", req);	/* We must respond according to RFC 3261 sec 12.2 */
+				transmit_response(p, "500 Server error", req);	/* We must respond according to RFC 3261 sec 12.2 */
 			return -1;
 		}
 	} else if (p->icseq &&

Modified: team/group/pine-cdr-pgsql-status-trunk/configs/cdr_pgsql.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/group/pine-cdr-pgsql-status-trunk/configs/cdr_pgsql.conf.sample?view=diff&rev=288486&r1=288485&r2=288486
==============================================================================
--- team/group/pine-cdr-pgsql-status-trunk/configs/cdr_pgsql.conf.sample (original)
+++ team/group/pine-cdr-pgsql-status-trunk/configs/cdr_pgsql.conf.sample Wed Sep 22 13:57:07 2010
@@ -11,3 +11,4 @@
 ;password=password
 ;user=postgres
 ;table=cdr		;SQL table where CDRs will be inserted
+;encoding=LATIN9	; Encoding of logged characters in Asterisk

Modified: team/group/pine-cdr-pgsql-status-trunk/main/asterisk.c
URL: http://svnview.digium.com/svn/asterisk/team/group/pine-cdr-pgsql-status-trunk/main/asterisk.c?view=diff&rev=288486&r1=288485&r2=288486
==============================================================================
--- team/group/pine-cdr-pgsql-status-trunk/main/asterisk.c (original)
+++ team/group/pine-cdr-pgsql-status-trunk/main/asterisk.c Wed Sep 22 13:57:07 2010
@@ -2943,7 +2943,7 @@
 			ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_QUIET);
 		/* Run as console (-c at startup, implies nofork) */
 		} else if (!strcasecmp(v->name, "console")) {
-			ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_CONSOLE);
+			ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_NO_FORK | AST_OPT_FLAG_CONSOLE);
 		/* Run with high priority if the O/S permits (-p at startup) */
 		} else if (!strcasecmp(v->name, "highpriority")) {
 			ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_HIGH_PRIORITY);




More information about the svn-commits mailing list