aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2007-12-05 13:09:47 +0000
committeroej <oej@f38db490-d61c-443f-a65b-d21fe96a405b>2007-12-05 13:09:47 +0000
commit8febb656a24ff9a09fb20925741eee7a8fb32efa (patch)
treebd0e84d72e05831d8b2cbb2e0d0f031258ca3cfe
parent8694b5efff61e2e92c2ccbec5f7c174cb3c78425 (diff)
Rename "username" to "defaultuser" to match with "defaultip".
"Username" still works, but is deprecated. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@91152 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--UPGRADE.txt5
-rw-r--r--channels/chan_sip.c10
-rw-r--r--configs/sip.conf.sample11
3 files changed, 16 insertions, 10 deletions
diff --git a/UPGRADE.txt b/UPGRADE.txt
index a8eccb4ea..82374eb59 100644
--- a/UPGRADE.txt
+++ b/UPGRADE.txt
@@ -121,6 +121,11 @@ Channel Drivers:
Asterisk, but will be removed in the following version. Please use the groupcount functions
in the dialplan to enforce call limits. The "limitonpeer" configuration option is
now renamed to "counteronpeer".
+* SIP: The "username" option is now renamed to "defaultuser" to match "defaultip".
+ These are used only before registration to call a peer with the uri
+ sip:defaultuser@defaultip
+ The "username" setting still work, but is deprecated and will not work in
+ the next version of Asterisk.
* chan_local.c: the comma delimiter inside the channel name has been changed to a
semicolon, in order to make the Local channel driver compatible with the comma
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 26965318d..06a84b5c5 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -2887,7 +2887,7 @@ static int sip_sendtext(struct ast_channel *ast, const char *text)
that name and store that in the "regserver" field in the sippeers
table to facilitate multi-server setups.
*/
-static void realtime_update_peer(const char *peername, struct sockaddr_in *sin, const char *username, const char *fullcontact, int expirey)
+static void realtime_update_peer(const char *peername, struct sockaddr_in *sin, const char *defaultuser, const char *fullcontact, int expirey)
{
char port[10];
char ipaddr[INET_ADDRSTRLEN];
@@ -2916,11 +2916,11 @@ static void realtime_update_peer(const char *peername, struct sockaddr_in *sin,
if (fc)
ast_update_realtime(tablename, "name", peername, "ipaddr", ipaddr,
"port", port, "regseconds", regseconds,
- "username", username, fc, fullcontact, syslabel, sysname, NULL); /* note fc and syslabel _can_ be NULL */
+ "defaultuser", defaultuser, fc, fullcontact, syslabel, sysname, NULL); /* note fc and syslabel _can_ be NULL */
else
ast_update_realtime(tablename, "name", peername, "ipaddr", ipaddr,
"port", port, "regseconds", regseconds,
- "username", username, syslabel, sysname, NULL); /* note syslabel _can_ be NULL */
+ "defaultuser", defaultuser, syslabel, sysname, NULL); /* note syslabel _can_ be NULL */
}
/*! \brief Automatically add peer extension to dial plan */
@@ -8660,7 +8660,7 @@ static void destroy_association(struct sip_peer *peer)
if (!sip_cfg.ignore_regexpire) {
if (peer->rt_fromcontact)
- ast_update_realtime(tablename, "name", peer->name, "fullcontact", "", "ipaddr", "", "port", "", "regseconds", "0", "username", "", "regserver", "", NULL);
+ ast_update_realtime(tablename, "name", peer->name, "fullcontact", "", "ipaddr", "", "port", "", "regseconds", "0", "defaultuser", "", "regserver", "", NULL);
else
ast_db_del("SIP/Registry", peer->name);
}
@@ -17961,7 +17961,7 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
peer->callingpres = ast_parse_caller_presentation(v->value);
if (peer->callingpres == -1)
peer->callingpres = atoi(v->value);
- } else if (!strcasecmp(v->name, "username")) {
+ } else if (!strcasecmp(v->name, "username") | !strcmp(v->name, "defaultuser")) { /* "username" is deprecated */
ast_copy_string(peer->username, v->value, sizeof(peer->username));
} else if (!strcasecmp(v->name, "language")) {
ast_copy_string(peer->language, v->value, sizeof(peer->language));
diff --git a/configs/sip.conf.sample b/configs/sip.conf.sample
index 91792bd61..131bc07ae 100644
--- a/configs/sip.conf.sample
+++ b/configs/sip.conf.sample
@@ -582,7 +582,6 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls
; maxcallbitrate maxcallbitrate
; rfc2833compensate mailbox
; busylevel
-; username
; template
; fromdomain
; regexten
@@ -591,6 +590,7 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls
; port
; qualify
; defaultip
+; defaultuser
; rtptimeout
; rtpholdtimeout
; sendrpid
@@ -610,7 +610,7 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls
;[sip_proxy-out]
;type=peer ; we only want to call out, not be called
;secret=guessit
-;username=yourusername ; Authentication user for outbound proxies
+;defaultuser=yourusername ; Authentication user for outbound proxies
;fromuser=yourusername ; Many SIP providers require this!
;fromdomain=provider.sip.domain
;host=box.provider.com
@@ -625,7 +625,7 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls
;[provider1]
;type=peer
;host=sip.provider1.com
-;username=4015552299 ; how your provider knows you
+;fromuser=4015552299 ; how your provider knows you
;secret=youwillneverguessit
;callbackextension=123 ; Register with this server and require calls coming back to this extension
@@ -760,7 +760,8 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls
;secret=blahpoly
;host=dynamic ; This peer register with us
;dtmfmode=rfc2833 ; Choices are inband, rfc2833, or info
-;username=polly ; Username to use in INVITE until peer registers
+;defaultuser=polly ; Username to use in INVITE until peer registers
+;defaultip=192.168.40.123
; Normally you do NOT need to set this parameter
;disallow=all
;allow=ulaw ; dtmfmode=inband only works with ulaw or alaw!
@@ -801,7 +802,7 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls
; support this (especially if one of them is
; behind a NAT).
;defaultip=192.168.0.4 ; IP address to use until registration
-;username=goran ; Username to use when calling this device before registration
+;defaultuser=goran ; Username to use when calling this device before registration
; Normally you do NOT need to set this parameter
;setvar=CUSTID=5678 ; Channel variable to be set for all calls from this device