void unlink_subscription(subscription_link_t* link) { subscription_list_t* list = link->list; DEBUGF("unlink_subscription: %s", format_subscription(link->s)); if (link->prev != NULL) link->prev->next = link->next; else list->first = link->next; if (link->next != NULL) link->next->prev = link->prev; else list->last = link->prev; list->length--; release_subscription(link->s); free(link); }
/** * Terminates a dialog - called before del_s_dialog to send out terminatination messages. * @param d - the dialog to terminate * @returns - 1 if the requests were sent and the dialog will be deleted, 0 on error (you will have to delete the * dialog yourself!) */ int terminate_s_dialog(s_dialog *d) { if (!scscf_dialogs_enable_release) return 0; switch (d->method){ case DLG_METHOD_INVITE: if (release_call_s(d,Reason)<=0){ //dialog has expired and not confirmed // or error releasing dialog del_s_dialog(d); } return 1; break; case DLG_METHOD_SUBSCRIBE: if (!release_subscription(d)){ //error releasing the subscription - just drop silently del_s_dialog(d); } return 1; break; default: LOG(L_ERR,"ERR:"M_NAME":terminate_s_dialog(): Not implemented yet for method[%d]!\n",d->method); return 0; } }