Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 324767) +++ channels/chan_sip.c (working copy) @@ -5384,14 +5402,12 @@ return res; } p->callingpres = ast_party_id_presentation(&ast->caller.id); - p->jointcapability = ast_rtp_instance_available_formats(p->rtp, p->capability, p->prefcodec); + /* IVES -restrict outbound codecs to the one that are negociated + trancoded */ + p->jointcapability = ast_rtp_instance_available_formats(p->rtp, ast->nativeformats, p->prefcodec); p->jointnoncodeccapability = p->noncodeccapability; - /* If there are no audio formats left to offer, punt */ - if (!(p->jointcapability & AST_FORMAT_AUDIO_MASK)) { - ast_log(LOG_WARNING, "No audio format found to offer. Cancelling call to %s\n", p->username); - res = -1; - } else { + /* IVeS: allow the call to proceed even if no audio can be negociated */ + { int xmitres; sip_pvt_lock(p); @@ -6230,8 +6246,9 @@ transmit_provisional_response(p, "183 Session Progress", &p->initreq, TRUE); ast_set_flag(&p->flags[0], SIP_PROGRESS_SENT); } - } else if (p->t38.state == T38_ENABLED) { + } else if (p->t38.state == T38_ENABLED || ast_test_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD) ) { /* drop frame, can't sent VOICE frames while in T.38 mode */ + /* drop frame, can't sent VOICE frames call is on HOLD */ } else { p->lastrtptx = time(NULL); res = ast_rtp_instance_write(p->rtp, frame); @@ -6720,10 +6737,10 @@ /* Set the native formats for audio and merge in video */ tmp->nativeformats = ast_codec_choose(&i->prefs, what, 1) | video | text; - ast_debug(3, "*** Our native formats are %s \n", ast_getformatname_multiple(buf, SIPBUFSIZE, tmp->nativeformats)); ast_debug(3, "*** Joint capabilities are %s \n", ast_getformatname_multiple(buf, SIPBUFSIZE, i->jointcapability)); ast_debug(3, "*** Our capabilities are %s \n", ast_getformatname_multiple(buf, SIPBUFSIZE, i->capability)); ast_debug(3, "*** AST_CODEC_CHOOSE formats are %s \n", ast_getformatname_multiple(buf, SIPBUFSIZE, ast_codec_choose(&i->prefs, what, 1))); + ast_debug(3, "*=> Our native formats are %s \n", ast_getformatname_multiple(buf, SIPBUFSIZE, tmp->nativeformats)); if (i->prefcodec) ast_debug(3, "*** Our preferred formats from the incoming channel are %s \n", ast_getformatname_multiple(buf, SIPBUFSIZE, i->prefcodec)); @@ -8867,6 +8884,11 @@ ast_set_read_format(p->owner, p->owner->readformat); ast_set_write_format(p->owner, p->owner->writeformat); } + else + { + /* IVeS - restrict nativeformat to joincaps = formats natively supported by the chan */ + p->owner->nativeformats = p->jointcapability; + } if (ast_test_flag(&p->flags[1], SIP_PAGE2_CALL_ONHOLD) && (!ast_sockaddr_isnull(sa) || !ast_sockaddr_isnull(vsa) || !ast_sockaddr_isnull(tsa) || !ast_sockaddr_isnull(isa)) && (!sendonly || sendonly == -1)) { ast_queue_control(p->owner, AST_CONTROL_UNHOLD);