Index: channels/chan_pjsip.c =================================================================== --- channels/chan_pjsip.c (revision 431716) +++ channels/chan_pjsip.c (working copy) @@ -219,10 +219,13 @@ static int send_direct_media_request(void *data) { - RAII_VAR(struct ast_sip_session *, session, data, ao2_cleanup); + struct ast_sip_session *session = data; + int res; - return ast_sip_session_refresh(session, NULL, NULL, NULL, - session->endpoint->media.direct_media.method, 1); + res = ast_sip_session_refresh(session, NULL, NULL, NULL, + session->endpoint->media.direct_media.method, 1); + ao2_ref(session, -1); + return res; } /*! \brief Destructor function for \ref transport_info_data */ @@ -1062,6 +1065,7 @@ RAII_VAR(struct ast_sip_session *, session, data, ao2_cleanup); if ((ast_channel_state(session->channel) != AST_STATE_UP) && (session->inv_session->role == PJSIP_UAS_ROLE)) { +#if 0 // BUGBUG This sends a "180 Ringing" before the call has even reached the far end. int response_code = 0; if (session->inv_session->state == PJSIP_INV_STATE_DISCONNECTED) { @@ -1081,6 +1085,7 @@ ast_sip_session_send_response(session, packet); } } +#endif } else { enum ast_sip_session_refresh_method method = session->endpoint->id.refresh_method; int generate_new_sdp;