diff --git a/include/asterisk/rtp_engine.h b/include/asterisk/rtp_engine.h
index cb555b77977dfe9dc50c40f20228c56c2e23e27e..b3519f9176c17949a6495556acd9349328ff0220 100644
--- a/include/asterisk/rtp_engine.h
+++ b/include/asterisk/rtp_engine.h
@@ -106,6 +106,9 @@ extern "C" {
  */
 #define MAX_CHANNEL_ID 152
 
+/*!< DTMF samples per second */
+#define DEFAULT_DTMF_SAMPLE_RATE_MS    8000
+
 struct ast_rtp_instance;
 struct ast_rtp_glue;
 
diff --git a/res/res_pjsip_sdp_rtp.c b/res/res_pjsip_sdp_rtp.c
index 5e992350ae6dc73ef4f69e4ee2ff33c6b3b38808..c86a5059140e80bf61b09710297979a904fc123d 100644
--- a/res/res_pjsip_sdp_rtp.c
+++ b/res/res_pjsip_sdp_rtp.c
@@ -1989,10 +1989,8 @@ static int create_outgoing_sdp_stream(struct ast_sip_session *session, struct as
 		}
 
 		if ((attr = generate_rtpmap_attr(session, media, pool, rtp_code, 1, format, 0))) {
-			int newrate = ast_rtp_lookup_sample_rate2(1, format, 0);
 			int i, added = 0;
-			media->attr[media->attr_count++] = attr;
-
+			int newrate = ast_rtp_lookup_sample_rate2(1, format, 0);
 			if (build_dtmf_sample_rates) {
 				for (i = 0; i < AST_VECTOR_SIZE(&sample_rates); i++) {
 					/* Only add if we haven't already processed this sample rate. For instance
@@ -2007,6 +2005,7 @@ static int create_outgoing_sdp_stream(struct ast_sip_session *session, struct as
 					AST_VECTOR_APPEND(&sample_rates, newrate);
 				}
 			}
+			media->attr[media->attr_count++] = attr;
 		}
 
 		if ((attr = generate_fmtp_attr(pool, format, rtp_code))) {
@@ -2032,7 +2031,6 @@ static int create_outgoing_sdp_stream(struct ast_sip_session *session, struct as
 				continue;
 			}
 
-
 			if (index != AST_RTP_DTMF) {
 				rtp_code = ast_rtp_codecs_payload_code(
 								ast_rtp_instance_get_codecs(session_media->rtp), 0, NULL, index);
@@ -2046,7 +2044,7 @@ static int create_outgoing_sdp_stream(struct ast_sip_session *session, struct as
 				 * Walk through the possible bitrates for the RFC 2833/4733 digits and generate the rtpmap
 				 * attributes.
 				 */
-				int i;
+				int i, found_default_offer = 0;
 				for (i = 0; i < AST_VECTOR_SIZE(&sample_rates); i++) {
 					rtp_code = ast_rtp_codecs_payload_code_sample_rate(
 									ast_rtp_instance_get_codecs(session_media->rtp), 0, NULL, index, AST_VECTOR_GET(&sample_rates, i));
@@ -2055,12 +2053,31 @@ static int create_outgoing_sdp_stream(struct ast_sip_session *session, struct as
 						continue;
 					}
 
+					if (AST_VECTOR_GET(&sample_rates, i) == DEFAULT_DTMF_SAMPLE_RATE_MS) {
+						/* we found and added a default offer, so no need to include a default one.*/
+						found_default_offer = 1;
+					}
+
 					if ((attr = generate_rtpmap_attr2(session, media, pool, rtp_code, 0, NULL, index, AST_VECTOR_GET(&sample_rates, i)))) {
 						media->attr[media->attr_count++] = attr;
 						snprintf(tmp, sizeof(tmp), "%d 0-16", (rtp_code));
 						attr = pjmedia_sdp_attr_create(pool, "fmtp", pj_cstr(&stmp, tmp));
 						media->attr[media->attr_count++] = attr;
+					}
+				}
+
+				/* If we weren't able to add any matching RFC 2833/4733, assume this endpoint is using a
+				 * mismatched 8K offer and try to add one as a fall-back/default.
+				 */
+				if (!found_default_offer) {
+					rtp_code = ast_rtp_codecs_payload_code_sample_rate(
+									ast_rtp_instance_get_codecs(session_media->rtp), 0, NULL, index, DEFAULT_DTMF_SAMPLE_RATE_MS);
 
+					if (rtp_code != -1 && (attr = generate_rtpmap_attr2(session, media, pool, rtp_code, 0, NULL, index, DEFAULT_DTMF_SAMPLE_RATE_MS))) {
+						media->attr[media->attr_count++] = attr;
+						snprintf(tmp, sizeof(tmp), "%d 0-16", (rtp_code));
+						attr = pjmedia_sdp_attr_create(pool, "fmtp", pj_cstr(&stmp, tmp));
+						media->attr[media->attr_count++] = attr;
 					}
 				}
 			}
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index db763e3ed02a757e5f90a818e1f5305e9758a9f3..c3314612eb78ded9efe542d30d353fcd7865a6a0 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -4326,11 +4326,17 @@ static int ast_rtp_dtmf_begin(struct ast_rtp_instance *instance, char digit)
 	/* Grab the matching DTMF type payload */
 	payload = ast_rtp_codecs_payload_code_tx_sample_rate(ast_rtp_instance_get_codecs(instance), 0, NULL, AST_RTP_DTMF, sample_rate);
 
-	/* If this returns -1, we are being asked to send digits for a sample rate that is outside
-	   what was negotiated for. Fall back if possible. */
+	/* If this returns -1, we are using a codec with a sample rate that does not have a matching RFC 2833/4733
+	   offer. The offer may have included a default-rate one that doesn't match the codec rate, so try to use that. */
+	if (payload == -1) {
+		sample_rate = DEFAULT_DTMF_SAMPLE_RATE_MS;
+		payload = ast_rtp_codecs_payload_code_tx(ast_rtp_instance_get_codecs(instance), 0, NULL, AST_RTP_DTMF);
+	}
+	/* No default-rate offer either, trying to send a digit outside of what was negotiated for. */
 	if (payload == -1) {
 		return -1;
 	}
+
 	ast_test_suite_event_notify("DTMF_BEGIN", "Digit: %d\r\nPayload: %d\r\nRate: %d\r\n", digit, payload, sample_rate);
 	ast_debug(1, "Sending digit '%d' at rate %d with payload %d\n", digit, sample_rate, payload);