[asterisk-dev] fix for domains with empty context

Andrey Rouskol anry at sovintel.ru
Wed Jul 12 22:29:31 MST 2006


Hello everyone,

According to examples in sip.conf it should be possible to specify domain
without any bounded context. Asterisk (1.2.9.1) does not accept such a
domain and produces a warning message "Empty context specified ...".

Attached patch is very simple, but I am not sure should asterisk still
provide a warning.

Best regards,

Andrey.
-------------- next part --------------
diff -ur asterisk-1.2.9.1/channels/chan_sip.c asterisk-1.2.9.1.fix/channels/chan_sip.c
--- asterisk-1.2.9.1/channels/chan_sip.c	2006-05-25 21:18:01.000000000 +0400
+++ asterisk-1.2.9.1.fix/channels/chan_sip.c	2006-07-12 15:07:20.000000000 +0400
@@ -12704,10 +12704,12 @@
 
 			if (ast_strlen_zero(domain))
 				ast_log(LOG_WARNING, "Empty domain specified at line %d\n", v->lineno);
-			else if (ast_strlen_zero(context))
-				ast_log(LOG_WARNING, "Empty context specified at line %d for domain '%s'\n", v->lineno, domain);
-			else
+			else {
+				if (ast_strlen_zero(context))
+					ast_log(LOG_WARNING, "Empty context specified at line %d for domain '%s'\n", v->lineno, domain);
 				add_sip_domain(ast_strip(domain), SIP_DOMAIN_CONFIG, context ? ast_strip(context) : "");
+			}
+
 		} else if (!strcasecmp(v->name, "register")) {
 			sip_register(v->value, v->lineno);
 		} else if (!strcasecmp(v->name, "tos")) {


More information about the asterisk-dev mailing list