summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlle Johansson <oej@edvina.net>2006-10-30 19:56:14 +0000
committerOlle Johansson <oej@edvina.net>2006-10-30 19:56:14 +0000
commitf98f457727a7525b696c4cff88d0a3c808456c87 (patch)
treefcf609172ae456d997af56ec6bbf3a62f200caa4
parent753a03161da52342883402bebb241f05df7e1a3e (diff)
Change name of "contact" setting to "callback" which better reflects what it
is to the person that configures asterisk. That we use it internally in the contact header is a totally different story. Still not convinced this is a good option. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46489 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--channels/chan_sip.c29
-rw-r--r--configs/sip.conf.sample8
2 files changed, 19 insertions, 18 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 6544972a3..fbe7ed1d6 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -1125,7 +1125,7 @@ struct sip_registry {
AST_STRING_FIELD(hostname); /*!< Domain or host we register to */
AST_STRING_FIELD(secret); /*!< Password in clear text */
AST_STRING_FIELD(md5secret); /*!< Password in md5 */
- AST_STRING_FIELD(contact); /*!< Contact extension */
+ AST_STRING_FIELD(callback); /*!< Contact extension */
AST_STRING_FIELD(random);
);
int portno; /*!< Optional port override */
@@ -4413,7 +4413,7 @@ static int sip_register(char *value, int lineno)
char username[256] = "";
char *hostname=NULL, *secret=NULL, *authuser=NULL;
char *porta=NULL;
- char *contact=NULL;
+ char *callback=NULL;
if (!value)
return -1;
@@ -4435,11 +4435,11 @@ static int sip_register(char *value, int lineno)
*authuser++ = '\0';
}
/* split host[:port][/contact] */
- contact = strchr(hostname, '/');
- if (contact)
- *contact++ = '\0';
- if (ast_strlen_zero(contact))
- contact = "s";
+ callback = strchr(hostname, '/');
+ if (callback)
+ *callback++ = '\0';
+ if (ast_strlen_zero(callback))
+ callback = "s";
porta = strchr(hostname, ':');
if (porta) {
*porta++ = '\0';
@@ -4462,7 +4462,7 @@ static int sip_register(char *value, int lineno)
regobjs++;
ASTOBJ_INIT(reg);
- ast_string_field_set(reg, contact, contact);
+ ast_string_field_set(reg, callback, callback);
if (username)
ast_string_field_set(reg, username, username);
if (hostname)
@@ -7156,7 +7156,8 @@ static int transmit_register(struct sip_registry *r, int sipmethod, const char *
if (!ast_strlen_zero(r->username))
ast_string_field_set(p, username, r->username);
/* Save extension in packet */
- ast_string_field_set(p, exten, r->contact);
+ if (!ast_strlen_zero(r->callback))
+ ast_string_field_set(p, exten, r->callback);
/*
check which address we should use in our contact header
@@ -15643,7 +15644,7 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
time_t regseconds = 0;
struct ast_flags peerflags[2] = {{(0)}};
struct ast_flags mask[2] = {{(0)}};
- char contact[256] = "";
+ char callback[256] = "";
if (!realtime)
@@ -15779,8 +15780,8 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
ast_copy_string(peer->language, v->value, sizeof(peer->language));
} else if (!strcasecmp(v->name, "regexten")) {
ast_copy_string(peer->regexten, v->value, sizeof(peer->regexten));
- } else if (!strcasecmp(v->name, "contact")) {
- ast_copy_string(contact, v->value, sizeof(contact));
+ } else if (!strcasecmp(v->name, "callbackextension")) {
+ ast_copy_string(callback, v->value, sizeof(callback));
} else if (!strcasecmp(v->name, "call-limit")) {
peer->call_limit = atoi(v->value);
if (peer->call_limit < 0)
@@ -15873,10 +15874,10 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
reg_source_db(peer);
ASTOBJ_UNMARK(peer);
ast_free_ha(oldha);
- if (!ast_strlen_zero(contact)) { /* build string from peer info */
+ if (!ast_strlen_zero(callback)) { /* build string from peer info */
char *reg_string;
- asprintf(&reg_string, "%s:%s@%s/%s", peer->username, peer->secret, peer->tohost, contact);
+ asprintf(&reg_string, "%s:%s@%s/%s", peer->username, peer->secret, peer->tohost, callback);
if (reg_string) {
sip_register(reg_string, 0); /* XXX TODO: count in registry_count */
free(reg_string);
diff --git a/configs/sip.conf.sample b/configs/sip.conf.sample
index cfbe1dda4..1d79cb303 100644
--- a/configs/sip.conf.sample
+++ b/configs/sip.conf.sample
@@ -192,10 +192,10 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls
; host is either a host name defined in DNS or the name of a section defined
; below.
;
-; A similar effect can be achieved by adding a "contact" option in a peer section.
+; A similar effect can be achieved by adding a "callbackextension" option in a peer section.
; this is equivalent to having the following line in the general section:
;
-; register => username:secret@host/contact
+; register => username:secret@host/callbackextension
;
; and more readable because you don't have to write the parameters in two places
; (note that the "port" is ignored - this is a bug that should be fixed).
@@ -450,7 +450,7 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls
; sendrpid
; outboundproxy
; rfc2833compensate
-; contact
+; callbackextension
;[sip_proxy]
; For incoming calls only. Example: FWD (Free World Dialup)
@@ -479,7 +479,7 @@ srvlookup=yes ; Enable DNS SRV lookups on outbound calls
;host=sip.provider1.com
;username=4015552299 ; how your provider knows you
;secret=youwillneverguessit
-;contact=123 ; tell asterisk to register as username:secret@host/contact
+;callbackextension=123 ; Register with this server and require calls coming back to this extension
;------------------------------------------------------------------------------
; Definitions of locally connected SIP devices