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

Richard Mudgett asteriskteam at digium.com
Tue Mar 1 20:15:31 CST 2016


Richard Mudgett has uploaded a new change for review.

  https://gerrit.asterisk.org/2325

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(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/25/2325/1

diff --git a/res/res_pjsip_send_to_voicemail.c b/res/res_pjsip_send_to_voicemail.c
index 3a57aea..8af0e5d 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/2325
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id6350b3c7d4ec8df7ec89863566645e2b0f441fd
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-code-review mailing list