add 2 fixes backported from asterisk svn related to pickup & transfer (should close...
authorNicolas Thill <nico@openwrt.org>
Tue, 7 Jul 2009 01:10:03 +0000 (01:10 +0000)
committerNicolas Thill <nico@openwrt.org>
Tue, 7 Jul 2009 01:10:03 +0000 (01:10 +0000)
SVN-Revision: 16725

net/asterisk-1.4.x/Makefile
net/asterisk-1.4.x/patches/801-bug_14206.patch [new file with mode: 0644]
net/asterisk-1.4.x/patches/802-bug_14611.patch [new file with mode: 0644]

index 023eaa5..ae4366f 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=asterisk
 PKG_VERSION:=1.4.23.1
-PKG_RELEASE:=1.1
+PKG_RELEASE:=1.2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://downloads.digium.com/pub/asterisk/releases/
diff --git a/net/asterisk-1.4.x/patches/801-bug_14206.patch b/net/asterisk-1.4.x/patches/801-bug_14206.patch
new file mode 100644 (file)
index 0000000..2d6e58b
--- /dev/null
@@ -0,0 +1,13 @@
+https://issues.asterisk.org/view.php?id=14206
+
+--- a/main/channel.c
++++ b/main/channel.c
+@@ -3683,7 +3683,7 @@ int ast_do_masquerade(struct ast_channel
+       /* XXX What about blocking, softhangup, blocker, and lock and blockproc? XXX */
+       /* Application and data remain the same */
+       /* Clone exception  becomes real one, as with fdno */
+-      ast_copy_flags(original, clone, AST_FLAG_EXCEPTION | AST_FLAG_OUTGOING);
++      ast_set_flag(original, ast_test_flag(clone, AST_FLAG_OUTGOING | AST_FLAG_EXCEPTION));
+       original->fdno = clone->fdno;
+       /* Schedule context remains the same */
+       /* Stream stuff stays the same */
diff --git a/net/asterisk-1.4.x/patches/802-bug_14611.patch b/net/asterisk-1.4.x/patches/802-bug_14611.patch
new file mode 100644 (file)
index 0000000..fcfb4de
--- /dev/null
@@ -0,0 +1,46 @@
+https://issues.asterisk.org/view.php?id=14611
+
+--- a/channels/chan_sip.c
++++ b/channels/chan_sip.c
+@@ -9119,6 +9119,9 @@ static struct sip_pvt *get_sip_pvt_byid_
+               if (!strcmp(sip_pvt_ptr->callid, callid)) {
+                       int match = 1;
++                      if (option_debug > 3)
++                              ast_log(LOG_DEBUG, "Found call with callid %s (ourtag=%s, theirtag=%s)\n", callid, sip_pvt_ptr->tag, sip_pvt_ptr->theirtag);
++
+                       /* Go ahead and lock it (and its owner) before returning */
+                       ast_mutex_lock(&sip_pvt_ptr->lock);
+@@ -9129,16 +9132,21 @@ static struct sip_pvt *get_sip_pvt_byid_
+                       if (pedanticsipchecking) {
+                               const char *pvt_fromtag, *pvt_totag;
+-                              if (ast_test_flag(&sip_pvt_ptr->flags[1], SIP_PAGE2_OUTGOING_CALL)) {
+-                                      /* Outgoing call tags : from is "our", to is "their" */
+-                                      pvt_fromtag = sip_pvt_ptr->tag ;
+-                                      pvt_totag = sip_pvt_ptr->theirtag ;
+-                              } else {
+-                                      /* Incoming call tags : from is "their", to is "our" */
+-                                      pvt_fromtag = sip_pvt_ptr->theirtag ;
+-                                      pvt_totag = sip_pvt_ptr->tag ;
+-                              }
+-                              if (ast_strlen_zero(fromtag) || strcmp(fromtag, pvt_fromtag) || (!ast_strlen_zero(totag) && strcmp(totag, pvt_totag)))
++                              /* RFC 3891
++                                > 3.  User Agent Server Behavior: Receiving a Replaces Header
++                                > The Replaces header contains information used to match an existing
++                                > SIP dialog (call-id, to-tag, and from-tag).  Upon receiving an INVITE
++                                > with a Replaces header, the User Agent (UA) attempts to match this
++                                > information with a confirmed or early dialog.  The User Agent Server
++                                > (UAS) matches the to-tag and from-tag parameters as if they were tags
++                                > present in an incoming request.  In other words, the to-tag parameter
++                                > is compared to the local tag, and the from-tag parameter is compared
++                                > to the remote tag.
++
++                                Thus, the totag is always compared to the local tag, regardless if
++                                this our call is an incoming or outgoing call.
++                              */
++                              if (ast_strlen_zero(fromtag) || strcmp(fromtag, sip_pvt_ptr->theirtag) || (!ast_strlen_zero(totag) && strcmp(totag, sip_pvt_ptr->tag)))
+                                       match = 0;
+                       }