[Asterisk-code-review] core: Warn about Entity ID is not set or invalid (asterisk[13])

Alexei Gradinari asteriskteam at digium.com
Wed Aug 10 14:54:38 CDT 2016


Alexei Gradinari has uploaded a new change for review.

  https://gerrit.asterisk.org/3456

Change subject: core: Warn about Entity ID is not set or invalid
......................................................................

core: Warn about Entity ID is not set or invalid

The Exchanging Device and Mailbox States could not working
if the Entity ID (EID) is not set manually and can't be obtained
from ethernet interface.

This patch replaces debug message to warnning
and addes missing description about option 'entityid' to
asterisk.conf.sample.

ASTERISK-26164 #close

Change-Id: I72d712f1ad5b6f64571bb179c5cb12461e7c58c6
---
M configs/samples/asterisk.conf.sample
M main/asterisk.c
M main/utils.c
3 files changed, 12 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/56/3456/1

diff --git a/configs/samples/asterisk.conf.sample b/configs/samples/asterisk.conf.sample
index e4883ec..b0543d8 100644
--- a/configs/samples/asterisk.conf.sample
+++ b/configs/samples/asterisk.conf.sample
@@ -88,6 +88,14 @@
 				; considered dangerous because they can allow
 				; privilege escalation.
 				; Default no
+;entityid=00:11:22:33:44:55	; Entity ID.
+				; This is in the form of a MAC address.
+				; It should be universally unique.
+				; It must be unique between servers communicating
+				; with a protocol that uses this value.
+				; This is currently is used by DUNDi and
+				; Exchanging Device and Mailbox State
+				; using protocols: XMPP, Corosync and PJSIP.
 
 ; Changing the following lines may compromise your security.
 ;[files]
diff --git a/main/asterisk.c b/main/asterisk.c
index 772c3dc..b23ddfc 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -3752,10 +3752,10 @@
 		} else if (!strcasecmp(v->name, "entityid")) {
 			struct ast_eid tmp_eid;
 			if (!ast_str_to_eid(&tmp_eid, v->value)) {
-				ast_verbose("Successfully set global EID to '%s'\n", v->value);
 				ast_eid_default = tmp_eid;
-			} else
-				ast_verbose("Invalid Entity ID '%s' provided\n", v->value);
+			} else {
+				ast_log(LOG_WARNING, "Invalid Entity ID '%s' provided\n", v->value);
+			}
 		} else if (!strcasecmp(v->name, "lightbackground")) {
 			ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_LIGHT_BACKGROUND);
 		} else if (!strcasecmp(v->name, "forceblackbackground")) {
diff --git a/main/utils.c b/main/utils.c
index bd74ee2..e69e8ad 100644
--- a/main/utils.c
+++ b/main/utils.c
@@ -2544,7 +2544,7 @@
 	}
 #endif
 #endif
-	ast_debug(1, "No ethernet interface found for seeding global EID. You will have to set it manually.\n");
+	ast_log(LOG_WARNING, "No ethernet interface found for seeding global EID. You will have to set it manually.\n");
 }
 
 int ast_str_to_eid(struct ast_eid *eid, const char *s)

-- 
To view, visit https://gerrit.asterisk.org/3456
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I72d712f1ad5b6f64571bb179c5cb12461e7c58c6
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Alexei Gradinari <alex2grad at gmail.com>



More information about the asterisk-code-review mailing list