[asterisk-commits] russell: branch russell/sla_updates r55586 - in /team/russell/sla_updates: ./...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Feb 20 10:24:08 MST 2007


Author: russell
Date: Tue Feb 20 11:24:08 2007
New Revision: 55586

URL: http://svn.digium.com/view/asterisk?view=rev&rev=55586
Log:
Merged revisions 55553,55555 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r55553 | russell | 2007-02-20 10:41:57 -0600 (Tue, 20 Feb 2007) | 3 lines

Change the formatting of sla.conf.sample to make it more readable.  
(issue #9112, blitzrage)

........
r55555 | qwell | 2007-02-20 10:53:45 -0600 (Tue, 20 Feb 2007) | 4 lines

No need to cast nor free with strdupa (thanks file)

55555!

........

Modified:
    team/russell/sla_updates/   (props changed)
    team/russell/sla_updates/channels/chan_gtalk.c
    team/russell/sla_updates/configs/sla.conf.sample
    team/russell/sla_updates/res/res_jabber.c

Propchange: team/russell/sla_updates/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/russell/sla_updates/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Feb 20 11:24:08 2007
@@ -1,1 +1,1 @@
-/branches/1.4:1-55493
+/branches/1.4:1-55585

Modified: team/russell/sla_updates/channels/chan_gtalk.c
URL: http://svn.digium.com/view/asterisk/team/russell/sla_updates/channels/chan_gtalk.c?view=diff&rev=55586&r1=55585&r2=55586
==============================================================================
--- team/russell/sla_updates/channels/chan_gtalk.c (original)
+++ team/russell/sla_updates/channels/chan_gtalk.c Tue Feb 20 11:24:08 2007
@@ -258,10 +258,9 @@
 	struct gtalk *gtalk = NULL;
 	char *domain = NULL , *s = NULL;
 	if(strchr(connection, '@')) {
-		s = ast_strdupa((char *) connection);
+		s = ast_strdupa(connection);
 		domain = strsep(&s, "@");
 		ast_verbose("OOOOH domain = %s\n", domain);
-		free(s);
 	}
 	gtalk = ASTOBJ_CONTAINER_FIND(&gtalk_list, name);
 	if (!gtalk && strchr(name, '@'))
@@ -874,13 +873,11 @@
 	}
 
 	if(strchr(tmp->us, '/')) {
-		data = ast_strdupa((char *) tmp->us);
+		data = ast_strdupa(tmp->us);
 		exten = strsep(&data, "/");
 	} else
 		exten = tmp->us;
 	ast_copy_string(tmp->exten,  exten, sizeof(tmp->exten));
-	if(data)
-		free(data);
 	ast_mutex_init(&tmp->lock);
 	ast_mutex_lock(&gtalklock);
 	tmp->next = client->p;
@@ -1477,15 +1474,13 @@
 	struct ast_channel *chan = NULL;
 
 	if (data) {
-		s = ast_strdupa((char *) data);
+		s = ast_strdupa(data);
 		if (s) {
 			sender = strsep(&s, "/");
 			if (sender && (sender[0] != '\0'))
 				to = strsep(&s, "/");
 			if (!to) {
 				ast_log(LOG_ERROR, "Bad arguments in Gtalk Dialstring: %s\n", (char*) data);
-				if (s)
-					free(s);
 				return NULL;
 			}
 		}
@@ -1493,8 +1488,6 @@
 	client = find_gtalk(to, sender);
 	if (!client) {
 		ast_log(LOG_WARNING, "Could not find recipient.\n");
-		if (s)
-			free(s);
 		return NULL;
 	}
 	p = gtalk_alloc(client, strchr(sender, '@') ? sender : client->connection->jid->full, strchr(to, '@') ? to : client->user, NULL);

Modified: team/russell/sla_updates/configs/sla.conf.sample
URL: http://svn.digium.com/view/asterisk/team/russell/sla_updates/configs/sla.conf.sample?view=diff&rev=55586&r1=55585&r2=55586
==============================================================================
--- team/russell/sla_updates/configs/sla.conf.sample (original)
+++ team/russell/sla_updates/configs/sla.conf.sample Tue Feb 20 11:24:08 2007
@@ -10,83 +10,76 @@
 
 
 ; ---- Trunk Declarations -------------
+;
+;[line1]                  ; Provide a name for this trunk.
+;type=trunk               ; This line is what marks this entry as a trunk.
+;
+;device=Zap/3             ; Map this trunk declaration to a specific device.
+                          ; NOTE: At this point, this *must* be a zap channel!
 
-; Provide a name for this trunk.
-[line1]
-; This line is what marks this entry as a trunk.
-type=trunk
-; Map this trunk declaration to a specific device.
-; NOTE: At this point, this *must* be a zap channel!
-device=Zap/3
-; This supports automatic generation of the dialplan entries if the autocontext
-; option is used.  Each trunk should have a unique context name.  Then, in
-; zapata.conf, this device should be configured to have incoming calls go to
-; this context.
-autocontext=line1
-; Set how long to allow this trunk to ring on an inbound call before hanging 
-; it up as an unanswered call.  The value is in seconds.
-ringtimeout=30
+;autocontext=line1        ; This supports automatic generation of the dialplan entries 
+                          ; if the autocontext option is used.  Each trunk should have 
+                          ; a unique context name.  Then, in zapata.conf, this device 
+                          ; should be configured to have incoming calls go to this context.
 
-[line2]
-type=trunk
-device=Zap/4
-autocontext=line2
+;ringtimeout=30           ; Set how long to allow this trunk to ring on an inbound call before hanging 
+                          ; it up as an unanswered call.  The value is in seconds.
 
-[line3]
-type=trunk
-device=Zap/3
-autocontext=line3
+;[line2]
+;type=trunk
+;device=Zap/4
+;autocontext=line2
 
-[line4]
-type=trunk
-device=Zap/4
-autocontext=line4
+;[line3]
+;type=trunk
+;device=Zap/3
+;autocontext=line3
+
+;[line4]
+;type=trunk
+;device=Zap/4
+;autocontext=line4
 ; --------------------------------------
 
 
 ; ---- Station Declarations ------------
 
-; In this example, all stations have the same trunks, so this configuration
-; template is used to simplify the declaration of each station.
-[station](!)
-; This line indicates that this entry is a station.
-type=station
-; This supports automatic generation of the dialplan entries if the autocontext
-; option is used.  All stations can use the same context without conflict.  The
-; device for this station should have its context configured to the same one
-; listed here.
-autocontext=sla_stations
-; Set a timeout for how long to allow the station to ring for an incoming call.
-; This is specified in seconds.
-ringtimeout=10
-; Individually list all of the trunks that will appear on this station.  This
-; order is significant.  It should be the same order as they appear on the
-; phone.  The order here defines the order of preference that the trunks will
-; be used.
-trunk=line1
-trunk=line2
-trunk=line3
-; A ring timeout for the station can also be specified for a specific trunk.
-; If a ring timeout is specified both for the whole station and for a specific
-; trunk on a station, the setting for the specific trunk will take priority.
-; This value is in seconds.
-trunk=line4,ringtimeout=5
+;type=station                       ; This line indicates that this entry is a station.
 
-; Define a station that uses the configuration from the template "station".
-[station1](station)
-; Each station must be mapped to a device.
-device=SIP/station1
+;autocontext=sla_stations           ; This supports automatic generation of the dialplan entries if 
+                                    ; the autocontext option is used.  All stations can use the same 
+                                    ; context without conflict.  The device for this station should 
+                                    ; have its context configured to the same one listed here.
 
-[station2](station)
-device=SIP/station2
+;ringtimeout=10                     ; Set a timeout for how long to allow the station to ring for an 
+;                                   ; incoming call, in seconds.
 
-[station3](station)
-device=SIP/station3
 
-[station4](station)
-device=SIP/station4
+;trunk=line1                        ; Individually list all of the trunks that will appear on this station.  This
+                                    ; order is significant.  It should be the same order as they appear on the
+                                    ; phone.  The order here defines the order of preference that the trunks will
+                                    ; be used.
+;trunk=line2
+;trunk=line3
+;trunk=line4,ringtimeout=5          ; A ring timeout for the station can also be specified for a specific trunk.
+                                    ; If a ring timeout is specified both for the whole station and for a specific
+                                    ; trunk on a station, the setting for the specific trunk will take priority.
+                                    ; This value is in seconds.
 
-[station5](station)
-device=SIP/station5
+
+;[station1](station)                ; Define a station that uses the configuration from the template "station".
+;device=SIP/station1                ; Each station must be mapped to a device.
+;
+;[station2](station)
+;device=SIP/station2
+;
+;[station3](station)
+;device=SIP/station3
+;
+;[station4](station)
+;device=SIP/station4
+;
+;[station5](station)
+;device=SIP/station5
 ; --------------------------------------
 

Modified: team/russell/sla_updates/res/res_jabber.c
URL: http://svn.digium.com/view/asterisk/team/russell/sla_updates/res/res_jabber.c?view=diff&rev=55586&r1=55585&r2=55586
==============================================================================
--- team/russell/sla_updates/res/res_jabber.c (original)
+++ team/russell/sla_updates/res/res_jabber.c Tue Feb 20 11:24:08 2007
@@ -344,7 +344,7 @@
 		ast_log(LOG_ERROR, "This application requires arguments.\n");
 		return 0;
 	}
-	s = ast_strdupa((char *) data);
+	s = ast_strdupa(data);
 	if (s) {
 		sender = strsep(&s, "|");
 		if (sender && (sender[0] != '\0')) {
@@ -404,7 +404,7 @@
 		ast_log(LOG_ERROR, "This application requires arguments.\n");
 		return 0;
 	}
-	s = ast_strdupa((char *) data);
+	s = ast_strdupa(data);
 	if (s) {
 		sender = strsep(&s, "|");
 		if (sender && (sender[0] != '\0')) {



More information about the asterisk-commits mailing list