MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / get_record_coordinates

Function get_record_coordinates

modules/pua/hash.c:593–614  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

591
592
593int get_record_coordinates(ua_pres_t* pres, unsigned int *hash_code,
594 unsigned int *label_index)
595{
596 ua_pres_t *presentity;
597
598 *hash_code = core_hash( pres->pres_uri, NULL, HASH_SIZE);
599
600 lock_get(&HashT->p_records[*hash_code].lock);
601
602 presentity = search_htable(pres, *hash_code);
603
604 if (presentity==NULL) {
605 lock_release(&HashT->p_records[*hash_code].lock);
606 return -1;
607 }
608
609 *label_index = presentity->local_index;
610
611 lock_release(&HashT->p_records[*hash_code].lock);
612
613 return 0;
614}
615
616
617/* replaces the in-hash presentity with coordinates (hash_index,local_index)

Callers 1

handle_pres_updateFunction · 0.85

Calls 4

core_hashFunction · 0.85
lock_getFunction · 0.85
search_htableFunction · 0.85
lock_releaseFunction · 0.85

Tested by

no test coverage detected