|
|
@ -9733,6 +9733,7 @@ static int transmit_register(struct sip_registry *r, int sipmethod, const char *
|
|
|
|
char addr[80];
|
|
|
|
char addr[80];
|
|
|
|
struct sip_pvt *p;
|
|
|
|
struct sip_pvt *p;
|
|
|
|
int res;
|
|
|
|
int res;
|
|
|
|
|
|
|
|
char *fromdomain;
|
|
|
|
|
|
|
|
|
|
|
|
/* exit if we are already in process with this registrar ?*/
|
|
|
|
/* exit if we are already in process with this registrar ?*/
|
|
|
|
if (r == NULL || ((auth == NULL) && (r->regstate == REG_STATE_REGSENT || r->regstate == REG_STATE_AUTHSENT))) {
|
|
|
|
if (r == NULL || ((auth == NULL) && (r->regstate == REG_STATE_REGSENT || r->regstate == REG_STATE_AUTHSENT))) {
|
|
|
@ -9851,12 +9852,19 @@ static int transmit_register(struct sip_registry *r, int sipmethod, const char *
|
|
|
|
ast_debug(1, "Scheduled a registration timeout for %s id #%d \n", r->hostname, r->timeout);
|
|
|
|
ast_debug(1, "Scheduled a registration timeout for %s id #%d \n", r->hostname, r->timeout);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (strchr(r->username, '@')) {
|
|
|
|
if ((fromdomain = strchr(r->username, '@'))) {
|
|
|
|
|
|
|
|
/* We have a domain in the username for registration */
|
|
|
|
snprintf(from, sizeof(from), "<sip:%s>;tag=%s", r->username, p->tag);
|
|
|
|
snprintf(from, sizeof(from), "<sip:%s>;tag=%s", r->username, p->tag);
|
|
|
|
if (!ast_strlen_zero(p->theirtag))
|
|
|
|
if (!ast_strlen_zero(p->theirtag))
|
|
|
|
snprintf(to, sizeof(to), "<sip:%s>;tag=%s", r->username, p->theirtag);
|
|
|
|
snprintf(to, sizeof(to), "<sip:%s>;tag=%s", r->username, p->theirtag);
|
|
|
|
else
|
|
|
|
else
|
|
|
|
snprintf(to, sizeof(to), "<sip:%s>", r->username);
|
|
|
|
snprintf(to, sizeof(to), "<sip:%s>", r->username);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* If the registration username contains '@', then the domain should be used as
|
|
|
|
|
|
|
|
the equivalent of "fromdomain" for the registration */
|
|
|
|
|
|
|
|
if (ast_strlen_zero(p->fromdomain)) {
|
|
|
|
|
|
|
|
ast_string_field_set(p, fromdomain, ++fromdomain);
|
|
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
snprintf(from, sizeof(from), "<sip:%s@%s>;tag=%s", r->username, p->tohost, p->tag);
|
|
|
|
snprintf(from, sizeof(from), "<sip:%s@%s>;tag=%s", r->username, p->tohost, p->tag);
|
|
|
|
if (!ast_strlen_zero(p->theirtag))
|
|
|
|
if (!ast_strlen_zero(p->theirtag))
|
|
|
|