Commit 8db2b21f authored by Simon Morlat's avatar Simon Morlat

wip

parent 6c40a924
......@@ -467,7 +467,7 @@ BELLE_SIP_DECLARE_CUSTOM_VPTR_END
#define BELLE_SIP_LISTENING_POINT(obj) BELLE_SIP_CAST(obj,belle_sip_listening_point_t)
void belle_sip_listening_point_remove_channel(belle_sip_listening_point_t *lp, belle_sip_channel_t *chan);
/*
......
......@@ -74,6 +74,7 @@ typedef struct belle_sip_tls_channel belle_sip_tls_channel_t;
struct belle_sip_channel{
belle_sip_source_t base;
belle_sip_listening_point_t *lp; /*the listening point that owns this channel*/
belle_sip_stack_t *stack;
belle_sip_channel_state_t state;
belle_sip_list_t *listeners;
......
......@@ -423,3 +423,17 @@ void belle_sip_dialog_check_ack_sent(belle_sip_dialog_t*obj){
belle_sip_provider_create_client_transaction(obj->provider,req));
}
}
void belle_sip_dialog_handle_200Ok(belle_sip_dialog_t *obj, belle_sip_message_t *msg){
if (obj->last_out_ack){
belle_sip_header_cseq_t *cseq=belle_sip_message_get_header_by_type(msg,belle_sip_header_cseq_t);
if (cseq){
belle_sip_header_cseq_t *ack_cseq=belle_sip_message_get_header_by_type(msg,belle_sip_header_cseq_t);
if (belle_sip_header_cseq_get_seq_number(cseq)==belle_sip_header_cseq_get_seq_number(ack_cseq)){
/*pass for retransmission*/
belle_sip_message("Dialog retransmitting last ack automatically");
belle_sip_provider_send_request(obj->provider,obj->last_out_ack);
}else belle_sip_warning("No ACK to retransmit matching 200Ok");
}
}
}
......@@ -43,17 +43,18 @@ void belle_sip_listening_point_add_channel(belle_sip_listening_point_t *lp, bell
belle_sip_channel_t *belle_sip_listening_point_create_channel(belle_sip_listening_point_t *obj, const char *dest, int port){
belle_sip_channel_t *chan=BELLE_SIP_OBJECT_VPTR(obj,belle_sip_listening_point_t)->create_channel(obj,dest,port);
if (chan){
chan->lp=obj;
belle_sip_listening_point_add_channel(obj,chan);
}
return chan;
}
#if 0
static void belle_sip_listening_point_remove_channel(belle_sip_listening_point_t *lp, belle_sip_channel_t *chan){
void belle_sip_listening_point_remove_channel(belle_sip_listening_point_t *lp, belle_sip_channel_t *chan){
lp->channels=belle_sip_list_remove(lp->channels,chan);
belle_sip_object_unref(chan);
}
#endif
BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(belle_sip_listening_point_t);
BELLE_SIP_INSTANCIATE_CUSTOM_VPTR(belle_sip_listening_point_t)={
......
......@@ -327,6 +327,10 @@ belle_sip_channel_t * belle_sip_provider_get_channel(belle_sip_provider_t *p, co
return NULL;
}
void belle_sip_provider_release_channel(belle_sip_provider_t *p, belle_sip_channel_t *chan){
belle_sip_listening_point_remove_channel(chan->lp,chan);
}
void belle_sip_provider_send_request(belle_sip_provider_t *p, belle_sip_request_t *req){
belle_sip_hop_t hop={0};
belle_sip_channel_t *chan;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment