1640
1640
ast_mutex_unlock(&rtp->bridge_lock);
1643
/*! \brief remove setting from payload type list if the rtpmap header indicates
1644
an unknown media type */
1645
void ast_rtp_unset_m_type(struct ast_rtp* rtp, int pt)
1647
ast_mutex_lock(&rtp->bridge_lock);
1648
rtp->current_RTP_PT[pt].isAstFormat = 0;
1649
rtp->current_RTP_PT[pt].code = 0;
1650
ast_mutex_unlock(&rtp->bridge_lock);
1643
1653
/*! \brief Make a note of a RTP payload type (with MIME type) that was seen in
1644
1654
* an SDP "a=rtpmap:" line.
1655
* \return 0 if the MIME type was found and set, -1 if it wasn't found
1646
void ast_rtp_set_rtpmap_type(struct ast_rtp *rtp, int pt,
1657
int ast_rtp_set_rtpmap_type(struct ast_rtp *rtp, int pt,
1647
1658
char *mimeType, char *mimeSubtype,
1648
1659
enum ast_rtp_options options)
1650
1661
unsigned int i;
1652
1664
if (pt < 0 || pt > MAX_RTP_PT)
1653
return; /* bogus payload type */
1665
return -1; /* bogus payload type */
1655
1667
ast_mutex_lock(&rtp->bridge_lock);
1657
1669
for (i = 0; i < sizeof(mimeTypes)/sizeof(mimeTypes[0]); ++i) {
1658
1670
if (strcasecmp(mimeSubtype, mimeTypes[i].subtype) == 0 &&
1659
1671
strcasecmp(mimeType, mimeTypes[i].type) == 0) {
1660
1673
rtp->current_RTP_PT[pt] = mimeTypes[i].payloadType;
1661
1674
if ((mimeTypes[i].payloadType.code == AST_FORMAT_G726) &&
1662
1675
mimeTypes[i].payloadType.isAstFormat &&
2839
2852
/* Check if anything changed */
2840
2853
if ((c0->tech_pvt != pvt0) ||
2841
2854
(c1->tech_pvt != pvt1) ||
2842
(c0->masq || c0->masqr || c1->masq || c1->masqr)) {
2855
(c0->masq || c0->masqr || c1->masq || c1->masqr) ||
2856
(c0->monitor || c0->spies || c1->monitor || c1->spies)) {
2843
2857
ast_log(LOG_DEBUG, "Oooh, something is weird, backing out\n");
2844
2858
if (c0->tech_pvt == pvt0)
2845
2859
if (pr0->set_rtp_peer(c0, NULL, NULL, 0, 0))
2913
2927
fr = ast_read(who);
2914
2928
other = (who == c0) ? c1 : c0;
2915
if (!fr || ((fr->frametype == AST_FRAME_DTMF) &&
2929
if (!fr || ((fr->frametype == AST_FRAME_DTMF_BEGIN || fr->frametype == AST_FRAME_DTMF_END) &&
2916
2930
(((who == c0) && (flags & AST_BRIDGE_DTMF_CHANNEL_0)) ||
2917
2931
((who == c1) && (flags & AST_BRIDGE_DTMF_CHANNEL_1))))) {
2918
2932
/* Break out of bridge */
2966
2980
if ((fr->frametype == AST_FRAME_DTMF_BEGIN) ||
2967
(fr->frametype == AST_FRAME_DTMF) ||
2981
(fr->frametype == AST_FRAME_DTMF_END) ||
2968
2982
(fr->frametype == AST_FRAME_VOICE) ||
2969
2983
(fr->frametype == AST_FRAME_VIDEO) ||
2970
2984
(fr->frametype == AST_FRAME_IMAGE) ||
3116
3130
/* Check if anything changed */
3117
3131
if ((c0->tech_pvt != pvt0) ||
3118
3132
(c1->tech_pvt != pvt1) ||
3119
(c0->masq || c0->masqr || c1->masq || c1->masqr)) {
3133
(c0->masq || c0->masqr || c1->masq || c1->masqr) ||
3134
(c0->monitor || c0->spies || c1->monitor || c1->spies)) {
3120
3135
ast_log(LOG_DEBUG, "Oooh, something is weird, backing out\n");
3121
3136
if ((c0->masq || c0->masqr) && (fr = ast_read(c0)))
3122
3137
ast_frfree(fr);
3141
3156
fr = ast_read(who);
3142
3157
other = (who == c0) ? c1 : c0;
3143
3158
/* Dependong on the frame we may need to break out of our bridge */
3144
if (!fr || ((fr->frametype == AST_FRAME_DTMF) &&
3159
if (!fr || ((fr->frametype == AST_FRAME_DTMF_BEGIN || fr->frametype == AST_FRAME_DTMF_END) &&
3145
3160
((who == c0) && (flags & AST_BRIDGE_DTMF_CHANNEL_0)) |
3146
3161
((who == c1) && (flags & AST_BRIDGE_DTMF_CHANNEL_1)))) {
3147
3162
/* Record received frame and who */
3185
3200
if ((fr->frametype == AST_FRAME_DTMF_BEGIN) ||
3186
(fr->frametype == AST_FRAME_DTMF) ||
3201
(fr->frametype == AST_FRAME_DTMF_END) ||
3187
3202
(fr->frametype == AST_FRAME_VOICE) ||
3188
3203
(fr->frametype == AST_FRAME_VIDEO) ||
3189
3204
(fr->frametype == AST_FRAME_IMAGE) ||