[asterisk-commits] branch oej/multiparking r9058 - in /team/oej/multiparking: ./ agi/ apps/ cdr/...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Feb 1 13:33:39 MST 2006


Author: oej
Date: Wed Feb  1 14:32:46 2006
New Revision: 9058

URL: http://svn.digium.com/view/asterisk?rev=9058&view=rev
Log:
Merged revisions 8991,9001,9004,9013,9034,9046-9047,9052,9057 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
r8991 | oej | 2006-01-31 17:02:35 +0100 (Tue, 31 Jan 2006) | 4 lines

- Moving two session (PVT) flags to peer PAGE2 (DYNAMIC and SELFDESTRUCT) to make room for more session-related flags
  This is needed for integrating patches in the bug tracker
- Adding doxygen comments

........
r9001 | russell | 2006-01-31 18:18:58 +0100 (Tue, 31 Jan 2006) | 3 lines

define a global null_frame object so when queueing a null frame, you don't
have to allocate one on the stack

........
r9004 | russell | 2006-01-31 18:57:12 +0100 (Tue, 31 Jan 2006) | 2 lines

remove some more local declarations of null frames

........
r9013 | oej | 2006-01-31 19:40:07 +0100 (Tue, 31 Jan 2006) | 3 lines

Optimize settings of defaults for a new peer object and make sure
we set the same defaults for autocreated peers and other peers.

........
r9034 | oej | 2006-02-01 14:23:59 +0100 (Wed, 01 Feb 2006) | 3 lines

- Clarify default setting of canreinvite (thanks royk)
- Add some extra headers and reference to other doc/ files for realtime

........
r9046 | oej | 2006-02-01 18:16:08 +0100 (Wed, 01 Feb 2006) | 6 lines

- Adding a doc/00README.1st with an INDEX over README files
- Moving files from / to /doc or /configs
- Renaming some documentation files

Thank you for the initiative, manxpower!

........
r9047 | oej | 2006-02-01 18:49:02 +0100 (Wed, 01 Feb 2006) | 3 lines

- Removing the "README." from the name of the README files.


........
r9052 | mogorman | 2006-02-01 19:39:41 +0100 (Wed, 01 Feb 2006) | 3 lines

Allows for user to uninstall asterisk binaries
bug 6177

........
r9057 | oej | 2006-02-01 20:16:09 +0100 (Wed, 01 Feb 2006) | 5 lines

- Update URL to digium store
- Remove X100p and S100u
- Add mISDN
- remove ISDN4Linux 

........

Added:
    team/oej/multiparking/configs/muted.conf.sample
      - copied unchanged from r9057, trunk/configs/muted.conf.sample
    team/oej/multiparking/doc/00README.1st
      - copied unchanged from r9057, trunk/doc/00README.1st
    team/oej/multiparking/doc/ael.txt
      - copied unchanged from r9057, trunk/doc/ael.txt
    team/oej/multiparking/doc/app-sms.txt
      - copied unchanged from r9057, trunk/doc/app-sms.txt
    team/oej/multiparking/doc/asterisk-conf.txt
      - copied unchanged from r9057, trunk/doc/asterisk-conf.txt
    team/oej/multiparking/doc/backtrace.txt
      - copied unchanged from r9057, trunk/doc/backtrace.txt
    team/oej/multiparking/doc/billing.txt
      - copied unchanged from r9057, trunk/doc/billing.txt
    team/oej/multiparking/doc/callingpres.txt
      - copied unchanged from r9057, trunk/doc/callingpres.txt
    team/oej/multiparking/doc/cdrdriver.txt
      - copied unchanged from r9057, trunk/doc/cdrdriver.txt
    team/oej/multiparking/doc/chaniax.txt
      - copied unchanged from r9057, trunk/doc/chaniax.txt
    team/oej/multiparking/doc/channels.txt
      - copied unchanged from r9057, trunk/doc/channels.txt
    team/oej/multiparking/doc/channelvariables.txt
      - copied unchanged from r9057, trunk/doc/channelvariables.txt
    team/oej/multiparking/doc/cliprompt.txt
      - copied unchanged from r9057, trunk/doc/cliprompt.txt
    team/oej/multiparking/doc/configuration.txt
      - copied unchanged from r9057, trunk/doc/configuration.txt
    team/oej/multiparking/doc/cygwin.txt
      - copied unchanged from r9057, trunk/doc/cygwin.txt
    team/oej/multiparking/doc/dundi.txt
      - copied unchanged from r9057, trunk/doc/dundi.txt
    team/oej/multiparking/doc/enum.txt
      - copied unchanged from r9057, trunk/doc/enum.txt
    team/oej/multiparking/doc/extconfig.txt
      - copied unchanged from r9057, trunk/doc/extconfig.txt
    team/oej/multiparking/doc/externalivr.txt
      - copied unchanged from r9057, trunk/doc/externalivr.txt
    team/oej/multiparking/doc/freetds.txt
      - copied unchanged from r9057, trunk/doc/freetds.txt
    team/oej/multiparking/doc/h323.txt
      - copied unchanged from r9057, trunk/doc/h323.txt
    team/oej/multiparking/doc/hardware.txt
      - copied unchanged from r9057, trunk/doc/hardware.txt
    team/oej/multiparking/doc/ices.txt
      - copied unchanged from r9057, trunk/doc/ices.txt
    team/oej/multiparking/doc/jitterbuffer.txt
      - copied unchanged from r9057, trunk/doc/jitterbuffer.txt
    team/oej/multiparking/doc/linkedlists.txt
      - copied unchanged from r9057, trunk/doc/linkedlists.txt
    team/oej/multiparking/doc/math.txt
      - copied unchanged from r9057, trunk/doc/math.txt
    team/oej/multiparking/doc/misdn.txt
      - copied unchanged from r9057, trunk/doc/misdn.txt
    team/oej/multiparking/doc/mp3.txt
      - copied unchanged from r9057, trunk/doc/mp3.txt
    team/oej/multiparking/doc/musiconhold-fpm.txt
      - copied unchanged from r9057, trunk/doc/musiconhold-fpm.txt
    team/oej/multiparking/doc/mysql.txt
      - copied unchanged from r9057, trunk/doc/mysql.txt
    team/oej/multiparking/doc/odbcstorage.txt
      - copied unchanged from r9057, trunk/doc/odbcstorage.txt
    team/oej/multiparking/doc/privacy.txt
      - copied unchanged from r9057, trunk/doc/privacy.txt
    team/oej/multiparking/doc/realtime.txt
      - copied unchanged from r9057, trunk/doc/realtime.txt
    team/oej/multiparking/doc/security.txt
      - copied unchanged from r9057, trunk/doc/security.txt
    team/oej/multiparking/doc/sms.txt
      - copied unchanged from r9057, trunk/doc/sms.txt
Removed:
    team/oej/multiparking/HARDWARE
    team/oej/multiparking/README.fpm
    team/oej/multiparking/SECURITY
    team/oej/multiparking/doc/README.ael
    team/oej/multiparking/doc/README.app_sms
    team/oej/multiparking/doc/README.asterisk.conf
    team/oej/multiparking/doc/README.backtrace
    team/oej/multiparking/doc/README.callingpres
    team/oej/multiparking/doc/README.cdr
    team/oej/multiparking/doc/README.channels
    team/oej/multiparking/doc/README.cliprompt
    team/oej/multiparking/doc/README.configuration
    team/oej/multiparking/doc/README.cygwin
    team/oej/multiparking/doc/README.dundi
    team/oej/multiparking/doc/README.enum
    team/oej/multiparking/doc/README.extconfig
    team/oej/multiparking/doc/README.externalivr
    team/oej/multiparking/doc/README.h323
    team/oej/multiparking/doc/README.iax
    team/oej/multiparking/doc/README.ices
    team/oej/multiparking/doc/README.jitterbuffer
    team/oej/multiparking/doc/README.linkedlists
    team/oej/multiparking/doc/README.math
    team/oej/multiparking/doc/README.misdn
    team/oej/multiparking/doc/README.mp3
    team/oej/multiparking/doc/README.mysql
    team/oej/multiparking/doc/README.odbcstorage
    team/oej/multiparking/doc/README.privacy
    team/oej/multiparking/doc/README.realtime
    team/oej/multiparking/doc/README.sms
    team/oej/multiparking/doc/README.tds
    team/oej/multiparking/doc/README.variables
    team/oej/multiparking/doc/cdr.txt
    team/oej/multiparking/muted.conf.sample
Modified:
    team/oej/multiparking/   (props changed)
    team/oej/multiparking/Makefile
    team/oej/multiparking/agi/Makefile
    team/oej/multiparking/apps/Makefile
    team/oej/multiparking/apps/app_meetme.c
    team/oej/multiparking/cdr/Makefile
    team/oej/multiparking/channel.c
    team/oej/multiparking/channels/Makefile
    team/oej/multiparking/channels/chan_agent.c
    team/oej/multiparking/channels/chan_features.c
    team/oej/multiparking/channels/chan_h323.c
    team/oej/multiparking/channels/chan_iax2.c
    team/oej/multiparking/channels/chan_local.c
    team/oej/multiparking/channels/chan_mgcp.c
    team/oej/multiparking/channels/chan_sip.c
    team/oej/multiparking/channels/chan_zap.c
    team/oej/multiparking/codecs/Makefile
    team/oej/multiparking/configs/sip.conf.sample
    team/oej/multiparking/formats/Makefile
    team/oej/multiparking/frame.c
    team/oej/multiparking/funcs/Makefile
    team/oej/multiparking/include/asterisk/frame.h
    team/oej/multiparking/pbx/Makefile
    team/oej/multiparking/res/Makefile
    team/oej/multiparking/rtp.c
    team/oej/multiparking/stdtime/Makefile
    team/oej/multiparking/udptl.c
    team/oej/multiparking/utils/Makefile

Propchange: team/oej/multiparking/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Feb  1 14:32:46 2006
@@ -1,1 +1,1 @@
-/trunk:1-8983
+/trunk:1-9057

Modified: team/oej/multiparking/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/Makefile?rev=9058&r1=9057&r2=9058&view=diff
==============================================================================
--- team/oej/multiparking/Makefile (original)
+++ team/oej/multiparking/Makefile Wed Feb  1 14:32:46 2006
@@ -912,3 +912,37 @@
 	if cmp -s .cleancount .lastclean ; then echo ; else \
 		$(MAKE) clean; cp -f .cleancount .lastclean;\
 	fi
+
+_uninstall:
+	rm -f $(DESTDIR)$(MODULES_DIR)/*
+	rm -f $(DESTDIR)$(ASTSBINDIR)/*asterisk*
+	rm -f $(DESTDIR)$(ASTSBINDIR)/astgenkey
+	rm -f $(DESTDIR)$(ASTSBINDIR)/autosupport
+	rm -rf $(DESTDIR)$(ASTHEADERDIR)
+	rm -rf $(DESTDIR)$(ASTVARLIBDIR)/sounds
+	rm -rf $(DESTDIR)$(ASTVARLIBDIR)/firmware
+	rm -rf $(DESTDIR)$(ASTMANDIR)/man8
+	for x in $(SUBDIRS); do $(MAKE) -C $$x uninstall || exit 1 ; done
+
+uninstall: _uninstall
+	@echo " +--------- Asterisk Uninstall Complete -----+"  
+	@echo " + Asterisk binaries, sounds, man pages,     +"  
+	@echo " + headers, modules, and firmware builds,    +"  
+	@echo " + have all been uninstalled.                +"  
+	@echo " +                                           +"
+	@echo " + To remove ALL traces of Asterisk,         +"
+	@echo " + including configuration, spool            +"
+	@echo " + directories, and logs, run the following  +"
+	@echo " + command:                                  +"
+	@echo " +                                           +"
+	@echo " +            $(MAKE) uninstall-all             +"  
+	@echo " +-------------------------------------------+"  
+
+
+uninstall-all: _uninstall
+	rm -rf $(DESTDIR)$(ASTLIBDIR)
+	rm -rf $(DESTDIR)$(ASTVARLIBDIR)
+	rm -rf $(DESTDIR)$(ASTSPOOLDIR)
+	rm -rf $(DESTDIR)$(ASTETCDIR)
+	rm -rf $(DESTDIR)$(ASTLOGDIR)
+	

Modified: team/oej/multiparking/agi/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/agi/Makefile?rev=9058&r1=9057&r2=9058&view=diff
==============================================================================
--- team/oej/multiparking/agi/Makefile (original)
+++ team/oej/multiparking/agi/Makefile Wed Feb  1 14:32:46 2006
@@ -30,6 +30,9 @@
 	mkdir -p $(DESTDIR)$(AGI_DIR)
 	for x in $(AGIS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(AGI_DIR) ; done
 
+uninstall:
+	for x in $(AGIS); do rm -f $(DESTDIR)$(AGI_DIR)/$$x ; done
+
 eagi-test: eagi-test.o
 	$(CC) $(CFLAGS) -o eagi-test eagi-test.o $(LIBS)
 

Modified: team/oej/multiparking/apps/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/apps/Makefile?rev=9058&r1=9057&r2=9058&view=diff
==============================================================================
--- team/oej/multiparking/apps/Makefile (original)
+++ team/oej/multiparking/apps/Makefile Wed Feb  1 14:32:46 2006
@@ -92,6 +92,8 @@
 	rm -f $(DESTDIR)$(MODULES_DIR)/app_datetime.so
 	rm -f $(DESTDIR)$(MODULES_DIR)/app_qcall.so
 
+uninstall:
+
 app_curl.so: app_curl.o
 	$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(CURLLIBS)
 

Modified: team/oej/multiparking/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/apps/app_meetme.c?rev=9058&r1=9057&r2=9058&view=diff
==============================================================================
--- team/oej/multiparking/apps/app_meetme.c (original)
+++ team/oej/multiparking/apps/app_meetme.c Wed Feb  1 14:32:46 2006
@@ -206,7 +206,6 @@
 };
 
 static int admin_exec(struct ast_channel *chan, void *data);
-static struct ast_frame null_frame = { AST_FRAME_NULL, };
 
 static void *recordthread(void *args);
 
@@ -1574,7 +1573,7 @@
 								if (conf->transpath[index]) {
 									conf->transframe[index] = ast_translate(conf->transpath[index], conf->origframe, 0);
 									if (!conf->transframe[index])
-										conf->transframe[index] = &null_frame;
+										conf->transframe[index] = &ast_null_frame;
 								}
 							}
 						}

Modified: team/oej/multiparking/cdr/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/cdr/Makefile?rev=9058&r1=9057&r2=9058&view=diff
==============================================================================
--- team/oej/multiparking/cdr/Makefile (original)
+++ team/oej/multiparking/cdr/Makefile Wed Feb  1 14:32:46 2006
@@ -112,6 +112,8 @@
 install: all
 	for x in $(MODS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
 
+uninstall:
+
 clean:
 	rm -f *.so *.o .depend
 

Modified: team/oej/multiparking/channel.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/channel.c?rev=9058&r1=9057&r2=9058&view=diff
==============================================================================
--- team/oej/multiparking/channel.c (original)
+++ team/oej/multiparking/channel.c Wed Feb  1 14:32:46 2006
@@ -1760,17 +1760,13 @@
 	void *data;
 	int res;
 #endif
-	static struct ast_frame null_frame = {
-		AST_FRAME_NULL,
-	};
-	
 	ast_mutex_lock(&chan->lock);
 	if (chan->masq) {
 		if (ast_do_masquerade(chan)) {
 			ast_log(LOG_WARNING, "Failed to perform masquerade\n");
 			f = NULL;
 		} else
-			f =  &null_frame;
+			f =  &ast_null_frame;
 		ast_mutex_unlock(&chan->lock);
 		return f;
 	}
@@ -1838,8 +1834,7 @@
 				chan->timingdata = NULL;
 				ast_mutex_unlock(&chan->lock);
 			}
-			f =  &null_frame;
-			return f;
+			return &ast_null_frame;
 		} else
 			ast_log(LOG_NOTICE, "No/unknown event '%d' on timer for '%s'?\n", blah, chan->name);
 	} else
@@ -1851,8 +1846,7 @@
 		chan->generatordata = NULL;     /* reset to let ast_write get through */
 		chan->generator->generate(chan, tmp, -1, -1);
 		chan->generatordata = tmp;
-		f = &null_frame;
-		return f;
+		return &ast_null_frame;
 	}
 
 	/* Check for pending read queue */
@@ -1872,7 +1866,7 @@
 				f = chan->tech->exception(chan);
 			else {
 				ast_log(LOG_WARNING, "Exception flag set on '%s', but no exception handler\n", chan->name);
-				f = &null_frame;
+				f = &ast_null_frame;
 			}
 			/* Clear the exception flag */
 			ast_clear_flag(chan, AST_FLAG_EXCEPTION);
@@ -1898,7 +1892,7 @@
 			if (f->subclass == AST_CONTROL_ANSWER) {
 				if (prestate == AST_STATE_UP) {
 					ast_log(LOG_DEBUG, "Dropping duplicate answer!\n");
-					f = &null_frame;
+					f = &ast_null_frame;
 				}
 				/* Answer the CDR */
 				ast_setstate(chan, AST_STATE_UP);
@@ -1912,7 +1906,7 @@
 					chan->dtmfq[strlen(chan->dtmfq)] = f->subclass;
 				else
 					ast_log(LOG_WARNING, "Dropping deferred DTMF digits on %s\n", chan->name);
-				f = &null_frame;
+				f = &ast_null_frame;
 			}
 			break;
 		case AST_FRAME_DTMF_BEGIN:
@@ -1924,14 +1918,14 @@
 		case AST_FRAME_VOICE:
 			if (dropaudio) {
 				ast_frfree(f);
-				f = &null_frame;
+				f = &ast_null_frame;
 			} else if (!(f->subclass & chan->nativeformats)) {
 				/* This frame can't be from the current native formats -- drop it on the
 				   floor */
 				ast_log(LOG_NOTICE, "Dropping incompatible voice frame on %s of format %s since our native format has changed to %s\n",
 					chan->name, ast_getformatname(f->subclass), ast_getformatname(chan->nativeformats));
 				ast_frfree(f);
-				f = &null_frame;
+				f = &ast_null_frame;
 			} else {
 				if (chan->spies)
 					queue_frame_to_spies(chan, f, SPY_READ);
@@ -1962,7 +1956,7 @@
 
 				if (chan->readtrans) {
 					if (!(f = ast_translate(chan->readtrans, f, 1)))
-						f = &null_frame;
+						f = &ast_null_frame;
 				}
 
 				/* Run any generator sitting on the channel */
@@ -3121,10 +3115,9 @@
 			);
 		ast_channel_free(clone);
 	} else {
-		struct ast_frame null_frame = { AST_FRAME_NULL, };
 		ast_log(LOG_DEBUG, "Released clone lock on '%s'\n", clone->name);
 		ast_set_flag(clone, AST_FLAG_ZOMBIE);
-		ast_queue_frame(clone, &null_frame);
+		ast_queue_frame(clone, &ast_null_frame);
 		ast_mutex_unlock(&clone->lock);
 	}
 	

Modified: team/oej/multiparking/channels/Makefile
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/channels/Makefile?rev=9058&r1=9057&r2=9058&view=diff
==============================================================================
--- team/oej/multiparking/channels/Makefile (original)
+++ team/oej/multiparking/channels/Makefile Wed Feb  1 14:32:46 2006
@@ -234,6 +234,8 @@
 	for x in $(CHANNEL_LIBS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
 	if ! [ -f chan_iax.so ]; then rm -f $(DESTDIR)$(MODULES_DIR)/chan_iax.so ; fi
 
+uninstall:
+
 depend: .depend
 
 .depend:
@@ -241,4 +243,3 @@
 
 env:
 	env
-

Modified: team/oej/multiparking/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/channels/chan_agent.c?rev=9058&r1=9057&r2=9058&view=diff
==============================================================================
--- team/oej/multiparking/channels/chan_agent.c (original)
+++ team/oej/multiparking/channels/chan_agent.c Wed Feb  1 14:32:46 2006
@@ -438,7 +438,6 @@
 {
 	struct agent_pvt *p = ast->tech_pvt;
 	struct ast_frame *f = NULL;
-	static struct ast_frame null_frame = { AST_FRAME_NULL, };
 	static struct ast_frame answer_frame = { AST_FRAME_CONTROL, AST_CONTROL_ANSWER };
 	const char *status;
 	ast_mutex_lock(&p->lock); 
@@ -448,7 +447,7 @@
 		p->chan->fdno = (ast->fdno == AST_AGENT_FD) ? AST_TIMING_FD : ast->fdno;
 		f = ast_read(p->chan);
 	} else
-		f = &null_frame;
+		f = &ast_null_frame;
 	if (!f) {
 		/* If there's a channel, hang it up (if it's on a callback) make it NULL */
 		if (p->chan) {
@@ -486,7 +485,7 @@
  						ast_verbose(VERBOSE_PREFIX_3 "%s answered, waiting for '#' to acknowledge\n", p->chan->name);
  					/* Don't pass answer along */
  					ast_frfree(f);
- 					f = &null_frame;
+ 					f = &ast_null_frame;
  				} else {
  					p->acknowledged = 1;
  					/* Use the builtin answer frame for the 
@@ -513,7 +512,7 @@
  			/* don't pass voice until the call is acknowledged */
  			if (!p->acknowledged) {
  				ast_frfree(f);
- 				f = &null_frame;
+ 				f = &ast_null_frame;
  			}
  			break;
   		}
@@ -899,7 +898,6 @@
 static struct ast_channel *agent_new(struct agent_pvt *p, int state)
 {
 	struct ast_channel *tmp;
-	struct ast_frame null_frame = { AST_FRAME_NULL };
 #if 0
 	if (!p->chan) {
 		ast_log(LOG_WARNING, "No channel? :(\n");
@@ -950,7 +948,7 @@
 		if( ast_mutex_trylock(&p->app_lock) )
 		{
 			if (p->chan) {
-				ast_queue_frame(p->chan, &null_frame);
+				ast_queue_frame(p->chan, &ast_null_frame);
 				ast_mutex_unlock(&p->lock);	/* For other thread to read the condition. */
 				ast_mutex_lock(&p->app_lock);
 				ast_mutex_lock(&p->lock);

Modified: team/oej/multiparking/channels/chan_features.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/channels/chan_features.c?rev=9058&r1=9057&r2=9058&view=diff
==============================================================================
--- team/oej/multiparking/channels/chan_features.c (original)
+++ team/oej/multiparking/channels/chan_features.c Wed Feb  1 14:32:46 2006
@@ -241,12 +241,11 @@
 
 static struct ast_frame  *features_read(struct ast_channel *ast)
 {
-	static struct ast_frame null_frame = { AST_FRAME_NULL, };
 	struct feature_pvt *p = ast->tech_pvt;
 	struct ast_frame *f;
 	int x;
 	
-	f = &null_frame;
+	f = &ast_null_frame;
 	ast_mutex_lock(&p->lock);
 	x = indexof(p, ast, 0);
 	if (!x && p->subchan) {

Modified: team/oej/multiparking/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/channels/chan_h323.c?rev=9058&r1=9057&r2=9058&view=diff
==============================================================================
--- team/oej/multiparking/channels/chan_h323.c (original)
+++ team/oej/multiparking/channels/chan_h323.c Wed Feb  1 14:32:46 2006
@@ -543,7 +543,6 @@
 {
 	/* Retrieve audio/etc from channel.  Assumes pvt->lock is already held. */
 	struct ast_frame *f;
-	static struct ast_frame null_frame = { AST_FRAME_NULL, };
 
 	/* Only apply it for the first packet, we just need the correct ip/port */
 	if (pvt->options.nat) {
@@ -554,7 +553,7 @@
 	f = ast_rtp_read(pvt->rtp);
 	/* Don't send RFC2833 if we're not supposed to */
 	if (f && (f->frametype == AST_FRAME_DTMF) && !(pvt->options.dtmfmode & H323_DTMF_RFC2833)) {
-		return &null_frame;
+		return &ast_null_frame;
 	}
 	if (pvt->owner) {
 		/* We already hold the channel lock */
@@ -563,7 +562,7 @@
 				/* Try to avoid deadlock */
 				if (ast_mutex_trylock(&pvt->owner->lock)) {
 					ast_log(LOG_NOTICE, "Format changed but channel is locked. Ignoring frame...\n");
-					return &null_frame;
+					return &ast_null_frame;
 				}
 				ast_log(LOG_DEBUG, "Oooh, format changed to %d\n", f->subclass);
 				pvt->owner->nativeformats = f->subclass;

Modified: team/oej/multiparking/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/channels/chan_iax2.c?rev=9058&r1=9057&r2=9058&view=diff
==============================================================================
--- team/oej/multiparking/channels/chan_iax2.c (original)
+++ team/oej/multiparking/channels/chan_iax2.c Wed Feb  1 14:32:46 2006
@@ -3111,9 +3111,8 @@
 
 static struct ast_frame *iax2_read(struct ast_channel *c) 
 {
-	static struct ast_frame f = { AST_FRAME_NULL, };
 	ast_log(LOG_NOTICE, "I should never be called!\n");
-	return &f;
+	return &ast_null_frame;
 }
 
 static int iax2_start_transfer(unsigned short callno0, unsigned short callno1)

Modified: team/oej/multiparking/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/channels/chan_local.c?rev=9058&r1=9057&r2=9058&view=diff
==============================================================================
--- team/oej/multiparking/channels/chan_local.c (original)
+++ team/oej/multiparking/channels/chan_local.c Wed Feb  1 14:32:46 2006
@@ -224,9 +224,7 @@
 
 static struct ast_frame  *local_read(struct ast_channel *ast)
 {
-	static struct ast_frame null = { AST_FRAME_NULL, };
-
-	return &null;
+	return &ast_null_frame;
 }
 
 static int local_write(struct ast_channel *ast, struct ast_frame *f)

Modified: team/oej/multiparking/channels/chan_mgcp.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/channels/chan_mgcp.c?rev=9058&r1=9057&r2=9058&view=diff
==============================================================================
--- team/oej/multiparking/channels/chan_mgcp.c (original)
+++ team/oej/multiparking/channels/chan_mgcp.c Wed Feb  1 14:32:46 2006
@@ -1219,12 +1219,11 @@
 {
 	/* Retrieve audio/etc from channel.  Assumes sub->lock is already held. */
 	struct ast_frame *f;
-	static struct ast_frame null_frame = { AST_FRAME_NULL, };
 
 	f = ast_rtp_read(sub->rtp);
 	/* Don't send RFC2833 if we're not supposed to */
 	if (f && (f->frametype == AST_FRAME_DTMF) && !(sub->parent->dtmfmode & MGCP_DTMF_RFC2833))
-		return &null_frame;
+		return &ast_null_frame;
 	if (sub->owner) {
 		/* We already hold the channel lock */
 		if (f->frametype == AST_FRAME_VOICE) {

Modified: team/oej/multiparking/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/multiparking/channels/chan_sip.c?rev=9058&r1=9057&r2=9058&view=diff
==============================================================================
--- team/oej/multiparking/channels/chan_sip.c (original)
+++ team/oej/multiparking/channels/chan_sip.c Wed Feb  1 14:32:46 2006
@@ -34,6 +34,7 @@
  * \todo Better support of forking
  *
  * \ingroup channel_drivers
+ *
  */
 
 
@@ -488,11 +489,13 @@
 	enum sip_auth_type auth_type;	/*!< Authentication type */
 };
 
+/*! \brief Structure to save routing information for a SIP session */
 struct sip_route {
 	struct sip_route *next;
 	char hop[0];
 };
 
+/*! \brief Modes for SIP domain handling in the PBX */
 enum domain_mode {
 	SIP_DOMAIN_AUTO,	/*!< This domain is auto-configured */
 	SIP_DOMAIN_CONFIG,	/*!< This domain is from configuration */
@@ -525,7 +528,9 @@
 	struct sip_auth *next;          /*!< Next auth structure in list */
 };
 
-/*--- Various flags for the flags field in the pvt structure */
+/*--- Various flags for the flags field in the pvt structure 
+ Peer only flags should be set in PAGE2 below
+*/
 #define SIP_ALREADYGONE		(1 << 0)	/*!< Whether or not we've already been destroyed by our peer */
 #define SIP_NEEDDESTROY		(1 << 1)	/*!< if we need to be destroyed */
 #define SIP_NOVIDEO		(1 << 2)	/*!< Didn't get video in invite, don't offer */
@@ -540,14 +545,13 @@
 #define SIP_REALTIME		(1 << 11)	/*!< Flag for realtime users */
 #define SIP_USECLIENTCODE	(1 << 12)	/*!< Trust X-ClientCode info message */
 #define SIP_OUTGOING		(1 << 13)	/*!< Is this an outgoing call? */
-#define SIP_SELFDESTRUCT	(1 << 14)	
-#define SIP_DYNAMIC		(1 << 15)	/*!< Is this a dynamic peer? */
-/* --- Choices for DTMF support in SIP channel */
-#define SIP_DTMF		(3 << 16)	/*!< three settings, uses two bits */
-#define SIP_DTMF_RFC2833	(0 << 16)	/*!< RTP DTMF */
-#define SIP_DTMF_INBAND		(1 << 16)	/*!< Inband audio, only for ULAW/ALAW */
-#define SIP_DTMF_INFO		(2 << 16)	/*!< SIP Info messages */
-#define SIP_DTMF_AUTO		(3 << 16)	/*!< AUTO switch between rfc2833 and in-band DTMF */
+#define SIP_FREEBIT		(1 << 14)	/*!< Free for session-related use */
+#define SIP_FREEBIT3		(1 << 15)	/*!< Free for session-related use */
+#define SIP_DTMF		(3 << 16)	/*!< DTMF Support: four settings, uses two bits */
+#define SIP_DTMF_RFC2833	(0 << 16)	/*!< DTMF Support: RTP DTMF - "rfc2833" */
+#define SIP_DTMF_INBAND		(1 << 16)	/*!< DTMF Support: Inband audio, only for ULAW/ALAW - "inband" */
+#define SIP_DTMF_INFO		(2 << 16)	/*!< DTMF Support: SIP Info messages - "info" */
+#define SIP_DTMF_AUTO		(3 << 16)	/*!< DTMF Support: AUTO switch between rfc2833 and in-band DTMF */
 /* NAT settings */
 #define SIP_NAT			(3 << 18)	/*!< four settings, uses two bits */
 #define SIP_NAT_NEVER		(0 << 18)	/*!< No nat support */
@@ -585,7 +589,7 @@
 	 SIP_PROG_INBAND | SIP_OSPAUTH | SIP_USECLIENTCODE | SIP_NAT | \
 	 SIP_INSECURE_PORT | SIP_INSECURE_INVITE)
 
-/* a new page of flags for peer */
+/* a new page of flags for peers */
 #define SIP_PAGE2_RTCACHEFRIENDS	(1 << 0)
 #define SIP_PAGE2_RTUPDATE		(1 << 1)
 #define SIP_PAGE2_RTAUTOCLEAR		(1 << 2)
@@ -594,6 +598,8 @@
 #define SIP_PAGE2_DEBUG			(3 << 5)
 #define SIP_PAGE2_DEBUG_CONFIG 		(1 << 5)
 #define SIP_PAGE2_DEBUG_CONSOLE 	(1 << 6)
+#define SIP_PAGE2_DYNAMIC		(1 << 7)	/*!< Dynamic Peers register with Asterisk */
+#define SIP_PAGE2_SELFDESTRUCT		(1 << 8)	/*!< Automatic peers need to destruct themselves */
 
 /* SIP packet flags */
 #define SIP_PKT_DEBUG		(1 << 0)	/*!< Debug this packet */
@@ -965,6 +971,9 @@
 static int sip_poke_peer(struct sip_peer *peer);
 static int __sip_do_register(struct sip_registry *r);
 static int restart_monitor(void);
+static void set_peer_defaults(struct sip_peer *peer);
+static struct sip_peer *temp_peer(const char *name);
+
 
 /*----- RTP interface functions */
 static int sip_set_rtp_peer(struct ast_channel *chan, struct ast_rtp *rtp, struct ast_rtp *vrtp, int codecs, int nat_active);
@@ -1317,7 +1326,9 @@
 	return 0;
 }
 
-/*! \brief Transmit packet with retransmits */
+/*! \brief Transmit packet with retransmits 
+	\return 0 on success, -1 on failure to allocate packet 
+*/
 static int __sip_reliable_xmit(struct sip_pvt *p, int seqno, int resp, char *data, int len, int fatal, int sipmethod)
 {
 	struct sip_pkt *pkt;
@@ -1684,7 +1695,7 @@
 		ast_sched_del(sched, peer->pokeexpire);
 	register_peer_exten(peer, 0);
 	ast_free_ha(peer->ha);
-	if (ast_test_flag(peer, SIP_SELFDESTRUCT))
+	if (ast_test_flag((&peer->flags_page2), SIP_PAGE2_SELFDESTRUCT))
 		apeerobjs--;
 	else if (ast_test_flag(peer, SIP_REALTIME))
 		rpeerobjs--;
@@ -3051,11 +3062,10 @@
 {
 	/* Retrieve audio/etc from channel.  Assumes p->lock is already held. */
 	struct ast_frame *f;
-	static struct ast_frame null_frame = { AST_FRAME_NULL, };
 	
 	if (!p->rtp) {
 		/* We have no RTP allocated for this channel */
-		return &null_frame;
+		return &ast_null_frame;
 	}
 
 	switch(ast->fdno) {
@@ -3072,11 +3082,11 @@
 		f = ast_rtcp_read(p->vrtp);	/* RTCP Control Channel for video */
 		break;
 	default:
-		f = &null_frame;
+		f = &ast_null_frame;
 	}
 	/* Don't forward RFC2833 if we're not supposed to */
 	if (f && (f->frametype == AST_FRAME_DTMF) && (ast_test_flag(p, SIP_DTMF) != SIP_DTMF_RFC2833))
-		return &null_frame;
+		return &ast_null_frame;
 
 	if (p->owner) {
 		/* We already hold the channel lock */
@@ -3760,12 +3770,11 @@
 	if ((bridgepeer=ast_bridged_channel(p->owner))) {
 		/* We have a bridge */
 		/* Turn on/off music on hold if we are holding/unholding */
-		struct ast_frame af = { AST_FRAME_NULL, };
 		if (sin.sin_addr.s_addr && !sendonly) {
 			ast_moh_stop(bridgepeer);
 		
 			/* Activate a re-invite */
-			ast_queue_frame(p->owner, &af);
+			ast_queue_frame(p->owner, &ast_null_frame);
 		} else {
 			/* No address for RTP, we're on hold */
 			
@@ -3773,7 +3782,7 @@
 			if (sendonly)
 				ast_rtp_stop(p->rtp);
 			/* Activate a re-invite */
-			ast_queue_frame(p->owner, &af);
+			ast_queue_frame(p->owner, &ast_null_frame);
 		}
 	}
 
@@ -5767,7 +5776,7 @@
 	register_peer_exten(peer, 0);
 	peer->expire = -1;
 	ast_device_state_changed("SIP/%s", peer->name);
-	if (ast_test_flag(peer, SIP_SELFDESTRUCT) || ast_test_flag((&peer->flags_page2), SIP_PAGE2_RTAUTOCLEAR)) {
+	if (ast_test_flag((&peer->flags_page2), SIP_PAGE2_SELFDESTRUCT) || ast_test_flag((&peer->flags_page2), SIP_PAGE2_RTAUTOCLEAR)) {
 		peer = ASTOBJ_CONTAINER_UNLINK(&peerl, peer);
 		ASTOBJ_UNREF(peer, sip_destroy_peer);
 	}
@@ -6499,7 +6508,7 @@
 			ASTOBJ_UNREF(peer, sip_destroy_peer);
 	}
 	if (peer) {
-		if (!ast_test_flag(peer, SIP_DYNAMIC)) {
+		if (!ast_test_flag((&peer->flags_page2), SIP_PAGE2_DYNAMIC)) {
 			ast_log(LOG_ERROR, "Peer '%s' is trying to register, but not configured as host=dynamic\n", peer->name);
 		} else {
 			ast_copy_flags(p, peer, SIP_NAT);
@@ -7660,7 +7669,7 @@
 		
 		snprintf(srch, sizeof(srch), FORMAT, name,
 			iterator->addr.sin_addr.s_addr ? ast_inet_ntoa(iabuf, sizeof(iabuf), iterator->addr.sin_addr) : "(Unspecified)",
-			ast_test_flag(iterator, SIP_DYNAMIC) ? " D " : "   ", 	/* Dynamic or not? */
+			ast_test_flag((&iterator->flags_page2), SIP_PAGE2_DYNAMIC) ? " D " : "   ", 	/* Dynamic or not? */
 			(ast_test_flag(iterator, SIP_NAT) & SIP_NAT_ROUTE) ? " N " : "   ",	/* NAT=yes? */
 			iterator->ha ? " A " : "   ", 	/* permit/deny */
 			ntohs(iterator->addr.sin_port), status);
@@ -7668,7 +7677,7 @@
 		if (!s)  {/* Normal CLI list */
 			ast_cli(fd, FORMAT, name, 
 			iterator->addr.sin_addr.s_addr ? ast_inet_ntoa(iabuf, sizeof(iabuf), iterator->addr.sin_addr) : "(Unspecified)",
-			ast_test_flag(iterator, SIP_DYNAMIC) ? " D " : "   ",  /* Dynamic or not? */
+			ast_test_flag((&iterator->flags_page2), SIP_PAGE2_DYNAMIC) ? " D " : "   ", 	/* Dynamic or not? */
 			(ast_test_flag(iterator, SIP_NAT) & SIP_NAT_ROUTE) ? " N " : "   ",	/* NAT=yes? */
 			iterator->ha ? " A " : "   ",       /* permit/deny */
 			
@@ -7690,7 +7699,7 @@
 			iterator->name, 
 			iterator->addr.sin_addr.s_addr ? ast_inet_ntoa(iabuf, sizeof(iabuf), iterator->addr.sin_addr) : "-none-",
 			ntohs(iterator->addr.sin_port), 
-			ast_test_flag(iterator, SIP_DYNAMIC) ? "yes" : "no",  /* Dynamic or not? */
+			ast_test_flag((&iterator->flags_page2), SIP_PAGE2_DYNAMIC) ? "yes" : "no", 	/* Dynamic or not? */
 			(ast_test_flag(iterator, SIP_NAT) & SIP_NAT_ROUTE) ? "yes" : "no",	/* NAT=yes? */
 			iterator->ha ? "yes" : "no",       /* permit/deny */
 			status);
@@ -8064,7 +8073,7 @@
 		ast_cli(fd, "  VM Extension : %s\n", peer->vmexten);
 		ast_cli(fd, "  LastMsgsSent : %d\n", peer->lastmsgssent);
 		ast_cli(fd, "  Call limit   : %d\n", peer->call_limit);
-		ast_cli(fd, "  Dynamic      : %s\n", (ast_test_flag(peer, SIP_DYNAMIC)?"Yes":"No"));
+		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>"));
 		ast_cli(fd, "  Expire       : %d\n", peer->expire);
 		ast_cli(fd, "  Insecure     : %s\n", insecure2str(ast_test_flag(peer, SIP_INSECURE_PORT), ast_test_flag(peer, SIP_INSECURE_INVITE)));
@@ -8140,7 +8149,7 @@
 		ast_cli(fd, "VoiceMailbox: %s\r\n", peer->mailbox);
 		ast_cli(fd, "LastMsgsSent: %d\r\n", peer->lastmsgssent);
 		ast_cli(fd, "Call limit: %d\r\n", peer->call_limit);
-		ast_cli(fd, "Dynamic: %s\r\n", (ast_test_flag(peer, SIP_DYNAMIC)?"Y":"N"));
+		ast_cli(fd, "Dynamic: %s\r\n", (ast_test_flag((&peer->flags_page2), SIP_PAGE2_DYNAMIC)?"Y":"N"));
 		ast_cli(fd, "Callerid: %s\r\n", ast_callerid_merge(cbuf, sizeof(cbuf), peer->cid_name, peer->cid_num, ""));
 		ast_cli(fd, "RegExpire: %ld seconds\r\n", ast_sched_when(sched,peer->expire));
 		ast_cli(fd, "SIP-AuthInsecure: %s\r\n", insecure2str(ast_test_flag(peer, SIP_INSECURE_PORT), ast_test_flag(peer, SIP_INSECURE_INVITE)));
@@ -9381,7 +9390,7 @@
 	} else  if (!strcasecmp(colname, "expire")) {
 		snprintf(buf, len, "%d", peer->expire);
 	} else  if (!strcasecmp(colname, "dynamic")) {
-		ast_copy_string(buf, (ast_test_flag(peer, SIP_DYNAMIC) ? "yes" : "no"), len);
+		ast_copy_string(buf, (ast_test_flag((&peer->flags_page2), SIP_PAGE2_DYNAMIC) ? "yes" : "no"), len);
 	} else  if (!strcasecmp(colname, "callerid_name")) {
 		ast_copy_string(buf, peer->cid_name, len);
 	} else  if (!strcasecmp(colname, "callerid_num")) {
@@ -9625,8 +9634,7 @@
 #endif
 				ast_queue_control(p->owner, AST_CONTROL_ANSWER);
 			} else {	/* RE-invite */
-				struct ast_frame af = { AST_FRAME_NULL, };
-				ast_queue_frame(p->owner, &af);
+				ast_queue_frame(p->owner, &ast_null_frame);
 			}
 		} else {
 			 /* It's possible we're getting an ACK after we've tried to disconnect
@@ -10360,7 +10368,6 @@
 	int res = 1;
 	struct ast_channel *c=NULL;
 	int gotdest;
-	struct ast_frame af = { AST_FRAME_NULL, };
 	char *supported;
 	char *required;
 	unsigned int required_profile = 0;
@@ -10452,7 +10459,7 @@
 
 		/* Queue NULL frame to prod ast_rtp_bridge if appropriate */
 		if (p->owner)
-			ast_queue_frame(p->owner, &af);
+			ast_queue_frame(p->owner, &ast_null_frame);
 
 		/* Initialize the context if it hasn't been already */
 		if (ast_strlen_zero(p->context))
@@ -12061,20 +12068,11 @@
 	return user;
 }
 
-/*! \brief Create temporary peer (used in autocreatepeer mode) */
-static struct sip_peer *temp_peer(const char *name)
-{
-	struct sip_peer *peer;
-
-	if (!(peer = ast_calloc(1, sizeof(*peer))))
-		return NULL;
-
-	apeerobjs++;
-	ASTOBJ_INIT(peer);
-
+/*! \brief Set peer defaults before configuring specific configurations */
+static void set_peer_defaults(struct sip_peer *peer)
+{
 	peer->expire = -1;
 	peer->pokeexpire = -1;
-	ast_copy_string(peer->name, name, sizeof(peer->name));
 	ast_copy_flags(peer, &global_flags, SIP_FLAGS_TO_COPY);
 	strcpy(peer->context, default_context);
 	strcpy(peer->subscribecontext, default_subscribecontext);
@@ -12083,77 +12081,12 @@
 	strcpy(peer->parkinglot, default_parkinglot);
 	peer->addr.sin_port = htons(DEFAULT_SIP_PORT);
 	peer->addr.sin_family = AF_INET;
+	peer->defaddr.sin_family = AF_INET;
 	peer->capability = global_capability;
 	peer->rtptimeout = global_rtptimeout;
 	peer->rtpholdtimeout = global_rtpholdtimeout;
 	peer->rtpkeepalive = global_rtpkeepalive;
-	ast_set_flag(peer, SIP_SELFDESTRUCT);
-	ast_set_flag(peer, SIP_DYNAMIC);
-	peer->prefs = default_prefs;
-	reg_source_db(peer);
-
-	return peer;
-}
-
-/*! \brief Build peer from configuration (file or realtime static/dynamic) */
-static struct sip_peer *build_peer(const char *name, struct ast_variable *v, int realtime)
-{
-	struct sip_peer *peer = NULL;
-	struct ast_ha *oldha = NULL;
-	int obproxyfound=0;
-	int found=0;
-	int format=0;		/* Ama flags */
-	time_t regseconds;
-	char *varname = NULL, *varval = NULL;
-	struct ast_variable *tmpvar = NULL;
-	struct ast_flags peerflags = {(0)};
-	struct ast_flags mask = {(0)};
-
-
-	if (!realtime)
-		/* Note we do NOT use find_peer here, to avoid realtime recursion */
-		/* We also use a case-sensitive comparison (unlike find_peer) so
-		   that case changes made to the peer name will be properly handled
-		   during reload
-		*/
-		peer = ASTOBJ_CONTAINER_FIND_UNLINK_FULL(&peerl, name, name, 0, 0, strcmp);
-
-	if (peer) {
-		/* Already in the list, remove it and it will be added back (or FREE'd)  */
-		found++;
- 	} else {
-		if (!(peer = ast_calloc(1, sizeof(*peer))))
-			return NULL;
-
-		if (realtime)
-			rpeerobjs++;
-		else
-			speerobjs++;
-		ASTOBJ_INIT(peer);
-		peer->expire = -1;
-		peer->pokeexpire = -1;
-	}
-	/* Note that our peer HAS had its reference count incrased */
-
-	peer->lastmsgssent = -1;
-	if (!found) {
-		if (name)
-			ast_copy_string(peer->name, name, sizeof(peer->name));
-		peer->addr.sin_port = htons(DEFAULT_SIP_PORT);
-		peer->addr.sin_family = AF_INET;
-		peer->defaddr.sin_family = AF_INET;
-	}
-	/* If we have channel variables, remove them (reload) */
-	if (peer->chanvars) {
-		ast_variables_destroy(peer->chanvars);
-		peer->chanvars = NULL;
-	}
-	strcpy(peer->context, default_context);
-	strcpy(peer->subscribecontext, default_subscribecontext);
 	strcpy(peer->vmexten, default_vmexten);
-	strcpy(peer->language, default_language);
-	strcpy(peer->musicclass, default_musicclass);
-	strcpy(peer->parkinglot, default_parkinglot);
 	ast_copy_flags(peer, &global_flags, SIP_USEREQPHONE);
 	peer->secret[0] = '\0';
 	peer->md5secret[0] = '\0';
@@ -12165,16 +12098,87 @@
 	peer->mailbox[0] = '\0';
 	peer->callgroup = 0;
 	peer->pickupgroup = 0;
-	peer->rtpkeepalive = global_rtpkeepalive;
 	peer->maxms = default_qualify;
 	peer->prefs = default_prefs;
+}
+
+/*! \brief Create temporary peer (used in autocreatepeer mode) */
+static struct sip_peer *temp_peer(const char *name)
+{
+	struct sip_peer *peer;
+
+	if (!(peer = ast_calloc(1, sizeof(*peer))))
+		return NULL;
+
+	apeerobjs++;
+	ASTOBJ_INIT(peer);
+	set_peer_defaults(peer);
+
+	ast_copy_string(peer->name, name, sizeof(peer->name));
+
+	ast_set_flag((&peer->flags_page2), SIP_PAGE2_SELFDESTRUCT);
+	ast_set_flag((&peer->flags_page2), SIP_PAGE2_DYNAMIC);
+	peer->prefs = default_prefs;
+	reg_source_db(peer);
+
+	return peer;
+}
+
+/*! \brief Build peer from configuration (file or realtime static/dynamic) */
+static struct sip_peer *build_peer(const char *name, struct ast_variable *v, int realtime)
+{
+	struct sip_peer *peer = NULL;
+	struct ast_ha *oldha = NULL;
+	int obproxyfound=0;
+	int found=0;
+	int format=0;		/* Ama flags */
+	time_t regseconds;
+	char *varname = NULL, *varval = NULL;
+	struct ast_variable *tmpvar = NULL;
+	struct ast_flags peerflags = {(0)};
+	struct ast_flags mask = {(0)};
+
+
+	if (!realtime)
+		/* Note we do NOT use find_peer here, to avoid realtime recursion */
+		/* We also use a case-sensitive comparison (unlike find_peer) so
+		   that case changes made to the peer name will be properly handled
+		   during reload
+		*/
+		peer = ASTOBJ_CONTAINER_FIND_UNLINK_FULL(&peerl, name, name, 0, 0, strcmp);
+
+	if (peer) {
+		/* Already in the list, remove it and it will be added back (or FREE'd)  */
+		found++;
+ 	} else {
+		if (!(peer = ast_calloc(1, sizeof(*peer))))
+			return NULL;
+
+		if (realtime)
+			rpeerobjs++;
+		else
+			speerobjs++;
+		ASTOBJ_INIT(peer);
+		peer->expire = -1;
+		peer->pokeexpire = -1;
+	}
+	/* Note that our peer HAS had its reference count incrased */
+
+	peer->lastmsgssent = -1;
 	oldha = peer->ha;
 	peer->ha = NULL;
-	peer->addr.sin_family = AF_INET;
-	ast_copy_flags(peer, &global_flags, SIP_FLAGS_TO_COPY);

[... 492 lines stripped ...]


More information about the asterisk-commits mailing list