[svn-commits] trunk r26884 - in /trunk: ./ channels/ configs/ doc/

svn-commits at lists.digium.com svn-commits at lists.digium.com
Thu May 11 06:54:01 MST 2006


Author: oej
Date: Thu May 11 08:54:00 2006
New Revision: 26884

URL: http://svn.digium.com/view/asterisk?rev=26884&view=rev
Log:
- Use systemname for realm in sip, if we have no configuration for realm
- Optionally send systemname in manager (cool when you have a manager proxy)
- Use systemname in CLI prompt

Modified:
    trunk/asterisk.c
    trunk/channels/chan_sip.c
    trunk/configs/manager.conf.sample
    trunk/configs/sip.conf.sample
    trunk/doc/cliprompt.txt
    trunk/manager.c

Modified: trunk/asterisk.c
URL: http://svn.digium.com/view/asterisk/trunk/asterisk.c?rev=26884&r1=26883&r2=26884&view=diff
==============================================================================
--- trunk/asterisk.c (original)
+++ trunk/asterisk.c Thu May 11 08:54:00 2006
@@ -1644,6 +1644,9 @@
 					}
 					break;
 #endif
+				case 's': /* Asterisk system name (from asterisk.conf) */
+					strncat(p, ast_config_AST_SYSTEM_NAME, sizeof(prompt) - strlen(prompt) - 1);
+					break;
 				case 't': /* time */
 					memset(&tm, 0, sizeof(tm));
 					time(&ts);

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?rev=26884&r1=26883&r2=26884&view=diff
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Thu May 11 08:54:00 2006
@@ -13260,7 +13260,10 @@
 	global_allowsubscribe = FALSE;
 	ast_copy_string(global_useragent, DEFAULT_USERAGENT, sizeof(global_useragent));
 	ast_copy_string(default_notifymime, DEFAULT_NOTIFYMIME, sizeof(default_notifymime));
-	ast_copy_string(global_realm, DEFAULT_REALM, sizeof(global_realm));
+	if (ast_strlen_zero(ast_config_AST_SYSTEM_NAME))
+		ast_copy_string(global_realm, DEFAULT_REALM, sizeof(global_realm));
+	else
+		ast_copy_string(global_realm, ast_config_AST_SYSTEM_NAME, sizeof(global_realm));
 	ast_copy_string(default_callerid, DEFAULT_CALLERID, sizeof(default_callerid));
 	compactheaders = DEFAULT_COMPACTHEADERS;
 	global_reg_timeout = DEFAULT_REGISTRATION_TIMEOUT;

Modified: trunk/configs/manager.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/manager.conf.sample?rev=26884&r1=26883&r2=26884&view=diff
==============================================================================
--- trunk/configs/manager.conf.sample (original)
+++ trunk/configs/manager.conf.sample Thu May 11 08:54:00 2006
@@ -21,6 +21,7 @@
 ; default is 60 seconds.
 ;
 [general]
+displaysystemname = yes
 enabled = no
 ;webenabled = yes
 port = 5038

Modified: trunk/configs/sip.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/sip.conf.sample?rev=26884&r1=26883&r2=26884&view=diff
==============================================================================
--- trunk/configs/sip.conf.sample (original)
+++ trunk/configs/sip.conf.sample Thu May 11 08:54:00 2006
@@ -32,7 +32,8 @@
 ;allowtransfer=no		; Disable all transfers (unless enabled in peers or users)
 				; Default is enabled
 ;realm=mydomain.tld		; Realm for digest authentication
-				; defaults to "asterisk"
+				; defaults to "asterisk". If you set a system name in
+				; asterisk.conf, it defaults to that system name
 				; Realms MUST be globally unique according to RFC 3261
 				; Set this to your host name or domain name
 bindport=5060			; UDP Port to bind to (SIP standard port is 5060)

Modified: trunk/doc/cliprompt.txt
URL: http://svn.digium.com/view/asterisk/trunk/doc/cliprompt.txt?rev=26884&r1=26883&r2=26884&view=diff
==============================================================================
--- trunk/doc/cliprompt.txt (original)
+++ trunk/doc/cliprompt.txt Thu May 11 08:54:00 2006
@@ -8,6 +8,7 @@
 the current value by Asterisk:
 
 %d	Date (year-month-date)
+%s	Asterisk system name (from asterisk.conf)
 %h	Full hostname
 %H	Short hostname
 %t	Time

Modified: trunk/manager.c
URL: http://svn.digium.com/view/asterisk/trunk/manager.c?rev=26884&r1=26883&r2=26884&view=diff
==============================================================================
--- trunk/manager.c (original)
+++ trunk/manager.c Thu May 11 08:54:00 2006
@@ -158,6 +158,7 @@
 	char inbuf[AST_MAX_MANHEADER_LEN];
 	int inlen;
 	int send_events;
+	int displaysystemname;		/*!< Add system name to manager responses and events */
 	/* Queued events that we've not had the ability to send yet */
 	struct eventqent *eventq;
 	/* Timeout for ast_carefulwrite() */
@@ -772,6 +773,14 @@
 				while (v) {
 					if (!strcasecmp(v->name, "secret")) {
 						password = v->value;
+					} else if (!strcasecmp(v->name, "displaysystemname")) {
+						if (ast_true(v->value)) {
+							if (ast_strlen_zero(ast_config_AST_SYSTEM_NAME)) {
+								s->displaysystemname = 1;
+							} else {
+								ast_log(LOG_ERROR, "Can't enable displaysystemname in manager.conf - no system name configured in asterisk.conf\n");
+							}
+						}
 					} else if (!strcasecmp(v->name, "permit") ||
 						   !strcasecmp(v->name, "deny")) {
 						ha = ast_append_ha(v->name, v->value, ha);



More information about the svn-commits mailing list