Merged revisions 8320 via svnmerge from
authorMatt O'Gorman <mogorman@digium.com>
Fri, 20 Jan 2006 01:07:46 +0000 (01:07 +0000)
committerMatt O'Gorman <mogorman@digium.com>
Fri, 20 Jan 2006 01:07:46 +0000 (01:07 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r8320 | mogorman | 2006-01-19 19:00:46 -0600 (Thu, 19 Jan 2006) | 3 lines

solved problem with delayreject and iax trunking
bug 4291

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8323 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_iax2.c

index 202eb53..6238366 100644 (file)
@@ -4888,6 +4888,8 @@ static int raw_hangup(struct sockaddr_in *sin, unsigned short src, unsigned shor
        fh.iseqno = 0;
        fh.type = AST_FRAME_IAX;
        fh.csub = compress_subclass(IAX_COMMAND_INVAL);
+       if (iaxdebug)
+                iax_showframe(NULL, &fh, 0, sin, 0);
 #if 0
        if (option_debug)
 #endif 
@@ -6753,6 +6755,10 @@ retryowner:
                                        break;
                                if (ies.provverpres && ies.serviceident && sin.sin_addr.s_addr)
                                        check_provisioning(&sin, fd, ies.serviceident, ies.provver);
+                               /* If we're in trunk mode, do it now, and update the trunk number in our frame before continuing */
+                               if (ast_test_flag(iaxs[fr.callno], IAX_TRUNK)) {
+                                       fr.callno = make_trunk(fr.callno, 1);
+                               }
                                /* For security, always ack immediately */
                                if (delayreject)
                                        send_command_immediate(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr.ts, NULL, 0,fr.iseqno);
@@ -6763,10 +6769,6 @@ retryowner:
                                                ast_log(LOG_NOTICE, "Rejected connect attempt from %s, who was trying to reach '%s@%s'\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr.callno]->exten, iaxs[fr.callno]->context);
                                        break;
                                }
-                               /* If we're in trunk mode, do it now, and update the trunk number in our frame before continuing */
-                               if (ast_test_flag(iaxs[fr.callno], IAX_TRUNK)) {
-                                       fr.callno = make_trunk(fr.callno, 1);
-                               }
                                /* This might re-enter the IAX code and need the lock */
                                if (strcasecmp(iaxs[fr.callno]->exten, "TBD")) {
                                        ast_mutex_unlock(&iaxsl[fr.callno]);