diff options
author | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-06-20 10:34:53 +0000 |
---|---|---|
committer | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-06-20 10:34:53 +0000 |
commit | 267fa0ccddcdeca8191cfac4dc9ba5a01d1080af (patch) | |
tree | 8cad2e37231ea9717bb8837b407be2ca9dcc949b | |
parent | 5ea6a4b971a949dcaae144b570b3044b540598bb (diff) |
Issue #6820 - SIP channels hang in semi active state
- Block fix from 1.2
- Implement part of that fix that was not already implemented, but in a different way
basically, don't cancel destruction when we receive re-transmits.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@35059 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channels/chan_sip.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 94c4068f7..a3c9653ad 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -4915,16 +4915,16 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req) /* Manager Hold and Unhold events must be generated, if necessary */ /* XXX Support for sendonly/recvonly needs to be fixed !!! */ if (sin.sin_addr.s_addr && !sendonly) { - append_history(p, "Unhold", "%s", req->data); + if (ast_test_flag(&p->flags[0], SIP_CALL_ONHOLD)) { + append_history(p, "Unhold", "%s", req->data); + if (global_callevents) + manager_event(EVENT_FLAG_CALL, "Unhold", + "Channel: %s\r\n" + "Uniqueid: %s\r\n", + p->owner->name, + p->owner->uniqueid); - if (global_callevents && ast_test_flag(&p->flags[0], SIP_CALL_ONHOLD)) { - manager_event(EVENT_FLAG_CALL, "Unhold", - "Channel: %s\r\n" - "Uniqueid: %s\r\n", - p->owner->name, - p->owner->uniqueid); - - } + } ast_clear_flag(&p->flags[0], SIP_CALL_ONHOLD); } else { /* No address for RTP, we're on hold */ @@ -11820,7 +11820,8 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_ ast_set_flag(&p->flags[0], SIP_NEEDDESTROY); } else if ((resp >= 100) && (resp < 200)) { if (sipmethod == SIP_INVITE) { - sip_cancel_destroy(p); + if (!ast_test_flag(req, SIP_PKT_IGNORE)) + sip_cancel_destroy(p); if (find_sdp(req)) process_sdp(p, req); if (p->owner) { @@ -11857,7 +11858,7 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_ /* They got the notify, this is the end */ if (p->owner) { ast_log(LOG_WARNING, "Notify answer on an owned channel?\n"); - //ast_queue_hangup(p->owner); + /* ast_queue_hangup(p->owner); Disabled */ } else { if (!p->subscribed && !p->refer) ast_set_flag(&p->flags[0], SIP_NEEDDESTROY); @@ -11915,7 +11916,7 @@ static void handle_response(struct sip_pvt *p, int resp, char *rest, struct sip_ default: /* Errors without handlers */ if ((resp >= 100) && (resp < 200)) { if (sipmethod == SIP_INVITE) { /* re-invite */ - if (!ignore) + if (!ast_test_flag(req, SIP_PKT_IGNORE)) sip_cancel_destroy(p); } } |