| 149 | } |
| 150 | |
| 151 | static inline str *get_b2be_map_key(int type, str *tag0, str *tag1, str *callid) |
| 152 | { |
| 153 | static str key = {0,0}; |
| 154 | int len = 3/*3 x '$'*/ + 1 /*type*/ + cdb_key_prefix.len + |
| 155 | tag0->len + tag1->len + callid->len + 1; |
| 156 | |
| 157 | /* map key format: [prefix][type]$[tag0]$[tag1]$[callid] */ |
| 158 | key.s = pkg_malloc(len); |
| 159 | if (!key.s) { |
| 160 | LM_ERR("no more pkg memory\n"); |
| 161 | return NULL; |
| 162 | } |
| 163 | |
| 164 | key.len = snprintf(key.s, len, "%.*s%d$%.*s$%.*s$%.*s", |
| 165 | cdb_key_prefix.len, cdb_key_prefix.s, type, tag0->len, tag0->s, |
| 166 | tag1->len, tag1->s, callid->len, callid->s); |
| 167 | |
| 168 | return &key; |
| 169 | } |
| 170 | |
| 171 | static inline str *get_b2be_map_subkey(str *param) |
| 172 | { |
no outgoing calls
no test coverage detected