static void *acl_alloc(const char *name) { struct ast_sip_acl *sip_acl = ast_sorcery_generic_alloc(sizeof(*sip_acl), acl_destroy); return sip_acl; }
/*! \brief Allocator for contact */ static void *contact_alloc(const char *name) { struct ast_sip_contact *contact = ast_sorcery_generic_alloc(sizeof(*contact), contact_destroy); char *id = ast_strdupa(name); char *aor = id; char *aor_separator = NULL; if (!contact) { return NULL; } if (ast_string_field_init(contact, 256)) { ao2_cleanup(contact); return NULL; } /* Dynamic contacts are delimited with ";@" and static ones with "@@" */ if ((aor_separator = strstr(id, ";@")) || (aor_separator = strstr(id, "@@"))) { *aor_separator = '\0'; } ast_assert(aor_separator != NULL); ast_string_field_set(contact, aor, aor); return contact; }
/*! * \internal * \brief Create a ast_sip_contact_status object. */ static void *contact_status_alloc(const char *name) { struct ast_sip_contact_status *status = ast_sorcery_generic_alloc(sizeof(*status), contact_status_destroy); char *id = ast_strdupa(name); char *aor = id; char *aor_separator = NULL; if (!status) { ast_log(LOG_ERROR, "Unable to allocate ast_sip_contact_status\n"); return NULL; } if (ast_string_field_init(status, 256)) { ast_log(LOG_ERROR, "Unable to allocate ast_sip_contact_status stringfields\n"); ao2_cleanup(status); return NULL; } /* Dynamic contacts are delimited with ";@" and static ones with "@@" */ if ((aor_separator = strstr(id, ";@")) || (aor_separator = strstr(id, "@@"))) { *aor_separator = '\0'; } ast_assert(aor_separator != NULL); ast_string_field_set(status, aor, aor); status->status = CREATED; return status; }
/*! \brief Allocator for AOR */ static void *aor_alloc(const char *name) { struct ast_sip_aor *aor = ast_sorcery_generic_alloc(sizeof(struct ast_sip_aor), aor_destroy); if (!aor) { return NULL; } ast_string_field_init(aor, 128); return aor; }
/*! * \internal * \brief Create a ast_sip_contact_status object. */ static void *contact_status_alloc(const char *name) { struct ast_sip_contact_status *status = ast_sorcery_generic_alloc(sizeof(*status), NULL); if (!status) { ast_log(LOG_ERROR, "Unable to allocate ast_sip_contact_status\n"); return NULL; } status->status = UNKNOWN; return status; }
static void *domain_alias_alloc(const char *name) { struct ast_sip_domain_alias *alias = ast_sorcery_generic_alloc(sizeof(*alias), domain_alias_destroy); if (!alias) { return NULL; } if (ast_string_field_init(alias, 256)) { ao2_cleanup(alias); return NULL; } return alias; }
/*! \brief Allocator for transport */ static void *sip_transport_alloc(const char *name) { struct ast_sip_transport *transport = ast_sorcery_generic_alloc(sizeof(*transport), sip_transport_destroy); if (!transport) { return NULL; } if (ast_string_field_init(transport, 256)) { ao2_cleanup(transport); return NULL; } return transport; }
static void *auth_alloc(const char *name) { struct ast_sip_auth *auth = ast_sorcery_generic_alloc(sizeof(*auth), auth_destroy); if (!auth) { return NULL; } if (ast_string_field_init(auth, 64)) { ao2_cleanup(auth); return NULL; } return auth; }
/*! \brief Allocator for contact */ static void *contact_alloc(const char *name) { struct ast_sip_contact *contact = ast_sorcery_generic_alloc(sizeof(*contact), contact_destroy); if (!contact) { return NULL; } if (ast_string_field_init(contact, 256)) { ao2_cleanup(contact); return NULL; } return contact; }
static void *respoke_app_alloc(const char *name) { struct respoke_app *app = ast_sorcery_generic_alloc( sizeof(*app), respoke_app_destroy); if (!app) { return NULL; } if (ast_string_field_init(app, 256)) { ao2_ref(app, -1); return NULL; } return app; }
/*! \brief Allocator for transport */ static void *transport_alloc(const char *name) { struct ast_sip_transport *transport = ast_sorcery_generic_alloc(sizeof(*transport), transport_destroy); if (!transport) { return NULL; } if (ast_string_field_init(transport, 256)) { ao2_cleanup(transport); return NULL; } pjsip_tls_setting_default(&transport->tls); transport->tls.ciphers = transport->ciphers; return transport; }
/*! \brief Internal function to allocate a test object */ static void *test_sorcery_object_alloc(const char *id) { return ast_sorcery_generic_alloc(sizeof(struct test_sorcery_object), NULL); }
/*! \brief Internal function to allocate a mwi object */ static void *mwi_sorcery_object_alloc(const char *id) { return ast_sorcery_generic_alloc(sizeof(struct ast_mwi_mailbox_object), NULL); }