/* * The http channel context stores pending requests so that they can be matched with response received. * It is associated with the channel when the channel is created, and automatically destroyed when the channel is destroyed. **/ belle_http_channel_context_t * belle_http_channel_context_new(belle_sip_channel_t *chan, belle_http_provider_t *prov){ belle_http_channel_context_t *obj=belle_sip_object_new(belle_http_channel_context_t); obj->provider=prov; belle_sip_channel_add_listener(chan,(belle_sip_channel_listener_t*)obj); belle_sip_object_weak_ref(chan,(belle_sip_object_destroy_notify_t)on_channel_destroyed,obj); return obj; }
void belle_http_request_set_listener(belle_http_request_t *req, belle_http_request_listener_t *l){ if (req->listener){ belle_sip_object_weak_unref(req->listener,(belle_sip_object_destroy_notify_t)belle_http_request_listener_destroyed,req); req->listener=NULL; } if (l){ belle_sip_object_weak_ref(l,(belle_sip_object_destroy_notify_t)belle_http_request_listener_destroyed,req); req->listener=l; } }
void belle_http_request_set_channel(belle_http_request_t *req, belle_sip_channel_t* chan){ if (req->channel){ belle_sip_object_weak_unref(req->channel, (belle_sip_object_destroy_notify_t)notify_http_request_of_channel_destruction, req); req->channel=NULL; } if (chan){ belle_sip_object_weak_ref(chan, (belle_sip_object_destroy_notify_t)notify_http_request_of_channel_destruction, req); req->channel=chan; } }
LinphonePlayer *linphone_call_build_player(LinphoneCall *call){ LinphonePlayer *obj=ms_new0(LinphonePlayer,1); obj->open=call_player_open; obj->close=call_player_close; obj->start=call_player_start; obj->seek=call_player_seek; obj->pause=call_player_pause; obj->get_state=call_player_get_state; obj->impl=call; belle_sip_object_weak_ref(call,on_call_destroy,obj); return obj; }
void belle_sip_channel_add_listener(belle_sip_channel_t *obj, belle_sip_channel_listener_t *l){ obj->listeners=belle_sip_list_append(obj->listeners, belle_sip_object_weak_ref(l, (belle_sip_object_destroy_notify_t)channel_remove_listener,obj)); }
void belle_sip_transaction_set_dialog(belle_sip_transaction_t *t, belle_sip_dialog_t *dialog){ if (t->dialog==dialog) return; if (dialog) belle_sip_object_weak_ref(dialog,(belle_sip_object_destroy_notify_t)belle_sip_transaction_reset_dialog,t); if (t->dialog) belle_sip_object_weak_unref(t->dialog,(belle_sip_object_destroy_notify_t)belle_sip_transaction_reset_dialog,t); t->dialog=dialog; }