mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-16 14:58:25 +00:00
Merge "res_pjsip: Fix initialization of extended stringfields." into 13
This commit is contained in:
@@ -118,16 +118,15 @@ static void *contact_alloc(const char *name)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (ast_string_field_init(contact, 256)) {
|
||||
if (ast_string_field_init(contact, 256)
|
||||
|| ast_string_field_init_extended(contact, endpoint_name)
|
||||
|| ast_string_field_init_extended(contact, reg_server)
|
||||
|| ast_string_field_init_extended(contact, via_addr)
|
||||
|| ast_string_field_init_extended(contact, call_id)) {
|
||||
ao2_cleanup(contact);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ast_string_field_init_extended(contact, endpoint_name);
|
||||
ast_string_field_init_extended(contact, reg_server);
|
||||
ast_string_field_init_extended(contact, via_addr);
|
||||
ast_string_field_init_extended(contact, call_id);
|
||||
|
||||
/* Dynamic contacts are delimited with ";@" and static ones with "@@" */
|
||||
if ((aor_separator = strstr(id, ";@")) || (aor_separator = strstr(id, "@@"))) {
|
||||
*aor_separator = '\0';
|
||||
|
||||
@@ -2197,13 +2197,12 @@ void *ast_sip_endpoint_alloc(const char *name)
|
||||
if (!endpoint) {
|
||||
return NULL;
|
||||
}
|
||||
if (ast_string_field_init(endpoint, 64)) {
|
||||
if (ast_string_field_init(endpoint, 64)
|
||||
|| ast_string_field_init_extended(endpoint, incoming_mwi_mailbox)) {
|
||||
ao2_cleanup(endpoint);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ast_string_field_init_extended(endpoint, incoming_mwi_mailbox);
|
||||
|
||||
if (!(endpoint->media.codecs = ast_format_cap_alloc(AST_FORMAT_CAP_FLAG_DEFAULT))) {
|
||||
ao2_cleanup(endpoint);
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user