Browse Source

FIX-- Apostrophe cause message failures due to CURL (#163)

* FIX-- Apostrophe cause message failures due to CURL
mrjd19811 2 years ago
parent
commit
37e4cfa4b5
1 changed files with 1 additions and 0 deletions
  1. 1 0
      sms/resources/install/scripts/app/sms/index.lua

+ 1 - 0
sms/resources/install/scripts/app/sms/index.lua

@@ -377,6 +377,7 @@
 		if (msgtype ~= nil and string.find(msgtype, "imdn") ~= nil) then mdn = true end;
 		if (msgtype ~= nil and string.find(msgtype, "imdn") ~= nil) then mdn = true end;
 		if (not mdn) then 
 		if (not mdn) then 
 			-- No XML content, continue processing
 			-- No XML content, continue processing
+			body = body:gsub("'","'\\''"); -- Fixing Apostrophe for CURL
 			if (carrier == "flowroute") then
 			if (carrier == "flowroute") then
 				cmd = "curl -u ".. access_key ..":" .. secret_key .. " -H \"Content-Type: application/json\" -X POST -d '{\"to\":\"" .. to .. "\",\"from\":\"" .. outbound_caller_id_number .."\",\"body\":\"" .. body .. "\"}' " .. api_url;
 				cmd = "curl -u ".. access_key ..":" .. secret_key .. " -H \"Content-Type: application/json\" -X POST -d '{\"to\":\"" .. to .. "\",\"from\":\"" .. outbound_caller_id_number .."\",\"body\":\"" .. body .. "\"}' " .. api_url;
 			elseif (carrier == "peerless") then	
 			elseif (carrier == "peerless") then