Index: apps/app_privacy.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_privacy.c,v
retrieving revision 1.8
diff -u -r1.8 app_privacy.c
--- apps/app_privacy.c	12 Dec 2004 01:24:35 -0000	1.8
+++ apps/app_privacy.c	8 Jan 2005 18:34:33 -0000
@@ -69,7 +69,7 @@
 	struct ast_config *cfg;
 
 	LOCAL_USER_ADD (u);
-	if (chan->cid.cid_num)
+	if (strlen(chan->cid.cid_num) > 1)
 	{
 		if (option_verbose > 2)
 			ast_verbose (VERBOSE_PREFIX_3 "CallerID Present: Skipping\n");
Index: cdr/Makefile
===================================================================
RCS file: /usr/cvsroot/asterisk/cdr/Makefile,v
retrieving revision 1.26
diff -u -r1.26 Makefile
--- cdr/Makefile	31 Aug 2004 16:33:00 -0000	1.26
+++ cdr/Makefile	8 Jan 2005 18:34:33 -0000
@@ -12,7 +12,7 @@
 #
 
 #ADD cdr_pgsql.so to MODS= to include PostgreSQL support: REQUIRES PostgreSQL libs
-MODS=cdr_csv.so cdr_manager.so
+MODS=cdr_csv.so cdr_manager.so cdr_pgsql.so
 
 
 CFLAGS+=-fPIC
Index: cdr/cdr_pgsql.c
===================================================================
RCS file: /usr/cvsroot/asterisk/cdr/cdr_pgsql.c,v
retrieving revision 1.13
diff -u -r1.13 cdr_pgsql.c
--- cdr/cdr_pgsql.c	12 Dec 2004 23:34:24 -0000	1.13
+++ cdr/cdr_pgsql.c	8 Jan 2005 18:34:33 -0000
@@ -19,6 +19,7 @@
 #include <asterisk/options.h>
 #include <asterisk/channel.h>
 #include <asterisk/cdr.h>
+#include <asterisk/lock.h>
 #include <asterisk/module.h>
 #include <asterisk/logger.h>
 #include "../asterisk.h"
Index: channels/chan_skinny.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_skinny.c,v
retrieving revision 1.60
diff -u -r1.60 chan_skinny.c
--- channels/chan_skinny.c	19 Dec 2004 21:13:41 -0000	1.60
+++ channels/chan_skinny.c	8 Jan 2005 18:34:34 -0000
@@ -256,6 +256,8 @@
 	char text[40];
 } displaytext_message;
 
+#define CLEAR_DISPLAY_MESSAGE 0x009A
+
 #define	REGISTER_REJ_MESSAGE 0x009D
 typedef struct register_rej_message {
 	char errMsg[33];
@@ -934,6 +936,33 @@
 	transmit_response(s, req);
 }
 
+static void transmit_displaymessage(struct skinnysession *s, char *text)
+{
+	skinny_req *req;
+
+	if (text == 0){
+		req = req_alloc(4);
+		req->len = 4;
+		req->e = CLEAR_DISPLAY_MESSAGE;
+	}else{
+		req = req_alloc(sizeof(struct displaytext_message));
+
+		/*XXX Is using 39 here legal? */
+		strncpy(req->data.displaytext.text,text,39);
+		req->len = sizeof(displaytext_message)+4;
+		req->e = DISPLAYTEXT_MESSAGE;
+		if (skinnydebug) {
+			ast_verbose("Displaying message '%s'\n",req->data.displaytext.text);
+		}
+	}
+
+	if (!req) {
+		ast_log(LOG_ERROR, "Unable to allocate skinny_request, this is bad\n");
+		return;
+	}
+	transmit_response(s, req);
+}
+
 /* I do not believe skinny can deal with video. 
    Anyone know differently? */
 static struct ast_rtp *skinny_get_vrtp_peer(struct ast_channel *chan)
@@ -1508,6 +1537,7 @@
 
 	transmit_lamp_indication(session, l->instance, SKINNY_LAMP_BLINK);
 	transmit_ringer_mode(session, SKINNY_RING_INSIDE);
+	transmit_displaymessage(session, ast->cid.cid_num);
 	transmit_tone(session, tone);
 	transmit_callstate(session, l->instance, SKINNY_RINGIN, sub->callid);
 
@@ -1551,12 +1581,22 @@
 	if ((sub->parent->type = TYPE_LINE) && (sub->parent->hookstate == SKINNY_OFFHOOK)) {
 			sub->parent->hookstate = SKINNY_ONHOOK;
 			transmit_callstate(s, l->instance, SKINNY_ONHOOK, sub->callid);
+			transmit_lamp_indication(s, l->instance, SKINNY_LAMP_OFF);
+			if (skinnydebug) {
+				ast_verbose("Attempting to Clear display on Skinny %s@%s\n",sub->parent->name, sub->parent->parent->name);
+			}
+			transmit_displaymessage(s, 0); /* clear display */
 			transmit_speaker_mode(s, SKINNY_SPEAKEROFF); 
 		} else if ((sub->parent->type = TYPE_LINE) && (sub->parent->hookstate == SKINNY_ONHOOK)) {
 			transmit_callstate(s, l->instance, SKINNY_ONHOOK, sub->callid);
 			transmit_speaker_mode(s, SKINNY_SPEAKEROFF); 
 			transmit_ringer_mode(s, SKINNY_RING_OFF);
 			transmit_tone(s, SKINNY_SILENCE);
+			transmit_lamp_indication(s, l->instance, SKINNY_LAMP_OFF);
+			if (skinnydebug) {
+				ast_verbose("Attempting to Clear display on Skinny %s@%s\n",sub->parent->name, sub->parent->parent->name);
+			}
+			transmit_displaymessage(s, 0); /* clear display */
 		} 
     }
     ast_mutex_lock(&sub->lock);
@@ -1715,14 +1755,17 @@
     	}
 	switch(ind) {
 	case AST_CONTROL_RINGING:
-		if (ast->_state == AST_STATE_RINGING) {
+		ast_verbose(VERBOSE_PREFIX_3 "State AST_CONTROL_RINGING\n");
+		// if (ast->_state == AST_STATE_RINGING) {
+		ast_verbose(VERBOSE_PREFIX_3 "State AST_STATE_RINGING\n");
 			if (!sub->progress) {		
 				transmit_tone(s, SKINNY_ALERT);
 				transmit_callstate(s, l->instance, SKINNY_RINGOUT, sub->callid);
 				sub->ringing = 1;
+				ast_verbose(VERBOSE_PREFIX_3 "Started Ringing\n");
 				break;
 			}
-		}
+		// }
 		return -1;
 	case AST_CONTROL_BUSY:
 		if (ast->_state != AST_STATE_UP) {		
@@ -2181,6 +2224,13 @@
                            sub->parent->name, sub->parent->parent->name, sub->callid);
            }
        	}
+
+	if (skinnydebug) {
+		ast_verbose("Attempting to Clear display on Skinny %s@%s\n",sub->parent->name, sub->parent->parent->name);
+	}
+	
+	transmit_displaymessage(s, 0); /* clear display */
+
 
        	if ((sub->parent->hookstate == SKINNY_ONHOOK) && (!sub->next->rtp)) {
 	    if (has_voicemail(sub->parent)) {
