[svn-commits] murf: branch murf/field r39050 - in /team/murf/field: ./ apps/ channels/ conf...

svn-commits at lists.digium.com svn-commits at lists.digium.com
Sat Aug 5 21:13:43 MST 2006


Author: murf
Date: Sat Aug  5 23:13:43 2006
New Revision: 39050

URL: http://svn.digium.com/view/asterisk?rev=39050&view=rev
Log:
Merged revisions 38823,38826,38853,38871,38887,38905,38929,38951,38973,38994,39014,39032 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r38823 | tilghman | 2006-08-03 13:05:06 -0600 (Thu, 03 Aug 2006) | 2 lines

Update documentation on realtime; add a workaround for lack of realtime hints by using func_odbc

................
r38826 | file | 2006-08-03 13:55:05 -0600 (Thu, 03 Aug 2006) | 10 lines

Merged revisions 38825 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r38825 | file | 2006-08-03 15:54:02 -0400 (Thu, 03 Aug 2006) | 2 lines

Treat the file as invalid if we have no valid formats for it (issue #7643 reported by KNK)

........

................
r38853 | file | 2006-08-04 12:40:47 -0600 (Fri, 04 Aug 2006) | 2 lines

Don't assume that a referred by URI will always exist (issue #7641 reported and fixed by AuPix)

................
r38871 | file | 2006-08-04 17:17:40 -0600 (Fri, 04 Aug 2006) | 2 lines

Minor optimization but use a linkedlists.h macro that pops the head off the list instead of getting the first entry and then removing it.

................
r38887 | file | 2006-08-04 18:13:44 -0600 (Fri, 04 Aug 2006) | 2 lines

It is better to hold a lock then not hold a lock when you are supposed to.

................
r38905 | russell | 2006-08-04 23:26:29 -0600 (Fri, 04 Aug 2006) | 23 lines

Merged revisions 38903-38904 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r38903 | russell | 2006-08-05 01:07:39 -0400 (Sat, 05 Aug 2006) | 2 lines

suppress a compiler warning about the usage of a potentially uninitialized variable

........
r38904 | russell | 2006-08-05 01:08:50 -0400 (Sat, 05 Aug 2006) | 10 lines

Fix an issue that would cause a NewCallerID manager event to be generated
before the channel's NewChannel event.  This was due to a somewhat recent
change that included using ast_set_callerid() where it wasn't before.  This
function should not be used in the channel driver "new" functions.
(issue #7654, fixed by me)

Also, fix a couple minor bugs in usecount handling.  chan_iax2 could have
increased the usecount but then returned an error.  The place where chan_sip
increased the usecount did not call ast_update_usecount()

........

................
r38929 | russell | 2006-08-05 00:39:43 -0600 (Sat, 05 Aug 2006) | 11 lines

Merged revisions 38928 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r38928 | russell | 2006-08-05 02:37:59 -0400 (Sat, 05 Aug 2006) | 3 lines

make sure the priv-callerintros directory exists before trying to create a file
there (issue #7659, patch by hads, with some modifications by me)

........

................
r38951 | russell | 2006-08-05 01:22:27 -0600 (Sat, 05 Aug 2006) | 11 lines

Merged revisions 38950 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r38950 | russell | 2006-08-05 03:21:12 -0400 (Sat, 05 Aug 2006) | 3 lines

don't advertise that this function can set a SIP header when it can only
do reads

........

................
r38973 | russell | 2006-08-05 02:10:20 -0600 (Sat, 05 Aug 2006) | 11 lines

Merged revisions 38972 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r38972 | russell | 2006-08-05 04:08:48 -0400 (Sat, 05 Aug 2006) | 3 lines

remove duplicate queue log entry when the caller exits on a timeout
(issue #7616, ppyy)

........

................
r38994 | russell | 2006-08-05 03:03:27 -0600 (Sat, 05 Aug 2006) | 14 lines

Merged revisions 38982 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r38982 | russell | 2006-08-05 05:01:37 -0400 (Sat, 05 Aug 2006) | 6 lines

Always generate a Newstate event in ast_setstate() instead of making it a
Newchannel event if the state was AST_STATE_DOWN.  The Newchannel event will
always be generated in ast_request(), so this just causes a duplicated
Newchannel event in some cases.  
(issue #7506, repoted by capouch, fixed by me)

........

................
r39014 | russell | 2006-08-05 05:25:36 -0600 (Sat, 05 Aug 2006) | 3 lines

suppress a compiler warning about the usage of a potentially uninitialized
variable

................
r39032 | russell | 2006-08-05 14:58:47 -0600 (Sat, 05 Aug 2006) | 5 lines

- add DIALING_OFFHOOK and PRERING to ast_state2str
- don't include a newline character when building a response for an unknown
  state
(issue #7645, jonty)

................

Modified:
    team/murf/field/   (props changed)
    team/murf/field/apps/app_chanspy.c
    team/murf/field/apps/app_dial.c
    team/murf/field/apps/app_queue.c
    team/murf/field/channel.c
    team/murf/field/channels/chan_h323.c
    team/murf/field/channels/chan_iax2.c
    team/murf/field/channels/chan_mgcp.c
    team/murf/field/channels/chan_misdn.c
    team/murf/field/channels/chan_phone.c
    team/murf/field/channels/chan_sip.c
    team/murf/field/channels/chan_skinny.c
    team/murf/field/channels/chan_zap.c
    team/murf/field/configs/func_odbc.conf.sample
    team/murf/field/doc/realtime.txt
    team/murf/field/res/res_musiconhold.c

Propchange: team/murf/field/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/murf/field/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sat Aug  5 23:13:43 2006
@@ -1,1 +1,1 @@
-/trunk:1-38818
+/trunk:1-39049

Modified: team/murf/field/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/team/murf/field/apps/app_chanspy.c?rev=39050&r1=39049&r2=39050&view=diff
==============================================================================
--- team/murf/field/apps/app_chanspy.c (original)
+++ team/murf/field/apps/app_chanspy.c Sat Aug  5 23:13:43 2006
@@ -260,7 +260,7 @@
 		       const struct ast_flags *flags) 
 {
 	struct chanspy_translation_helper csth;
-	int running, res, x = 0;
+	int running = 0, res, x = 0;
 	char inp[24] = {0};
 	char *name;
 	struct ast_frame *f;

Modified: team/murf/field/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/murf/field/apps/app_dial.c?rev=39050&r1=39049&r2=39050&view=diff
==============================================================================
--- team/murf/field/apps/app_dial.c (original)
+++ team/murf/field/apps/app_dial.c Sat Aug  5 23:13:43 2006
@@ -37,6 +37,7 @@
 #include <stdio.h>
 #include <sys/time.h>
 #include <sys/signal.h>
+#include <sys/stat.h>
 #include <netinet/in.h>
 
 #include "asterisk/lock.h"
@@ -1001,7 +1002,13 @@
 			   unless it is already there-- this should be done before the 
 			   call is actually dialed  */
 
-			/* make sure the priv-callerintros dir exists? */
+			/* make sure the priv-callerintros dir actually exists */
+			snprintf(privintro, sizeof(privintro), "%s/sounds/priv-callerintros", ast_config_AST_DATA_DIR);
+			if (mkdir(privintro, 0755) && errno != EEXIST) {
+				ast_log(LOG_WARNING, "privacy: can't create directory priv-callerintros: %s\n", strerror(errno));
+				res = -1;
+				goto out;
+			}
 
 			snprintf(privintro,sizeof(privintro), "priv-callerintros/%s", privcid);
 			if( ast_fileexists(privintro,NULL,NULL ) > 0 && strncmp(privcid,"NOCALLERID",10) != 0) {

Modified: team/murf/field/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/murf/field/apps/app_queue.c?rev=39050&r1=39049&r2=39050&view=diff
==============================================================================
--- team/murf/field/apps/app_queue.c (original)
+++ team/murf/field/apps/app_queue.c Sat Aug  5 23:13:43 2006
@@ -2135,7 +2135,6 @@
 		/* If we have timed out, break out */
 		if (qe->expire && (time(NULL) > qe->expire)) {
 			*reason = QUEUE_TIMEOUT;
-			ast_queue_log(qe->parent->name, qe->chan->uniqueid,"NONE", "EXITWITHTIMEOUT", "%d", qe->pos);
 			break;
 		}
 

Modified: team/murf/field/channel.c
URL: http://svn.digium.com/view/asterisk/team/murf/field/channel.c?rev=39050&r1=39049&r2=39050&view=diff
==============================================================================
--- team/murf/field/channel.c (original)
+++ team/murf/field/channel.c Sat Aug  5 23:13:43 2006
@@ -527,6 +527,10 @@
 		return "Up";
 	case AST_STATE_BUSY:
 		return "Busy";
+	case AST_STATE_DIALING_OFFHOOK:
+		return "Dialing Offhook";
+	case AST_STATE_PRERING:
+		return "Pre-ring";
 	default:
 		pthread_once(&state2str_buf_once, state2str_buf_key_create);
 		if (!(buf = pthread_getspecific(state2str_buf_key))) {
@@ -534,7 +538,7 @@
 				return NULL;
 			pthread_setspecific(state2str_buf_key, buf);
 		}
-		snprintf(buf, STATE2STR_BUFSIZE, "Unknown (%d)\n", state);
+		snprintf(buf, STATE2STR_BUFSIZE, "Unknown (%d)", state);
 		return buf;
 	}
 }
@@ -3357,8 +3361,7 @@
 
 	chan->_state = state;
 	ast_device_state_changed_literal(chan->name);
-	manager_event(EVENT_FLAG_CALL,
-		      (oldstate == AST_STATE_DOWN) ? "Newchannel" : "Newstate",
+	manager_event(EVENT_FLAG_CALL, "Newstate",
 		      "Channel: %s\r\n"
 		      "State: %s\r\n"
 		      "CallerID: %s\r\n"
@@ -3625,7 +3628,7 @@
 	}
 
 	for (/* ever */;;) {
-		struct timeval now;
+		struct timeval now = { 0, };
 		int to;
 
 		to = -1;

Modified: team/murf/field/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/team/murf/field/channels/chan_h323.c?rev=39050&r1=39049&r2=39050&view=diff
==============================================================================
--- team/murf/field/channels/chan_h323.c (original)
+++ team/murf/field/channels/chan_h323.c Sat Aug  5 23:13:43 2006
@@ -796,18 +796,19 @@
 		if (pvt->amaflags) {
 			ch->amaflags = pvt->amaflags;
 		}
-		/*
-		 * If cid_num and cd.call_source_e164 are both null, then
-		 * ast_set_callerid will do the right thing and leave the
-		 * cid_num and cid_ani for the channel alone.
-		 */
-		ast_set_callerid(ch,
-			!ast_strlen_zero(pvt->cid_num) ? pvt->cid_num : pvt->cd.call_source_e164,
-			!ast_strlen_zero(pvt->cid_name) ? pvt->cid_name : pvt->cd.call_source_name,
-			!ast_strlen_zero(pvt->cid_num) ? pvt->cid_num : pvt->cd.call_source_e164);
-		if (!ast_strlen_zero(pvt->rdnis)) {
-			ch->cid.cid_rdnis = strdup(pvt->rdnis);
-		}
+		
+		/* Don't use ast_set_callerid() here because it will
+		 * generate a NewCallerID event before the NewChannel event */
+		if (!ast_strlen_zero(pvt->cid_num)) {
+			ch->cid.cid_num = ast_strdup(pvt->cid_num);
+			ch->cid.cid_ani = ast_strdup(pvt->cid_num);
+		} else {
+			ch->cid.cid_num = ast_strdup(pvt->cd.call_source_e164);
+			ch->cid.cid_ani = ast_strdup(pvt->cd.call_source_e164);
+		}
+		ch->cid.cid_name = ast_strdup(pvt->cid_name);
+		ch->cid.cid_rdnis = ast_strdup(pvt->rdnis);
+		
 		if (!ast_strlen_zero(pvt->exten) && strcmp(pvt->exten, "s")) {
 			ch->cid.cid_dnid = strdup(pvt->exten);
 		}

Modified: team/murf/field/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/murf/field/channels/chan_iax2.c?rev=39050&r1=39049&r2=39050&view=diff
==============================================================================
--- team/murf/field/channels/chan_iax2.c (original)
+++ team/murf/field/channels/chan_iax2.c Sat Aug  5 23:13:43 2006
@@ -839,12 +839,9 @@
 {
 	struct iax2_thread *thread = NULL;
 
-	/* Find free idle thread in the list, get a pointer to it, and remove it from the list */
+	/* Pop the head of the list off */
 	AST_LIST_LOCK(&idle_list);
-	thread = AST_LIST_FIRST(&idle_list);
-	if (thread != NULL) {
-		AST_LIST_REMOVE(&idle_list, thread, list);
-	}
+	thread = AST_LIST_REMOVE_HEAD(&idle_list, list);
 	AST_LIST_UNLOCK(&idle_list);
 
 	/* If no idle thread is available from the regular list, try dynamic */
@@ -910,7 +907,7 @@
 static void __send_ping(void *data)
 {
 	int callno = (long)data;
-	send_command(iaxs[callno], AST_FRAME_IAX, IAX_COMMAND_PING, 0, NULL, 0, -1);
+	send_command_locked(callno, AST_FRAME_IAX, IAX_COMMAND_PING, 0, NULL, 0, -1);
 }
 
 static int send_ping(void *data)
@@ -943,7 +940,7 @@
 {
 	int callno = (long)data;
 	/* Ping only if it's real not if it's bridged */
-	send_command(iaxs[callno], AST_FRAME_IAX, IAX_COMMAND_LAGRQ, 0, NULL, 0, -1);
+	send_command_locked(callno, AST_FRAME_IAX, IAX_COMMAND_LAGRQ, 0, NULL, 0, -1);
 }
 
 static int send_lagrq(void *data)
@@ -3281,16 +3278,21 @@
 	tmp->writeformat = ast_best_codec(capability);
 	tmp->tech_pvt = CALLNO_TO_PTR(i->callno);
 
-	ast_set_callerid(tmp, i->cid_num, i->cid_name, S_OR(i->ani, i->cid_num));
-	if (!ast_strlen_zero(i->language))
-		ast_string_field_set(tmp, language, i->language);
-	if (!ast_strlen_zero(i->dnid))
-		tmp->cid.cid_dnid = ast_strdup(i->dnid);
-	if (!ast_strlen_zero(i->rdnis))
-		tmp->cid.cid_rdnis = ast_strdup(i->rdnis);
+	/* Don't use ast_set_callerid() here because it will
+	 * generate a NewCallerID event before the NewChannel event */
+	tmp->cid.cid_num = ast_strdup(i->cid_num);
+	tmp->cid.cid_name = ast_strdup(i->cid_name);
+	if (!ast_strlen_zero(i->ani))
+		tmp->cid.cid_ani = ast_strdup(i->ani);
+	else
+		tmp->cid.cid_ani = ast_strdup(i->cid_num);
+	tmp->cid.cid_dnid = ast_strdup(i->dnid);
+	tmp->cid.cid_rdnis = ast_strdup(i->rdnis);
 	tmp->cid.cid_pres = i->calling_pres;
 	tmp->cid.cid_ton = i->calling_ton;
 	tmp->cid.cid_tns = i->calling_tns;
+	if (!ast_strlen_zero(i->language))
+		ast_string_field_set(tmp, language, i->language);
 	if (!ast_strlen_zero(i->accountcode))
 		ast_string_field_set(tmp, accountcode, i->accountcode);
 	if (i->amaflags)

Modified: team/murf/field/channels/chan_mgcp.c
URL: http://svn.digium.com/view/asterisk/team/murf/field/channels/chan_mgcp.c?rev=39050&r1=39049&r2=39050&view=diff
==============================================================================
--- team/murf/field/channels/chan_mgcp.c (original)
+++ team/murf/field/channels/chan_mgcp.c Sat Aug  5 23:13:43 2006
@@ -1415,7 +1415,13 @@
 		ast_string_field_set(tmp, call_forward, i->call_forward);
 		ast_copy_string(tmp->context, i->context, sizeof(tmp->context));
 		ast_copy_string(tmp->exten, i->exten, sizeof(tmp->exten));
-		ast_set_callerid(tmp, i->cid_num, i->cid_name, i->cid_num);
+
+		/* Don't use ast_set_callerid() here because it will
+		 * generate a NewCallerID event before the NewChannel event */
+		tmp->cid.cid_num = ast_strdup(i->cid_num);
+		tmp->cid.cid_ani = ast_strdup(i->cid_num);
+		tmp->cid.cid_name = ast_strdup(i->cid_name);
+		
 		if (!i->adsi)
 			tmp->adsicpe = AST_ADSI_UNAVAILABLE;
 		tmp->priority = 1;

Modified: team/murf/field/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/murf/field/channels/chan_misdn.c?rev=39050&r1=39049&r2=39050&view=diff
==============================================================================
--- team/murf/field/channels/chan_misdn.c (original)
+++ team/murf/field/channels/chan_misdn.c Sat Aug  5 23:13:43 2006
@@ -3099,9 +3099,11 @@
 			char *cid_name, *cid_num;
       
 			ast_callerid_parse(callerid, &cid_name, &cid_num);
-			ast_set_callerid(tmp, cid_num,cid_name,cid_num);
-		} else {
-			ast_set_callerid(tmp, NULL,NULL,NULL);
+			/* Don't use ast_set_callerid() here because it will
+			 * generate a NewCallerID event before the NewChannel event */
+			tmp->cid.cid_num = ast_strdup(cid_num);
+			tmp->cid.cid_ani = ast_strdup(cid_num);
+			tmp->cid.cid_name = ast_strdup(cid_name);
 		}
 
 		{

Modified: team/murf/field/channels/chan_phone.c
URL: http://svn.digium.com/view/asterisk/team/murf/field/channels/chan_phone.c?rev=39050&r1=39049&r2=39050&view=diff
==============================================================================
--- team/murf/field/channels/chan_phone.c (original)
+++ team/murf/field/channels/chan_phone.c Sat Aug  5 23:13:43 2006
@@ -864,7 +864,13 @@
 			strncpy(tmp->exten, "s",  sizeof(tmp->exten) - 1);
 		if (!ast_strlen_zero(i->language))
 			ast_string_field_set(tmp, language, i->language);
-		ast_set_callerid(tmp, i->cid_num, i->cid_name, i->cid_num);
+
+		/* Don't use ast_set_callerid() here because it will
+		 * generate a NewCallerID event before the NewChannel event */
+		tmp->cid.cid_num = ast_strdup(i->cid_num);
+		tmp->cid.cid_ani = ast_strdup(i->cid_num);
+		tmp->cid.cid_name = ast_strdup(i->cid_name);
+
 		i->owner = tmp;
 		ast_mutex_lock(&usecnt_lock);
 		usecnt++;

Modified: team/murf/field/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/murf/field/channels/chan_sip.c?rev=39050&r1=39049&r2=39050&view=diff
==============================================================================
--- team/murf/field/channels/chan_sip.c (original)
+++ team/murf/field/channels/chan_sip.c Sat Aug  5 23:13:43 2006
@@ -3682,11 +3682,17 @@
 	ast_update_use_count();
 	ast_copy_string(tmp->context, i->context, sizeof(tmp->context));
 	ast_copy_string(tmp->exten, i->exten, sizeof(tmp->exten));
-	ast_set_callerid(tmp, i->cid_num, i->cid_name, i->cid_num);
-	if (!ast_strlen_zero(i->rdnis))
-		tmp->cid.cid_rdnis = ast_strdup(i->rdnis);
+
+	/* Don't use ast_set_callerid() here because it will
+	 * generate a NewCallerID event before the NewChannel event */
+	tmp->cid.cid_num = ast_strdup(i->cid_num);
+	tmp->cid.cid_ani = ast_strdup(i->cid_num);
+	tmp->cid.cid_name = ast_strdup(i->cid_name);
+	tmp->cid.cid_rdnis = ast_strdup(i->rdnis);
+	
 	if (!ast_strlen_zero(i->exten) && strcmp(i->exten, "s"))
 		tmp->cid.cid_dnid = ast_strdup(i->exten);
+
 	tmp->priority = 1;
 	if (!ast_strlen_zero(i->uri))
 		pbx_builtin_setvar_helper(tmp, "SIPURI", i->uri);
@@ -8306,9 +8312,13 @@
 		*ptr = '\0';
 	ast_copy_string(referdata->refer_to, refer_to, sizeof(referdata->refer_to));
 	
-	if ((ptr = strchr(referred_by_uri, ';'))) 	/* Remove options */
-		*ptr = '\0';
-	ast_copy_string(referdata->referred_by, referred_by_uri, sizeof(referdata->referred_by));
+	if (referred_by_uri) {
+		if ((ptr = strchr(referred_by_uri, ';'))) 	/* Remove options */
+			*ptr = '\0';
+		ast_copy_string(referdata->referred_by, referred_by_uri, sizeof(referdata->referred_by));
+	} else {
+		referdata->referred_by[0] = '\0';
+	}
 
 	/* Determine transfer context */
 	if (transferer->owner)	/* Mimic behaviour in res_features.c */
@@ -10880,7 +10890,7 @@
 
 static struct ast_custom_function sip_header_function = {
 	.name = "SIP_HEADER",
-	.synopsis = "Gets or sets the specified SIP header",
+	.synopsis = "Gets the specified SIP header",
 	.syntax = "SIP_HEADER(<name>)",
 	.read = func_header_read,
 };

Modified: team/murf/field/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/team/murf/field/channels/chan_skinny.c?rev=39050&r1=39049&r2=39050&view=diff
==============================================================================
--- team/murf/field/channels/chan_skinny.c (original)
+++ team/murf/field/channels/chan_skinny.c Sat Aug  5 23:13:43 2006
@@ -2582,7 +2582,13 @@
 		ast_string_field_set(tmp, call_forward, l->call_forward);
 		ast_copy_string(tmp->context, l->context, sizeof(tmp->context));
 		ast_copy_string(tmp->exten, l->exten, sizeof(tmp->exten));
-		ast_set_callerid(tmp, l->cid_num, l->cid_name, l->cid_num);
+
+		/* Don't use ast_set_callerid() here because it will
+		 * generate a NewCallerID event before the NewChannel event */
+		tmp->cid.cid_num = ast_strdup(l->cid_num);
+		tmp->cid.cid_ani = ast_strdup(l->cid_num);
+		tmp->cid.cid_name = ast_strdup(l->cid_name);
+
 		tmp->priority = 1;
 		tmp->adsicpe = AST_ADSI_UNAVAILABLE;
 

Modified: team/murf/field/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/murf/field/channels/chan_zap.c?rev=39050&r1=39049&r2=39050&view=diff
==============================================================================
--- team/murf/field/channels/chan_zap.c (original)
+++ team/murf/field/channels/chan_zap.c Sat Aug  5 23:13:43 2006
@@ -5217,9 +5217,18 @@
 		tmp->cid.cid_dnid = ast_strdup(i->dnid);
 
 #ifdef PRI_ANI
-	ast_set_callerid(tmp, i->cid_num, i->cid_name, S_OR(i->cid_ani, i->cid_num));
+	/* Don't use ast_set_callerid() here because it will
+	 * generate a NewCallerID event before the NewChannel event */
+	tmp->cid.cid_num = ast_strdup(i->cid_num);
+	tmp->cid.cid_name = ast_strdup(i->cid_name);
+	if (!ast_strlen_zero(i->cid_ani))
+		tmp->cid.cid_ani = ast_strdup(i->cid_num);
+	else	
+		tmp->cid.cid_ani = ast_strdup(i->cid_num);
 #else
-	ast_set_callerid(tmp, i->cid_num, i->cid_name, i->cid_num);
+	tmp->cid.cid_num = ast_strdup(i->cid_num);
+	tmp->cid.cid_ani = ast_strdup(i->cid_num);
+	tmp->cid.cid_name = ast_strdup(i->cid_name);
 #endif
 	tmp->cid.cid_pres = i->callingpres;
 	tmp->cid.cid_ton = i->cid_ton;

Modified: team/murf/field/configs/func_odbc.conf.sample
URL: http://svn.digium.com/view/asterisk/team/murf/field/configs/func_odbc.conf.sample?rev=39050&r1=39049&r2=39050&view=diff
==============================================================================
--- team/murf/field/configs/func_odbc.conf.sample (original)
+++ team/murf/field/configs/func_odbc.conf.sample Sat Aug  5 23:13:43 2006
@@ -39,3 +39,13 @@
 			; field may be separated into individual variables with ARRAY.
 			; This option turns that behavior off [default=yes].
 
+; ODBC_HINTS - Workaround for lack of realtime hints
+;
+; Use in extensions.conf as:
+; exten => _1XX,hint,${ODBC_HINTS(${EXTEN})}
+;
+; (assuming your extensions are 3 digits and all begin with the digit 1)
+[HINTS]
+dsn=mysql1
+read=SELECT channel FROM hints WHERE extension='${ARG1}'
+

Modified: team/murf/field/doc/realtime.txt
URL: http://svn.digium.com/view/asterisk/team/murf/field/doc/realtime.txt?rev=39050&r1=39049&r2=39050&view=diff
==============================================================================
--- team/murf/field/doc/realtime.txt (original)
+++ team/murf/field/doc/realtime.txt Sat Aug  5 23:13:43 2006
@@ -25,8 +25,8 @@
 * ODBC: Support for UnixODBC, integrated into Asterisk
   The UnixODBC subsystem supports many different databases,
   please check www.unixodbc.org for more information.
-* MySQL: Found in the asterisk-addons subversion repository on cvs.digium.com
-
+* MySQL: Found in the asterisk-addons subversion repository on svn.digium.com
+* PostgreSQL: Native support for Postgres, integrated into Asterisk
 
 * Two modes: Static and Realtime
 --------------------------------
@@ -106,6 +106,13 @@
 doc/odbcstorage.txt documentation file.
 
 
+* Limitations
+-------------
+Currently, realtime extensions do not support realtime hints.  There is
+a workaround available by using func_odbc.  See the sample func_odbc.conf
+for more information.
+
+
 * FreeTDS supported with connection pooling
 -------------------------------------------
 In order to use a FreeTDS-based database with realtime, you need to turn

Modified: team/murf/field/res/res_musiconhold.c
URL: http://svn.digium.com/view/asterisk/team/murf/field/res/res_musiconhold.c?rev=39050&r1=39049&r2=39050&view=diff
==============================================================================
--- team/murf/field/res/res_musiconhold.c (original)
+++ team/murf/field/res/res_musiconhold.c Sat Aug  5 23:13:43 2006
@@ -234,7 +234,7 @@
 			state->pos %= state->class->total_files;
 
 			/* check to see if this file's format can be opened */
-			if (ast_fileexists(state->class->filearray[state->pos], NULL, NULL) != -1)
+			if (ast_fileexists(state->class->filearray[state->pos], NULL, NULL) > 0)
 				break;
 
 		}



More information about the svn-commits mailing list