|
|
|
@ -24269,22 +24269,6 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
|
|
|
|
|
ast_get_time_t(v->value, ®seconds, 0, NULL);
|
|
|
|
|
} else if (realtime && !strcasecmp(v->name, "name")) {
|
|
|
|
|
ast_copy_string(peer->name, v->value, sizeof(peer->name));
|
|
|
|
|
} else if (realtime && !strcasecmp(v->name, "fullcontact")) {
|
|
|
|
|
if (alt_fullcontact && !alt) {
|
|
|
|
|
/* Reset, because the alternate also has a fullcontact and we
|
|
|
|
|
* do NOT want the field value to be doubled. It might be
|
|
|
|
|
* tempting to skip this, but the first table might not have
|
|
|
|
|
* fullcontact and since we're here, we know that the alternate
|
|
|
|
|
* absolutely does. */
|
|
|
|
|
alt_fullcontact = 0;
|
|
|
|
|
ast_str_reset(fullcontact);
|
|
|
|
|
}
|
|
|
|
|
/* Reconstruct field, because realtime separates our value at the ';' */
|
|
|
|
|
if (fullcontact->used > 0) {
|
|
|
|
|
ast_str_append(&fullcontact, 0, ";%s", v->value);
|
|
|
|
|
} else {
|
|
|
|
|
ast_str_set(&fullcontact, 0, "%s", v->value);
|
|
|
|
|
}
|
|
|
|
|
} else if (!strcasecmp(v->name, "type")) {
|
|
|
|
|
if (!strcasecmp(v->value, "peer")) {
|
|
|
|
|
peer->type |= SIP_TYPE_PEER;
|
|
|
|
@ -24558,6 +24542,22 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
|
|
|
|
|
sscanf(v->value, "%30d", &peer->lastms);
|
|
|
|
|
} else if (realtime && !strcasecmp(v->name, "ipaddr") && !ast_strlen_zero(v->value) ) {
|
|
|
|
|
inet_aton(v->value, &(peer->addr.sin_addr));
|
|
|
|
|
} else if (realtime && !strcasecmp(v->name, "fullcontact")) {
|
|
|
|
|
if (alt_fullcontact && !alt) {
|
|
|
|
|
/* Reset, because the alternate also has a fullcontact and we
|
|
|
|
|
* do NOT want the field value to be doubled. It might be
|
|
|
|
|
* tempting to skip this, but the first table might not have
|
|
|
|
|
* fullcontact and since we're here, we know that the alternate
|
|
|
|
|
* absolutely does. */
|
|
|
|
|
alt_fullcontact = 0;
|
|
|
|
|
ast_str_reset(fullcontact);
|
|
|
|
|
}
|
|
|
|
|
/* Reconstruct field, because realtime separates our value at the ';' */
|
|
|
|
|
if (fullcontact->used > 0) {
|
|
|
|
|
ast_str_append(&fullcontact, 0, ";%s", v->value);
|
|
|
|
|
} else {
|
|
|
|
|
ast_str_set(&fullcontact, 0, "%s", v->value);
|
|
|
|
|
}
|
|
|
|
|
} else if (!strcasecmp(v->name, "qualify")) {
|
|
|
|
|
if (!strcasecmp(v->value, "no")) {
|
|
|
|
|
peer->maxms = 0;
|
|
|
|
@ -24590,7 +24590,6 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!devstate_only) {
|
|
|
|
|
if (!peer->default_outbound_transport) {
|
|
|
|
|
/* Set default set of transports */
|
|
|
|
|
peer->transports = default_transports;
|
|
|
|
@ -24673,7 +24672,7 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Startup regular pokes */
|
|
|
|
|
if (realtime && peer->lastms > 0) {
|
|
|
|
|
if (!devstate_only && realtime && peer->lastms > 0) {
|
|
|
|
|
ref_peer(peer, "schedule qualify");
|
|
|
|
|
sip_poke_peer(peer, 0);
|
|
|
|
|
}
|
|
|
|
@ -24689,7 +24688,7 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
|
|
|
|
|
|
|
|
|
|
/* If they didn't request that MWI is sent *only* on subscribe, go ahead and
|
|
|
|
|
* subscribe to it now. */
|
|
|
|
|
if (!ast_test_flag(&peer->flags[1], SIP_PAGE2_SUBSCRIBEMWIONLY) &&
|
|
|
|
|
if (!devstate_only && !ast_test_flag(&peer->flags[1], SIP_PAGE2_SUBSCRIBEMWIONLY) &&
|
|
|
|
|
!AST_LIST_EMPTY(&peer->mailboxes)) {
|
|
|
|
|
add_peer_mwi_subs(peer);
|
|
|
|
|
/* Send MWI from the event cache only. This is so we can send initial
|
|
|
|
@ -24697,7 +24696,6 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
|
|
|
|
|
* way, then we will get events when app_voicemail gets loaded. */
|
|
|
|
|
sip_send_mwi_to_peer(peer, NULL, 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
peer->the_mark = 0;
|
|
|
|
|
|
|
|
|
|