Fix trailing slash problem (Zap) and making sure refers get ignored the second tiem...
authorMark Spencer <markster@digium.com>
Mon, 19 Apr 2004 22:55:35 +0000 (22:55 +0000)
committerMark Spencer <markster@digium.com>
Mon, 19 Apr 2004 22:55:35 +0000 (22:55 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2712 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c
channels/chan_zap.c

index 4621db4..a56d352 100755 (executable)
@@ -5528,29 +5528,31 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc
                        transmit_response_with_allow(p, "484 Address Incomplete", req);
                else {
                        transmit_response(p, "202 Accepted", req);
-                       if (p->refer_call) {
-                               ast_log(LOG_DEBUG,"202 Accepted (supervised)\n");
-                               attempt_transfer(p, p->refer_call);
-                               ast_mutex_unlock(&p->refer_call->lock);
-                               p->refer_call = NULL;
-                               p->gotrefer = 1;
-                       } else {
-                               ast_log(LOG_DEBUG,"202 Accepted (blind)\n");
-                               c = p->owner;
-                               if (c) {
-                                       transfer_to = c->bridge;
-                                       if (transfer_to) {
-                                               ast_moh_stop(transfer_to);
-                                               ast_async_goto(transfer_to,p->context, p->refer_to,1);
-                                       } else {
-                                               ast_queue_hangup(p->owner);
+                       if (!ignore) {
+                               if (p->refer_call) {
+                                       ast_log(LOG_DEBUG,"202 Accepted (supervised)\n");
+                                       attempt_transfer(p, p->refer_call);
+                                       ast_mutex_unlock(&p->refer_call->lock);
+                                       p->refer_call = NULL;
+                                       p->gotrefer = 1;
+                               } else {
+                                       ast_log(LOG_DEBUG,"202 Accepted (blind)\n");
+                                       c = p->owner;
+                                       if (c) {
+                                               transfer_to = c->bridge;
+                                               if (transfer_to) {
+                                                       ast_moh_stop(transfer_to);
+                                                       ast_async_goto(transfer_to,p->context, p->refer_to,1);
+                                               } else {
+                                                       ast_queue_hangup(p->owner);
+                                               }
                                        }
+                                       p->gotrefer = 1;
                                }
-                               p->gotrefer = 1;
+                               /* Always increment on a BYE */
+                               transmit_request_with_auth(p, "BYE", 0, 1, 1);
+                               p->alreadygone = 1;
                        }
-                       /* Always increment on a BYE */
-                       transmit_request_with_auth(p, "BYE", 0, 1, 1);
-                       p->alreadygone = 1;
                }
        } else if (!strcasecmp(cmd, "CANCEL")) {
                check_via(p, req);
index 241908d..f60c3a4 100755 (executable)
@@ -1509,7 +1509,7 @@ static int zt_call(struct ast_channel *ast, char *rdest, int timeout)
                if (c)
                        c++;
                else
-                       c = dest;
+                       c = "";
                if (strlen(c) < p->stripmsd) {
                        ast_log(LOG_WARNING, "Number '%s' is shorter than stripmsd (%d)\n", c, p->stripmsd);
                        return -1;