Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 15019) +++ channels/chan_sip.c (working copy) @@ -715,6 +715,7 @@ int stateid; int laststate; /*!< Last known extension state */ int dialogver; + int sendonly; /*!< Sendonly stream state (RFC 3264) */ struct ast_dsp *vad; /*!< Voice Activation Detection dsp */ @@ -3576,7 +3577,6 @@ int codec; int destiterator = 0; int iterator; - int sendonly = 0; int x,y; int debug=sip_debug_test_pvt(p); struct ast_channel *bridgepeer = NULL; @@ -3719,11 +3719,11 @@ while ((a = get_sdp_iterate(&iterator, req, "a"))[0] != '\0') { char* mimeSubtype = ast_strdupa(a); /* ensures we have enough space */ if (!strcasecmp(a, "sendonly")) { - sendonly=1; + p->sendonly=1; continue; } if (!strcasecmp(a, "sendrecv")) { - sendonly=0; + p->sendonly=0; } if (sscanf(a, "rtpmap: %u %[^/]/", &codec, mimeSubtype) != 2) continue; if (debug) @@ -3791,7 +3791,7 @@ if ((bridgepeer=ast_bridged_channel(p->owner))) { /* We have a bridge */ /* Turn on/off music on hold if we are holding/unholding */ - if (sin.sin_addr.s_addr && !sendonly) { + if (sin.sin_addr.s_addr && !p->sendonly) { ast_moh_stop(bridgepeer); /* Activate a re-invite */ @@ -3800,7 +3800,7 @@ /* No address for RTP, we're on hold */ ast_moh_start(bridgepeer, NULL); - if (sendonly) + if (p->sendonly) ast_rtp_stop(p->rtp); /* Activate a re-invite */ ast_queue_frame(p->owner, &ast_null_frame); @@ -4637,6 +4637,9 @@ debug); } + if (p->sendonly == 1) + ast_build_string(&a_audio_next, &a_audio_left, "a=recvonly\r\n"); + ast_build_string(&a_audio_next, &a_audio_left, "a=silenceSupp:off - - - -\r\n"); if ((m_audio_left < 2) || (m_video_left < 2) || (a_audio_left == 0) || (a_video_left == 0))