Changeset 3360 for pjproject/trunk/pjmedia/src/pjmedia/endpoint.c
- Timestamp:
- Nov 3, 2010 6:46:27 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/endpoint.c
r3204 r3360 88 88 /** To signal polling thread to quit. */ 89 89 pj_bool_t quit_flag; 90 91 /** Is telephone-event enable */ 92 pj_bool_t has_telephone_event; 90 93 }; 91 94 … … 121 124 endpt->ioqueue = ioqueue; 122 125 endpt->thread_cnt = worker_cnt; 126 endpt->has_telephone_event = PJ_TRUE; 123 127 124 128 /* Sound */ … … 222 226 } 223 227 228 PJ_DEF(pj_status_t) pjmedia_endpt_set_flag( pjmedia_endpt *endpt, 229 pjmedia_endpt_flag flag, 230 const void *value) 231 { 232 PJ_ASSERT_RETURN(endpt, PJ_EINVAL); 233 234 switch (flag) { 235 case PJMEDIA_ENDPT_HAS_TELEPHONE_EVENT_FLAG: 236 endpt->has_telephone_event = *(pj_bool_t*)value; 237 break; 238 default: 239 return PJ_EINVAL; 240 } 241 242 return PJ_SUCCESS; 243 } 244 245 PJ_DEF(pj_status_t) pjmedia_endpt_get_flag( pjmedia_endpt *endpt, 246 pjmedia_endpt_flag flag, 247 void *value) 248 { 249 PJ_ASSERT_RETURN(endpt, PJ_EINVAL); 250 251 switch (flag) { 252 case PJMEDIA_ENDPT_HAS_TELEPHONE_EVENT_FLAG: 253 *(pj_bool_t*)value = endpt->has_telephone_event; 254 break; 255 default: 256 return PJ_EINVAL; 257 } 258 259 return PJ_SUCCESS; 260 } 224 261 225 262 /** … … 490 527 #if defined(PJMEDIA_RTP_PT_TELEPHONE_EVENTS) && \ 491 528 PJMEDIA_RTP_PT_TELEPHONE_EVENTS != 0 492 493 529 /* 494 530 * Add support telephony event 495 531 */ 496 m->desc.fmt[m->desc.fmt_count++] = 497 pj_str(PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR); 498 499 /* Add rtpmap. */ 500 attr = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_attr); 501 attr->name = pj_str("rtpmap"); 502 attr->value = pj_str(PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR 503 " telephone-event/8000"); 504 m->attr[m->attr_count++] = attr; 505 506 /* Add fmtp */ 507 attr = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_attr); 508 attr->name = pj_str("fmtp"); 509 attr->value = pj_str(PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR " 0-15"); 510 m->attr[m->attr_count++] = attr; 532 if (endpt->has_telephone_event) { 533 m->desc.fmt[m->desc.fmt_count++] = 534 pj_str(PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR); 535 536 /* Add rtpmap. */ 537 attr = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_attr); 538 attr->name = pj_str("rtpmap"); 539 attr->value = pj_str(PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR 540 " telephone-event/8000"); 541 m->attr[m->attr_count++] = attr; 542 543 /* Add fmtp */ 544 attr = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_attr); 545 attr->name = pj_str("fmtp"); 546 attr->value = pj_str(PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR " 0-15"); 547 m->attr[m->attr_count++] = attr; 548 } 511 549 #endif 512 550
Note: See TracChangeset
for help on using the changeset viewer.