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

Function stream_process

modules/sipmsgops/codecs.c:384–757  ·  view source on GitHub ↗

method that processes a stream and keeps the original order * of codecs with the same name */

Source from the content-addressed store, hash-verified

382/* method that processes a stream and keeps the original order
383 * of codecs with the same name */
384static int stream_process(struct sip_msg * msg, struct sdp_stream_cell *cell,
385 str * s, str* ss, regex_t* re, int op,int description)
386{
387 static sdp_payload_attr_t static_payloads[] = {
388 /* as per http://www.iana.org/assignments/rtp-parameters/rtp-parameters.xml */
389 { NULL,0,{ "0",1},{"PCMU",4},{ "8000",4},{NULL,0},{NULL,0},{},0, NULL }, /* 0 - PCMU/8000 */
390 { NULL,0,{ "3",1},{ "GSM",3},{ "8000",4},{NULL,0},{NULL,0},{},0, NULL }, /* 3 - GSM/8000 */
391 { NULL,0,{ "4",1},{"G723",4},{ "8000",4},{NULL,0},{NULL,0},{},0, NULL }, /* 4 - G723/8000 */
392 { NULL,0,{ "5",1},{"DVI4",4},{ "8000",4},{NULL,0},{NULL,0},{},0, NULL }, /* 5 - DVI4/8000 */
393 { NULL,0,{ "6",1},{"DVI4",4},{"16000",5},{NULL,0},{NULL,0},{},0, NULL }, /* 6 - DVI4/16000 */
394 { NULL,0,{ "7",1},{ "LPC",3},{ "8000",4},{NULL,0},{NULL,0},{},0, NULL }, /* 7 - LPC/8000 */
395 { NULL,0,{ "8",1},{"PCMA",4},{ "8000",4},{NULL,0},{NULL,0},{},0, NULL }, /* 8 - PCMA/8000 */
396 { NULL,0,{ "9",1},{"G722",4},{ "8000",4},{NULL,0},{NULL,0},{},0, NULL }, /* 9 - G722/8000 */
397 { NULL,0,{"10",2},{ "L16",3},{"44100",5},{NULL,0},{NULL,0},{},0, NULL }, /*10 - L16/44100 */
398 { NULL,0,{"11",2},{ "L16",3},{"44100",5},{NULL,0},{NULL,0},{},0, NULL }, /*11 - L16/44100 */
399 { NULL,0,{"12",2},{"QCELP",5},{"8000",4},{NULL,0},{NULL,0},{},0, NULL }, /*12 -QCELP/8000 */
400 { NULL,0,{"13",2},{ "CN",2},{ "8000",4},{NULL,0},{NULL,0},{},0, NULL }, /*13 - CN/8000 */
401 { NULL,0,{"14",2},{ "MPA",3},{"90000",5},{NULL,0},{NULL,0},{},0, NULL }, /*14 - MPA/90000 */
402 { NULL,0,{"15",2},{"G728",4},{ "8000",4},{NULL,0},{NULL,0},{},0, NULL }, /*15 - G728/8000 */
403 { NULL,0,{"16",2},{"DVI4",4},{"11025",5},{NULL,0},{NULL,0},{},0, NULL }, /*16 - DVI4/11025 */
404 { NULL,0,{"17",2},{"DVI4",4},{"22050",5},{NULL,0},{NULL,0},{},0, NULL }, /*17 - DVI4/22050 */
405 { NULL,0,{"18",2},{"G729",4},{ "8000",4},{NULL,0},{NULL,0},{},0, NULL }, /*18 - G729/8000 */
406 { NULL,0,{"25",2},{"CelB",4},{ "8000",4},{NULL,0},{NULL,0},{},0, NULL }, /*25 - CelB/8000 */
407 { NULL,0,{"26",2},{"JPEG",4},{"90000",5},{NULL,0},{NULL,0},{},0, NULL }, /*26 - JPEG/90000 */
408 { NULL,0,{"28",2},{ "nv",2},{"90000",5},{NULL,0},{NULL,0},{},0, NULL }, /*28 - nv/90000 */
409 { NULL,0,{"31",2},{"H261",4},{"90000",5},{NULL,0},{NULL,0},{},0, NULL }, /*31 - H261/90000 */
410 { NULL,0,{"32",2},{ "MPV",3},{"90000",5},{NULL,0},{NULL,0},{},0, NULL }, /*32 - MPV/90000 */
411 { NULL,0,{"33",2},{"MP2T",4},{"90000",5},{NULL,0},{NULL,0},{},0, NULL }, /*33 - MP2T/90000 */
412 { NULL,0,{"34",2},{"H263",4},{"90000",5},{NULL,0},{NULL,0},{},0, NULL }, /*34 - H263/90000 */
413 { NULL,0,{"t38",3},{"t38",3},{ "",0},{NULL,0},{NULL,0},{},0, NULL }, /*T38- fax */
414 { NULL,0,{NULL,0},{ NULL,0},{ NULL,0},{NULL,0},{NULL,0},{},0, NULL }
415 };
416 sdp_payload_attr_t *payload;
417 char *cur, *tmp, *buff, temp;
418 struct lump * lmp;
419 str found,linked_found;
420 int ret, i,match, linked_match, buff_len, is_static;
421 regmatch_t pmatch;
422
423
424 lmp = get_associated_lump(msg, cell);
425 if( lmp == NULL)
426 {
427 LM_ERR("There is no lump for this sdp cell\n");
428 return -1;
429 }
430
431 /* is stream deleted ?? */
432 if (lmp->len == 0)
433 return -1;
434
435
436 buff_len = 0;
437 ret = 0;
438
439 buff = pkg_malloc(lmp->len+1);
440 if( buff == NULL)
441 {

Callers 1

do_for_all_streamsFunction · 0.70

Calls 4

get_associated_lumpFunction · 0.85
delete_sdp_lineFunction · 0.85
del_lumpFunction · 0.85
insert_new_lump_afterFunction · 0.85

Tested by

no test coverage detected