| 202 | |
| 203 | |
| 204 | static 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 | |
| 233 | static int get_codec_lumps( struct sip_msg *msg ) |
no test coverage detected