[asterisk-commits] markster: branch markster/usersconf r42878 - /team/markster/usersconf/channels/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Sep 12 22:24:56 MST 2006


Author: markster
Date: Wed Sep 13 00:24:55 2006
New Revision: 42878

URL: http://svn.digium.com/view/asterisk?rev=42878&view=rev
Log:
Add programmable contact

Modified:
    team/markster/usersconf/channels/chan_sip.c

Modified: team/markster/usersconf/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/markster/usersconf/channels/chan_sip.c?rev=42878&r1=42877&r2=42878&view=diff
==============================================================================
--- team/markster/usersconf/channels/chan_sip.c (original)
+++ team/markster/usersconf/channels/chan_sip.c Wed Sep 13 00:24:55 2006
@@ -15911,17 +15911,20 @@
 					char *host = ast_variable_retrieve(ucfg, cat, "host");
 					char *username = ast_variable_retrieve(ucfg, cat, "username");
 					char *secret = ast_variable_retrieve(ucfg, cat, "secret");
+					char *contact = ast_variable_retrieve(ucfg, cat, "contact");
 					if (!host)
 						host = ast_variable_retrieve(ucfg, "general", "host");
 					if (!username)
 						username = ast_variable_retrieve(ucfg, "general", "username");
 					if (!secret)
 						secret = ast_variable_retrieve(ucfg, "general", "secret");
+					if (!contact)
+						contact = "s";
 					if (!ast_strlen_zero(username) && !ast_strlen_zero(host)) {
 						if (!ast_strlen_zero(secret))
-							snprintf(tmp, sizeof(tmp), "%s:%s@%s", username, secret, host);
+							snprintf(tmp, sizeof(tmp), "%s:%s@%s/%s", username, secret, host, contact);
 						else
-							snprintf(tmp, sizeof(tmp), "%s@%s", username, host);
+							snprintf(tmp, sizeof(tmp), "%s@%s/%s", username, host, contact);
 						if (sip_register(tmp, 0) == 0)
 							registry_count++;
 					}



More information about the asterisk-commits mailing list