[Asterisk-code-review] res pjsip send to voicemail.c: Allow either quoted or not se... (asterisk[master])

Joshua Colp asteriskteam at digium.com
Thu Mar 3 05:32:59 CST 2016


Joshua Colp has submitted this change and it was merged.

Change subject: res_pjsip_send_to_voicemail.c: Allow either quoted or not send_to_vm reason.
......................................................................


res_pjsip_send_to_voicemail.c: Allow either quoted or not send_to_vm reason.

Change-Id: Id6350b3c7d4ec8df7ec89863566645e2b0f441fd
---
M res/res_pjsip_send_to_voicemail.c
1 file changed, 9 insertions(+), 4 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Verified



diff --git a/res/res_pjsip_send_to_voicemail.c b/res/res_pjsip_send_to_voicemail.c
index 9d2b5b1..c7e62a2 100644
--- a/res/res_pjsip_send_to_voicemail.c
+++ b/res/res_pjsip_send_to_voicemail.c
@@ -47,7 +47,8 @@
 #define SEND_TO_VM_HEADER_VALUE "feature_send_to_vm"
 
 #define SEND_TO_VM_REDIRECT "REDIRECTING(reason)"
-#define SEND_TO_VM_REDIRECT_VALUE "\"send_to_vm\""
+#define SEND_TO_VM_REDIRECT_VALUE "send_to_vm"
+#define SEND_TO_VM_REDIRECT_QUOTED_VALUE "\"" SEND_TO_VM_REDIRECT_VALUE "\""
 
 static void send_response(struct ast_sip_session *session, int code, struct pjsip_rx_data *rdata)
 {
@@ -102,9 +103,13 @@
 	pjsip_param *reason;
 	pjsip_fromto_hdr *hdr = get_diversion_header(rdata);
 
-	return hdr &&
-		(reason = get_diversion_reason(hdr)) &&
-		!pj_stricmp2(&reason->value, SEND_TO_VM_REDIRECT_VALUE);
+	if (!hdr) {
+		return 0;
+	}
+	reason = get_diversion_reason(hdr);
+	return reason
+		&& (!pj_stricmp2(&reason->value, SEND_TO_VM_REDIRECT_QUOTED_VALUE)
+			|| !pj_stricmp2(&reason->value, SEND_TO_VM_REDIRECT_VALUE));
 }
 
 static int has_call_feature(pjsip_rx_data *rdata)

-- 
To view, visit https://gerrit.asterisk.org/2330
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id6350b3c7d4ec8df7ec89863566645e2b0f441fd
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>



More information about the asterisk-code-review mailing list