"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "modules/b2b_logic/b2b_logic.c" between
opensips-3.2.0-rc1.tar.gz and opensips-3.2.0.tar.gz

About: OpenSIPS is a multi-functional, multi-purpose signaling SIP Server (Session Initiation Protocol). It can act as SIP Router/Switch, SIP Registrar, Application Server, Redirect Server, Load Balancer / Dispatcher, Back-to-Back User Agent, Presence Server, IM Server, Session Border Controller, SIP Front-End, NAT traversal Server, IP Gateway (SMS, XMPP) and others.

b2b_logic.c  (opensips-3.2.0-rc1):b2b_logic.c  (opensips-3.2.0)
skipping to change at line 139 skipping to change at line 139
{"Proxy-Require", 13}, {"Proxy-Require", 13},
{"Session-Expires", 15}, {"Session-Expires", 15},
{"Min-SE", 6}, {"Min-SE", 6},
{"Require", 7}, {"Require", 7},
{"RSeq", 4}, {"RSeq", 4},
}; };
int use_init_sdp = 0; int use_init_sdp = 0;
int contact_user = 0; int contact_user = 0;
unsigned int max_duration = 12*3600; unsigned int max_duration = 12*3600;
static str requestTimeout = str_init("Request Timeout");
int b2bl_key_avp_name; int b2bl_key_avp_name;
unsigned short b2bl_key_avp_type; unsigned short b2bl_key_avp_type;
static str b2bl_key_avp_param = {NULL, 0}; static str b2bl_key_avp_param = {NULL, 0};
static str b2bl_from_spec_param = {NULL, 0}; static str b2bl_from_spec_param = {NULL, 0};
static pv_spec_t b2bl_from_spec; static pv_spec_t b2bl_from_spec;
static pv_value_t b2bl_from_tok; static pv_value_t b2bl_from_tok;
static struct to_body b2bl_from; static struct to_body b2bl_from;
#define B2BL_FROM_BUF_LEN 255 #define B2BL_FROM_BUF_LEN 255
skipping to change at line 594 skipping to change at line 596
} }
return 0; return 0;
} }
void b2bl_db_timer_update(unsigned int ticks, void* param) void b2bl_db_timer_update(unsigned int ticks, void* param)
{ {
b2b_logic_dump(0); b2b_logic_dump(0);
} }
static void term_expired_entity(b2bl_entity_id_t *entity, int hash_index)
{
str bye = {BYE, BYE_LEN};
b2b_req_data_t req_data;
b2b_rpl_data_t rpl_data;
if (entity->type == B2B_SERVER &&
entity->state != B2BL_ENT_CONFIRMED) {
memset(&rpl_data, 0, sizeof(b2b_rpl_data_t));
PREP_RPL_DATA(entity);
rpl_data.method = METHOD_INVITE;
rpl_data.body = NULL;
if (entity->state == B2BL_ENT_CANCELING) {
rpl_data.code = 487;
rpl_data.text = &requestTerminated;
} else {
rpl_data.code = 408;
rpl_data.text = &requestTimeout;
}
b2bl_htable[hash_index].locked_by = process_no;
if(b2b_api.send_reply(&rpl_data) < 0)
LM_ERR("Sending reply failed - %d, [%.*s]\n",
rpl_data.code, entity->key.len,
entity->key.s);
b2bl_htable[hash_index].locked_by = -1;
} else {
memset(&req_data, 0, sizeof(b2b_req_data_t));
PREP_REQ_DATA(entity);
req_data.method =&bye;
b2bl_htable[hash_index].locked_by = process_no;
b2b_api.send_request(&req_data);
b2bl_htable[hash_index].locked_by = -1;
}
}
void b2bl_clean(unsigned int ticks, void* param) void b2bl_clean(unsigned int ticks, void* param)
{ {
int i; int i;
b2bl_tuple_t* tuple, *tuple_next; b2bl_tuple_t* tuple, *tuple_next;
unsigned int now; unsigned int now;
str bye = {BYE, BYE_LEN};
b2b_req_data_t req_data;
now = get_ticks(); now = get_ticks();
for(i = 0; i< b2bl_hsize; i++) for(i = 0; i< b2bl_hsize; i++)
{ {
lock_get(&b2bl_htable[i].lock); lock_get(&b2bl_htable[i].lock);
tuple = b2bl_htable[i].first; tuple = b2bl_htable[i].first;
while(tuple) while(tuple)
{ {
tuple_next = tuple->next; tuple_next = tuple->next;
if(tuple->lifetime > 0 && tuple->lifetime < now) if(tuple->lifetime > 0 && tuple->lifetime < now)
{ {
LM_INFO("Found expired tuple [%.*s]: delete and s end BYEs\n", LM_INFO("Found expired tuple [%.*s]: delete and s end BYEs\n",
tuple->key->len, tuple->key->s); tuple->key->len, tuple->key->s);
if(tuple->bridge_entities[0] && tuple->bridge_ent ities[1] && !tuple->to_del) if(tuple->bridge_entities[0] && tuple->bridge_ent ities[1] && !tuple->to_del)
{ {
if(!tuple->bridge_entities[0]->disconnect ed) if(!tuple->bridge_entities[0]->disconnect ed)
{ term_expired_entity(tuple->bridge
memset(&req_data, 0, sizeof(b2b_r _entities[0], i);
eq_data_t));
PREP_REQ_DATA(tuple->bridge_entit
ies[0]);
req_data.method =&bye;
b2bl_htable[i].locked_by = proces
s_no;
b2b_api.send_request(&req_data);
b2bl_htable[i].locked_by = -1;
}
if(!tuple->bridge_entities[1]->disconnect ed) if(!tuple->bridge_entities[1]->disconnect ed)
{ term_expired_entity(tuple->bridge
memset(&req_data, 0, sizeof(b2b_r _entities[1], i);
eq_data_t));
PREP_REQ_DATA(tuple->bridge_entit
ies[1]);
req_data.method =&bye;
b2bl_htable[i].locked_by = proces
s_no;
b2b_api.send_request(&req_data);
b2bl_htable[i].locked_by = -1;
}
} }
b2bl_delete(tuple, i, 1, tuple->repl_flag != TUPL E_REPL_RECV); b2bl_delete(tuple, i, 1, tuple->repl_flag != TUPL E_REPL_RECV);
} }
tuple = tuple_next; tuple = tuple_next;
} }
lock_release(&b2bl_htable[i].lock); lock_release(&b2bl_htable[i].lock);
} }
} }
static void mod_destroy(void) static void mod_destroy(void)
 End of changes. 5 change blocks. 
24 lines changed or deleted 44 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)