--- asterisk-1.8.9.1/channels/chan_sip.c 2012-02-06 22:40:37.000000000 +0100 +++ /root/asterisk-1.8.9.1/channels/chan_sip.c 2012-02-08 15:30:04.552673312 +0100 @@ -20952,6 +20952,17 @@ static void handle_response(struct sip_p case 481: /* Call leg does not exist */ if (sipmethod == SIP_INVITE) { handle_response_invite(p, resp, rest, req, seqno); + } + else if (sipmethod == SIP_UPDATE) { + switch (resp) { + case 481: /* Call leg does not exist */ + ast_log(LOG_WARNING, "Re-invite with UPDATE to non-existing call leg on other UA. SIP dialog '%s'. Giving up.\n", p->callid); + //xmitres = transmit_request(p, SIP_ACK, seqno, XMIT_UNRELIABLE, FALSE); + if (p->owner) + ast_queue_control(p->owner, AST_CONTROL_CONGESTION); + sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT); + break; + } } else if (sipmethod == SIP_SUBSCRIBE) { handle_response_subscribe(p, resp, rest, req, seqno); } else if (sipmethod == SIP_BYE) {