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

Function uac_init

modules/tm/uac.c:84–111  ·  view source on GitHub ↗

* Initialize UAC */

Source from the content-addressed store, hash-verified

82 * Initialize UAC
83 */
84int uac_init(void)
85{
86 str src[3];
87 const struct socket_info *si;
88
89 if (RAND_MAX < TM_TABLE_ENTRIES) {
90 LM_WARN("uac does not spread across the whole hash table\n");
91 }
92 /* on tcp/tls bind_address is 0 so try to get the first address we listen
93 * on no matter the protocol */
94 si=bind_address?bind_address:get_first_socket();
95 if (si==0){
96 LM_CRIT("null socket list\n");
97 return -1;
98 }
99
100 /* calculate the initial From tag */
101 src[0].s = "Long live SER server";
102 src[0].len = strlen(src[0].s);
103 src[1].s = si->address_str.s;
104 src[1].len = strlen(src[1].s);
105 src[2].s = si->port_no_str.s;
106 src[2].len = strlen(src[2].s);
107
108 MD5StringArray(from_tag, src, 3);
109 from_tag[MD5_LEN] = '-';
110 return 1;
111}
112
113
114/*

Callers 1

mod_initFunction · 0.85

Calls 2

get_first_socketFunction · 0.85
MD5StringArrayFunction · 0.85

Tested by

no test coverage detected