summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile102
-rw-r--r--include/asterisk/parking.h11
-rw-r--r--include/asterisk/strings.h2
-rw-r--r--res/res_pjsip/pjsip_distributor.c27
4 files changed, 79 insertions, 63 deletions
diff --git a/Makefile b/Makefile
index 7528f8374..b988c8ff6 100644
--- a/Makefile
+++ b/Makefile
@@ -824,60 +824,56 @@ install-logrotate:
rm -f contrib/scripts/asterisk.logrotate.tmp
config:
- @if [ "${OSARCH}" = "linux-gnu" -o "${OSARCH}" = "kfreebsd-gnu" ]; then \
- if [ -f /etc/redhat-release -o -f /etc/fedora-release ]; then \
- ./build_tools/install_subst contrib/init.d/rc.redhat.asterisk "$(DESTDIR)/etc/rc.d/init.d/asterisk"; \
- if [ ! -f "$(DESTDIR)/etc/sysconfig/asterisk" ] ; then \
- $(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/sysconfig/asterisk" ; \
- fi ; \
- if [ -z "$(DESTDIR)" ] ; then \
- /sbin/chkconfig --add asterisk ; \
- fi ; \
- elif [ -f /etc/debian_version ] ; then \
- ./build_tools/install_subst contrib/init.d/rc.debian.asterisk "$(DESTDIR)/etc/init.d/asterisk"; \
- if [ ! -f "$(DESTDIR)/etc/default/asterisk" ] ; then \
- $(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/default/asterisk" ; \
- fi ; \
- if [ -z "$(DESTDIR)" ] ; then \
- /usr/sbin/update-rc.d asterisk defaults 50 91 ; \
- fi ; \
- elif [ -f /etc/gentoo-release ] ; then \
- ./build_tools/install_subst contrib/init.d/rc.gentoo.asterisk "$(DESTDIR)/etc/init.d/asterisk"; \
- if [ -z "$(DESTDIR)" ] ; then \
- /sbin/rc-update add asterisk default ; \
- fi ; \
- elif [ -f /etc/mandrake-release -o -f /etc/mandriva-release ] ; then \
- ./build_tools/install_subst contrib/init.d/rc.mandriva.asterisk "$(DESTDIR)/etc/rc.d/init.d/asterisk"; \
- if [ ! -f /etc/sysconfig/asterisk ] ; then \
- $(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/sysconfig/asterisk" ; \
- fi ; \
- if [ -z "$(DESTDIR)" ] ; then \
- /sbin/chkconfig --add asterisk ; \
- fi ; \
- elif [ -f /etc/SuSE-release -o -f /etc/novell-release ] ; then \
- ./build_tools/install_subst contrib/init.d/rc.suse.asterisk "$(DESTDIR)/etc/init.d/asterisk"; \
- if [ ! -f /etc/sysconfig/asterisk ] ; then \
- $(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/sysconfig/asterisk" ; \
- fi ; \
- if [ -z "$(DESTDIR)" ] ; then \
- /sbin/chkconfig --add asterisk ; \
- fi ; \
- elif [ -f /etc/arch-release -o -f /etc/arch-release ] ; then \
- ./build_tools/install_subst contrib/init.d/rc.archlinux.asterisk "$(DESTDIR)/etc/init.d/asterisk"; \
- elif [ -d "$(DESTDIR)/Library/LaunchDaemons" ]; then \
- if [ ! -f "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.asterisk.plist" ]; then \
- ./build_tools/install_subst contrib/init.d/org.asterisk.asterisk.plist "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.asterisk.plist"; \
- fi; \
- if [ ! -f "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.muted.plist" ]; then \
- ./build_tools/install_subst contrib/init.d/org.asterisk.muted.plist "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.muted.plist"; \
- fi; \
- elif [ -f /etc/slackware-version ]; then \
- echo "Slackware is not currently supported, although an init script does exist for it."; \
- else \
- echo "We could not install init scripts for your distribution." ; \
- fi \
+ if [ -f /etc/redhat-release -o -f /etc/fedora-release ]; then \
+ ./build_tools/install_subst contrib/init.d/rc.redhat.asterisk "$(DESTDIR)/etc/rc.d/init.d/asterisk"; \
+ if [ ! -f "$(DESTDIR)/etc/sysconfig/asterisk" ] ; then \
+ $(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/sysconfig/asterisk" ; \
+ fi ; \
+ if [ -z "$(DESTDIR)" ] ; then \
+ /sbin/chkconfig --add asterisk ; \
+ fi ; \
+ elif [ -f /etc/debian_version ] ; then \
+ ./build_tools/install_subst contrib/init.d/rc.debian.asterisk "$(DESTDIR)/etc/init.d/asterisk"; \
+ if [ ! -f "$(DESTDIR)/etc/default/asterisk" ] ; then \
+ $(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/default/asterisk" ; \
+ fi ; \
+ if [ -z "$(DESTDIR)" ] ; then \
+ /usr/sbin/update-rc.d asterisk defaults 50 91 ; \
+ fi ; \
+ elif [ -f /etc/gentoo-release ] ; then \
+ ./build_tools/install_subst contrib/init.d/rc.gentoo.asterisk "$(DESTDIR)/etc/init.d/asterisk"; \
+ if [ -z "$(DESTDIR)" ] ; then \
+ /sbin/rc-update add asterisk default ; \
+ fi ; \
+ elif [ -f /etc/mandrake-release -o -f /etc/mandriva-release ] ; then \
+ ./build_tools/install_subst contrib/init.d/rc.mandriva.asterisk "$(DESTDIR)/etc/rc.d/init.d/asterisk"; \
+ if [ ! -f /etc/sysconfig/asterisk ] ; then \
+ $(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/sysconfig/asterisk" ; \
+ fi ; \
+ if [ -z "$(DESTDIR)" ] ; then \
+ /sbin/chkconfig --add asterisk ; \
+ fi ; \
+ elif [ -f /etc/SuSE-release -o -f /etc/novell-release ] ; then \
+ ./build_tools/install_subst contrib/init.d/rc.suse.asterisk "$(DESTDIR)/etc/init.d/asterisk"; \
+ if [ ! -f /etc/sysconfig/asterisk ] ; then \
+ $(INSTALL) -m 644 contrib/init.d/etc_default_asterisk "$(DESTDIR)/etc/sysconfig/asterisk" ; \
+ fi ; \
+ if [ -z "$(DESTDIR)" ] ; then \
+ /sbin/chkconfig --add asterisk ; \
+ fi ; \
+ elif [ -f /etc/arch-release -o -f /etc/arch-release ] ; then \
+ ./build_tools/install_subst contrib/init.d/rc.archlinux.asterisk "$(DESTDIR)/etc/init.d/asterisk"; \
+ elif [ -d "$(DESTDIR)/Library/LaunchDaemons" ]; then \
+ if [ ! -f "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.asterisk.plist" ]; then \
+ ./build_tools/install_subst contrib/init.d/org.asterisk.asterisk.plist "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.asterisk.plist"; \
+ fi; \
+ if [ ! -f "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.muted.plist" ]; then \
+ ./build_tools/install_subst contrib/init.d/org.asterisk.muted.plist "$(DESTDIR)/Library/LaunchDaemons/org.asterisk.muted.plist"; \
+ fi; \
+ elif [ -f /etc/slackware-version ]; then \
+ echo "Slackware is not currently supported, although an init script does exist for it."; \
else \
- echo "We could not install init scripts for your operating system." ; \
+ echo "We could not install init scripts for your distribution." ; \
fi
sounds:
diff --git a/include/asterisk/parking.h b/include/asterisk/parking.h
index 4c93c3b45..53dfe9320 100644
--- a/include/asterisk/parking.h
+++ b/include/asterisk/parking.h
@@ -211,12 +211,19 @@ int ast_parking_is_exten_park(const char *context, const char *exten);
* \brief Park the bridge and/or callers that this channel is in
*
* \param parker The bridge_channel parking the bridge
- * \param exten Optional. The extension the channel or bridge was parked at if the
- * call succeeds.
+ * \param[out] exten Optional. The parking exten to access the parking lot.
* \param length Optional. If \c exten is specified, the size of the buffer.
*
* \note This is safe to be called outside of the \ref AstBridging Bridging API.
*
+ * \note The exten parameter was intended to return the extension the channel or
+ * bridge was parked at if the call succeeds. However, accessing that information
+ * is very difficult to do with the new asynchronous design. That information may
+ * not be available anywhere by the time this function currently returns.
+ *
+ * Only, chan_skinny is known to call this function and use the exten parameter
+ * for the phone display.
+ *
* \retval 0 on success
* \retval non-zero on error
*/
diff --git a/include/asterisk/strings.h b/include/asterisk/strings.h
index 0e2f69ba8..2ca75a69c 100644
--- a/include/asterisk/strings.h
+++ b/include/asterisk/strings.h
@@ -688,7 +688,7 @@ void ast_str_trim_blanks(struct ast_str *buf),
if (!buf) {
return;
}
- while (buf->__AST_STR_USED && buf->__AST_STR_STR[buf->__AST_STR_USED - 1] < 33) {
+ while (buf->__AST_STR_USED && ((unsigned char) buf->__AST_STR_STR[buf->__AST_STR_USED - 1]) < 33) {
buf->__AST_STR_STR[--(buf->__AST_STR_USED)] = '\0';
}
}
diff --git a/res/res_pjsip/pjsip_distributor.c b/res/res_pjsip/pjsip_distributor.c
index d902ed456..2ab954eb0 100644
--- a/res/res_pjsip/pjsip_distributor.c
+++ b/res/res_pjsip/pjsip_distributor.c
@@ -231,20 +231,33 @@ static pjsip_dialog *find_dialog(pjsip_rx_data *rdata)
if (rdata->msg_info.msg->type == PJSIP_RESPONSE_MSG ||
pjsip_method_cmp(&rdata->msg_info.msg->line.req.method, &pjsip_cancel_method) ||
rdata->msg_info.to->tag.slen != 0) {
- return pjsip_ua_find_dialog(&rdata->msg_info.cid->id, local_tag,
+ dlg = pjsip_ua_find_dialog(&rdata->msg_info.cid->id, local_tag,
remote_tag, PJ_TRUE);
+ if (dlg) {
+ return dlg;
+ }
}
- /* Incoming CANCEL without a to-tag can't use same method for finding the
- * dialog. Instead, we have to find the matching INVITE transaction and
- * then get the dialog from the transaction
+ /*
+ * There may still be a matching dialog if this is
+ * 1) an incoming CANCEL request without a to-tag
+ * 2) an incoming response to a dialog-creating request.
*/
- pjsip_tsx_create_key(rdata->tp_info.pool, &tsx_key, PJSIP_ROLE_UAS,
- pjsip_get_invite_method(), rdata);
+ if (rdata->msg_info.msg->type == PJSIP_REQUEST_MSG) {
+ /* CANCEL requests will need to match the INVITE we initially received. Any
+ * other request type will either have been matched already or is not in
+ * dialog
+ */
+ pjsip_tsx_create_key(rdata->tp_info.pool, &tsx_key, PJSIP_ROLE_UAS,
+ pjsip_get_invite_method(), rdata);
+ } else {
+ pjsip_tsx_create_key(rdata->tp_info.pool, &tsx_key, PJSIP_ROLE_UAC,
+ &rdata->msg_info.cseq->method, rdata);
+ }
tsx = pjsip_tsx_layer_find_tsx(&tsx_key, PJ_TRUE);
if (!tsx) {
- ast_log(LOG_ERROR, "Could not find matching INVITE transaction for CANCEL request\n");
+ ast_debug(3, "Could not find matching transaction for %s\n", rdata->msg_info.info);
return NULL;
}