Changeset 571
- Timestamp:
- Jul 2, 2006 12:29:54 PM (18 years ago)
- Location:
- pjproject/trunk/pjmedia
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia-codec/types.h
r411 r571 30 30 enum 31 31 { 32 /* Telephone events must have pt=101, or otherwise some code needs33 * to be updated (this would not affect outgoing pt).32 /* PJMEDIA_RTP_PT_TELEPHONE_EVENTS is declared in 33 * <pjmedia/config.h> 34 34 */ 35 PJMEDIA_RTP_PT_ TELEPHONE_EVENTS = 101, /**< telephone-events */35 PJMEDIA_RTP_PT_START = PJMEDIA_RTP_PT_TELEPHONE_EVENTS, 36 36 37 37 PJMEDIA_RTP_PT_SPEEX_NB, /**< Speex narrowband/8KHz */ -
pjproject/trunk/pjmedia/include/pjmedia/config.h
r568 r571 164 164 165 165 166 /** 167 * This macro declares the payload type for telephone-event 168 * that is advertised by PJMEDIA for outgoing SDP. If this macro 169 * is set to zero, telephone events would not be advertised nor 170 * supported. 171 * 172 * If this value is changed to other number, please update the 173 * PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR too. 174 */ 175 #ifndef PJMEDIA_RTP_PT_TELEPHONE_EVENTS 176 # define PJMEDIA_RTP_PT_TELEPHONE_EVENTS 101 177 #endif 178 179 180 /** 181 * Macro to get the string representation of the telephone-event 182 * payload type. 183 */ 184 #ifndef PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR 185 # define PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR "101" 186 #endif 187 188 166 189 167 190 /** -
pjproject/trunk/pjmedia/src/pjmedia/endpoint.c
r568 r571 333 333 334 334 /* Add "rtcp" attribute */ 335 #if 1335 #if defined(PJMEDIA_HAS_RTCP_IN_SDP) && PJMEDIA_HAS_RTCP_IN_SDP!=0 336 336 { 337 337 attr = pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr)); … … 341 341 pj_ansi_snprintf(attr->value.ptr, 80, 342 342 ":%u IN IP4 %s", 343 pj_ntohs(sock_info[0].rt p_addr_name.sin_port),344 pj_inet_ntoa(sock_info[0].rt p_addr_name.sin_addr));343 pj_ntohs(sock_info[0].rtcp_addr_name.sin_port), 344 pj_inet_ntoa(sock_info[0].rtcp_addr_name.sin_addr)); 345 345 pjmedia_sdp_attr_add(&m->attr_count, m->attr, attr); 346 346 } … … 398 398 m->attr[m->attr_count++] = attr; 399 399 400 #if 1 400 #if defined(PJMEDIA_RTP_PT_TELEPHONE_EVENTS) && \ 401 PJMEDIA_RTP_PT_TELEPHONE_EVENTS != 0 402 401 403 /* 402 404 * Add support telephony event 403 405 */ 404 m->desc.fmt[m->desc.fmt_count++] = pj_str("101"); 406 m->desc.fmt[m->desc.fmt_count++] = 407 pj_str(PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR); 408 405 409 /* Add rtpmap. */ 406 410 attr = pj_pool_zalloc(pool, sizeof(pjmedia_sdp_attr)); 407 411 attr->name = pj_str("rtpmap"); 408 attr->value = pj_str(":101 telephone-event/8000"); 412 attr->value = pj_str(":" PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR 413 " telephone-event/8000"); 409 414 m->attr[m->attr_count++] = attr; 415 410 416 /* Add fmtp */ 411 417 attr = pj_pool_zalloc(pool, sizeof(pjmedia_sdp_attr)); 412 418 attr->name = pj_str("fmtp"); 413 attr->value = pj_str(": 1010-15");419 attr->value = pj_str(":" PJMEDIA_RTP_PT_TELEPHONE_EVENTS_STR " 0-15"); 414 420 m->attr[m->attr_count++] = attr; 415 421 #endif -
pjproject/trunk/pjmedia/src/pjmedia/sdp.c
r569 r571 35 35 }; 36 36 #define TOKEN "-.!%*_=`'~" 37 //#define TOKEN "'`-./:?\"#$&*;=@[]^_`{|}+~!" 37 38 #define NTP_OFFSET ((pj_uint32_t)2208988800) 38 39 #define THIS_FILE "sdp.c" … … 67 68 static int is_initialized; 68 69 static pj_cis_buf_t cis_buf; 69 static pj_cis_t cs_ token;70 static pj_cis_t cs_digit, cs_token; 70 71 71 72 static void init_sdp_parser(void) … … 79 80 80 81 pj_cis_buf_init(&cis_buf); 82 81 83 pj_cis_init(&cis_buf, &cs_token); 82 84 pj_cis_add_alpha(&cs_token); 83 85 pj_cis_add_num(&cs_token); 84 86 pj_cis_add_str(&cs_token, TOKEN); 87 88 pj_cis_init(&cis_buf, &cs_digit); 89 pj_cis_add_num(&cs_digit); 85 90 } 86 91 … … 258 263 /* Init */ 259 264 rtpmap->pt.slen = rtpmap->param.slen = rtpmap->enc_name.slen = 0; 265 rtpmap->clock_rate = 0; 260 266 261 267 /* Parse */ … … 283 289 284 290 /* Get the clock rate. */ 285 pj_scan_get(&scanner, &cs_ token, &token);291 pj_scan_get(&scanner, &cs_digit, &token); 286 292 rtpmap->clock_rate = pj_strtoul(&token); 287 293 … … 761 767 ctx->last_error = PJMEDIA_SDP_EINVER; 762 768 769 /* check equal sign */ 770 if (*(scanner->curptr+1) != '=') { 771 on_scanner_error(scanner); 772 return; 773 } 774 775 /* check version is 0 */ 776 if (*(scanner->curptr+2) != '0') { 777 on_scanner_error(scanner); 778 return; 779 } 780 763 781 pj_scan_advance_n(scanner, 3, SKIP_WS); 764 782 pj_scan_get_newline(scanner); … … 771 789 772 790 ctx->last_error = PJMEDIA_SDP_EINORIGIN; 791 792 /* check equal sign */ 793 if (*(scanner->curptr+1) != '=') { 794 on_scanner_error(scanner); 795 return; 796 } 773 797 774 798 /* o= */ … … 811 835 ctx->last_error = PJMEDIA_SDP_EINTIME; 812 836 837 /* check equal sign */ 838 if (*(scanner->curptr+1) != '=') { 839 on_scanner_error(scanner); 840 return; 841 } 842 813 843 /* t= */ 814 844 pj_scan_advance_n(scanner, 2, SKIP_WS); … … 833 863 ctx->last_error = PJMEDIA_SDP_EINSDP; 834 864 865 /* check equal sign */ 866 if (*(scanner->curptr+1) != '=') { 867 on_scanner_error(scanner); 868 return; 869 } 870 835 871 /* x= */ 836 872 pj_scan_advance_n(scanner, 2, SKIP_WS); … … 872 908 873 909 ctx->last_error = PJMEDIA_SDP_EINMEDIA; 910 911 /* check the equal sign */ 912 if (*(scanner->curptr+1) != '=') { 913 on_scanner_error(scanner); 914 return; 915 } 874 916 875 917 /* m= */ … … 926 968 927 969 attr = pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr)); 970 971 /* check equal sign */ 972 if (*(scanner->curptr+1) != '=') { 973 on_scanner_error(scanner); 974 return NULL; 975 } 928 976 929 977 /* skip a= */ … … 1013 1061 break; 1014 1062 default: 1015 parse_generic_line(&scanner, &dummy, &ctx); 1063 if (cur_name >= 'a' && cur_name <= 'z') 1064 parse_generic_line(&scanner, &dummy, &ctx); 1065 else { 1066 ctx.last_error = PJMEDIA_SDP_EINSDP; 1067 on_scanner_error(&scanner); 1068 } 1016 1069 break; 1017 1070 } … … 1104 1157 1105 1158 #define CHECK(exp,ret) do { \ 1106 pj_assert(exp);\1159 /*pj_assert(exp);*/ \ 1107 1160 if (!(exp)) \ 1108 1161 return ret; \ -
pjproject/trunk/pjmedia/src/pjmedia/session.c
r568 r571 122 122 } 123 123 124 /* Transport type must be equal */ 125 if (pj_stricmp(&rem_m->desc.transport, 126 &local_m->desc.transport) != 0) 127 { 128 si->type = PJMEDIA_TYPE_UNKNOWN; 129 return PJMEDIA_SDPNEG_EINVANSTP; 130 } 131 124 132 /* Media direction: */ 125 133 … … 200 208 /* Get the payload number for receive channel. */ 201 209 pt = pj_strtoul(&local_m->desc.fmt[0]); 210 pj_assert(PJMEDIA_RTP_PT_TELEPHONE_EVENTS==0 || 211 pt != PJMEDIA_RTP_PT_TELEPHONE_EVENTS); 202 212 203 213 /* Get codec info.
Note: See TracChangeset
for help on using the changeset viewer.