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

Function clone_codec_lumps

modules/sipmsgops/codecs.c:204–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202
203
204static int clone_codec_lumps(void)
205{
206 struct lump *l;
207 int i;
208 char *s;
209
210 LM_DBG("cloning %d streams\n",lumps_len);
211
212 for( i=0 ; i<lumps_len ; i++ ) {
213 /* get last lump for stream */
214 for( l=lumps[i] ; l->after ; l=l->after );
215
216 s = pkg_malloc( l->len+1 );
217 if (s==NULL) {
218 LM_ERR("failed to alloc new lump pkg buffer\n");
219 return -1;
220 }
221 memcpy( s, l->u.value, l->len);
222
223 if (insert_new_lump_after( l, s, l->len, 0)==NULL) {
224 LM_ERR("failed to create new lump\n");
225 return -1;
226 }
227 }
228
229 return 0;
230}
231
232
233static int get_codec_lumps( struct sip_msg *msg )

Callers 1

get_codec_lumpsFunction · 0.85

Calls 1

insert_new_lump_afterFunction · 0.85

Tested by

no test coverage detected