| <?php |
| $did=$_REQUEST['ApiDID']; |
| $pass=$_REQUEST['pass']; |
| $path=$_REQUEST['path']; |
| $txt=$_REQUEST['txt']; |
| $file=$_REQUEST['file']; |
| $type=$_REQUEST['type']; |
| $phone=$_REQUEST['ApiPhone']; |
| $extension=$_REQUEST['ApiExtension']; |
| $name=$_REQUEST['ApiEnterIDName']; |
| $ApiCallId=$_REQUEST['ApiCallId']; |
| $hangup=$_REQUEST['hangup']; |
| $okname=$_REQUEST['okname']; |
| $tzl=$_REQUEST['tzl']; |
| $tzlnit=$_REQUEST['tzlnit']; |
| $tim1=$_REQUEST['tim1']; |
| $tim2=$_REQUEST['tim2']; |
| $me=$_REQUEST['me']; |
| $men=$_REQUEST['men']; |
| $menu=$_REQUEST['menu']; |
| $go=$_REQUEST['go']; |
| $to=$_REQUEST['to']; |
| $callerId=$_REQUEST['callerId']; |
| $add=$_REQUEST['add']; |
| $valnameext="-EnterIDType-phone-EnterID-{$phone}-ValName-{$name}"; |
| $valnam = "הודעה מאת, {$name}."; |
| date_default_timezone_set('Asia/Jerusalem'); |
| $time = date("Y-m-d-H-i-s"); |
| $tim= date("H.i"); |
| $valnameext = str_replace(" ", "%20", $valnameext); |
| $valnam = str_replace(" ", "%20", $valnam); |
| if($callerId == null){ |
| $callerId=$did; |
| } |
| if($menu == 'null'){ |
| $menu=""; |
| } |
| if($name == null){ |
| $valnameext=""; |
| } |
| elseif |
| ($okname == 'ok'){ |
| $valname=$valnam; |
| } |
| if($me != 'd'){ |
| $array_number = [33333, 3333, 333, 33, 3, 22222, 2222, 222, 22, 2, 66666, 6666, 666, 66, 6, 55555, 5555, 555, 55, 5, 44444, 4444, 444, 44, 4, 99999, 9999, 999, 99, 9, 88888, 8888, 888, 88, 8, 77777, 7777, 777, 77, 7, "00000", "0000", "000", "00", "0", 11111, 1111, 111, 11, 1]; |
| $array_abc = ["&", "&", "ג", "ב", "א", "$", "$", "ו", "ה", "ד", "^", "^", "ט", "ח", "ז", "@", "ל", "ך", "כ", "י", "#", "ן", "נ", "ם", "מ", ";", "ף", "פ", "ע", 'ס', "-", "-", "ק", "ץ", 'צ', "`", "_", "ת", "ש", "ר", "+", "+", "+", ":", "%", "=", ",", "!", "?", "."]; |
| $txt = str_replace($array_number, $array_abc, $txt); |
| if($me == 'b'||$me == 'c'){ |
| $array_a = ["א", "ב", "ג", "ד", "ה", "ו", "ז", "ח", "ט", "י", "כ", "ך", "ל", "מ", "ם", "נ", "ן", "ס", "ע", "פ", "ף", "צ", "ץ", "ק", "ר", "ש", "ת", "_",]; |
| $array_ac = ["D", 'E', 'F', 'A', 'B', 'C', 'M', 'N', 'O', 'J', 'K', 'L', 5, 'G', 'H', 'I', 4, 'W', 'X', 'Y', 'Z', 'T', 'U', 'V', 'P', 'Q', 'R', 'S',]; |
| $txt = str_replace($array_a, $array_ac, $txt); |
| } |
| if($me == 'c'){ |
| $txt = strtolower($txt); |
| } |
| $array_numbe = ["&", "$", "^", "@", "#", ";", "-", "_", "+", "=", "`" ,'*']; |
| $array_ab = [3, 2, 6, 5, 4, 9, 8, 7, 0, 1, 7, ""]; |
| $txt = str_replace($array_numbe, $array_ab, $txt); |
| } |
| if($did == null){ |
| print "read=t-אנא הקישו את מספר המערכת אליה ברצונכם להעלות טקסט=ApiDID,yes,10,9,15,Digits,yes,"; |
| } |
| elseif($pass == null){ |
| print "read=m-1800=pass,yes,,1,24,Digits,"; |
| } |
| elseif($hangup == null){ |
| $login=json_decode(file_get_contents("https://www.call2all.co.il/ym/api/Login?username={$did}&password={$pass}"), true); |
| $stat = $login['responseStatus']; |
| if |
| ($stat == "OK"){ |
| if($path == null){ |
| print "read=t-אנא הקישו את מספר השלוחה כאשר בין שלוחה לשלוחה הקישו כוכבית, ולסיום הקישו סולמית=path,,,1,24,Alpha,,,*/,,,,,"; |
| } |
| elseif($file == null){ |
| print "read=t-אנא הקישו את מספר ההודעה לשמירה, לקובץ הגבוה בשלוחה הקישו 0, להודעת מערכת הקישו כוכבית ואת מספר ההודעה, לסיום הקישו סולמית =file,,5,1,24,Alpha,,,*M,,,,,"; |
| } |
| elseif($type == 'null'){ |
| $type=""; |
| } |
| if($type == '3'){ |
| $ur=json_decode(file_get_contents("https://www.call2all.co.il/ym/api/FileAction?token={$did}:{$pass}&action=delete&what=ivr2:{$path}/{$ApiCallId}.txt&"), true); |
| if($txt != 'null'){ |
| print "read=m-2287=txt,,,,1,NO,yes,yes,,*,,Ok,null,,no,"; |
| }else{ |
| print "read=t-ה=type,,,,1,NO,yes,yes,,*,,Ok,null,,no,"; |
| } |
| } |
| elseif($type == '4'){ |
| $u=json_decode(file_get_contents("https://www.call2all.co.il/ym/api/GetTextFile?token={$did}:{$pass}&what=ivr2:{$path}/{$ApiCallId}.txt&"), true); |
| $contents=$u['contents']; |
| $text="{$contents}{$txt}"; |
| $text = str_replace("%", "%20", $text); |
| $text = str_replace(" ", "%20", $text); |
| $text = str_replace("null", "", $text); |
| $ur=json_decode(file_get_contents("https://www.call2all.co.il/ym/api/UploadTextFile?token={$did}:{$pass}&what=ivr2:{$path}/{$ApiCallId}.txt&contents={$text}&"), true); |
| $text = str_replace("%20", " ", $text); |
| $text = str_replace("%", " ", $text); |
| $text = str_replace("null", "", $text); |
| if($txt != 'null'){ |
| print "read=m-2288=txt,,,,1,NO,yes,yes,,*,,Ok,null,,no,"; |
| }else{ |
| print "read=t-{$text}=type,,,,1,NO,yes,yes,,*,,Ok,null,,no,"; |
| } |
| } |
| elseif($type == '5'){ |
| $u=json_decode(file_get_contents("https://www.call2all.co.il/ym/api/GetTextFile?token={$did}:{$pass}&what=ivr2:{$path}/{$ApiCallId}.txt&"), true); |
| $contents=$u['contents']; |
| $text="{$contents}{$txt}"; |
| $text = str_replace("%", " ", $text); |
| $text = str_replace("null", "", $text); |
| if($txt != 'null'){ |
| if($men == null|$men == 'null'){ |
| print "read=t-אנא הקישו את כמות האותיות שברצונכם למחוק, ולסיום הקישו סולמית=men,,,,,Number,yes,,,,,,,,"; |
| }else{ |
| $me=$men*2; |
| $text = substr($text, 0, -$me); |
| $text = str_replace("%", "%20", $text); |
| $text = str_replace(" ", "%20", $text); |
| $ur=json_decode(file_get_contents("https://www.call2all.co.il/ym/api/UploadTextFile?token={$did}:{$pass}&what=ivr2:{$path}/{$ApiCallId}.txt&contents={$text}"), true); |
| $text = str_replace("%20", " ", $text); |
| $text = str_replace("%", " ", $text); |
| $text = str_replace("null", "", $text); |
| print "read=t-מחקתם בהצלחה.n-{$men}=txt,,,,1,NO,yes,yes,,,,Ok,null,,no,"; |
| } |
| }elseif($men != 'null'){ |
| print "read=t-אותיות=men,,,,1,NO,yes,yes,,,,Ok,null,,no,"; |
| }else{ |
| print "read=m-2288.t-{$text}=type,,,,1,NO,yes,yes,,,,Ok,null,,no,"; |
| } |
| } |
| elseif($type == '6'){ |
| $u=json_decode(file_get_contents("https://www.call2all.co.il/ym/api/GetTextFile?token={$did}:{$pass}&what=ivr2:{$path}/{$ApiCallId}.txt&"), true); |
| $contents=$u['contents']; |
| $text="{$contents}{$txt}"; |
| $text = str_replace("%", " ", $text); |
| $text = str_replace("null", "", $text); |
| if($txt != 'null'){ |
| $words = explode(" ", $text); |
| array_pop($words); |
| $text = implode(" ", $words); |
| $text = str_replace("%", "%20", $text); |
| $text = str_replace(" ", "%20", $text); |
| $ur=json_decode(file_get_contents("https://www.call2all.co.il/ym/api/UploadTextFile?token={$did}:{$pass}&what=ivr2:{$path}/{$ApiCallId}.txt&contents={$text}"), true); |
| $text = str_replace("%20", " ", $text); |
| $text = str_replace("%", " ", $text); |
| $text = str_replace("null", "", $text); |
| print "read=m-2287=txt,,,,1,NO,yes,yes,,,,Ok,null,,no,"; |
| }else{ |
| print "read=m-2288.t-{$text}=type,,,,1,NO,yes,yes,,,,Ok,null,,no,"; |
| } |
| } |
| elseif ($type == '8'){ |
| if ($me == 'a'||$me == 'b'||$me == 'c'||$me == 'd'){ |
| $me=""; |
| } |
| if ($me == null){ |
| $u=json_decode(file_get_contents("https://www.call2all.co.il/ym/api/GetTextFile?token={$did}:{$pass}&what=ivr2:{$path}/{$ApiCallId}.txt&"), true); |
| $contents=$u['contents']; |
| $text="{$contents}{$txt}"; |
| $text = str_replace("%", "%20", $text); |
| $text = str_replace(" ", "%20", $text); |
| $text = str_replace("null", "", $text); |
| $ur=json_decode(file_get_contents("https://www.call2all.co.il/ym/api/UploadTextFile?token={$did}:{$pass}&what=ivr2:{$path}/{$ApiCallId}.txt&contents={$text}&"), true); |
| if($txt != 'null'){ |
| print "read=t-שינוי שפת מקלדת=txt,,,,1,NO,yes,yes,,*,,Ok,null,,no,"; |
| }else{ |
| print "read=t-למקלדת עברית הקישו 1, למקלדת אנגלית אותיות גדולות הקישו שתיים, למקלדת אנגלית אותיות קטנות הקישו 3, למקלדת ספרות הקישו 4=me,,1,1,,NO,yes,yes,,1234,,,,,no,"; |
| } |
| }else{ |
| print "read=t-החלפתם בהצלחה=type,,,,1,NO,yes,yes,,*,,Ok,null,,no,"; |
| } |
| } |
| elseif($txt == 'null'){ |
| $txt=""; |
| } |
| if($txt == null){ |
| if ($me == '1'){ |
| print "read=t-למקלדת עברית=me,,,,1,NO,yes,yes,,*,,Ok,a,,no,"; |
| } |
| if ($me == '2'){ |
| print "read=t-למקלדת אנגלית אותיות גדולות=me,,,,1,NO,yes,yes,,*,,Ok,b,,no,"; |
| } |
| if ($me == '3'){ |
| print "read=t-למקלדת אנגלית אותיות קטנות=me,,,,1,NO,yes,yes,,*,,Ok,c,,no,"; |
| } |
| if ($me == '4'){ |
| print "read=t-למקלדת ספרות=me,,,,1,NO,yes,yes,,*,,Ok,d,,no,"; |
| } |
| print "read=t-אנא הקש את הטקסט על מקשי הטלפון כאשר בין שני אותיות על אותו המקש הקישו כוכבית, לרווח הקישו 0, ולסיום הקישו סולמית=txt,,,1,24,NO,,,,,,,,,no,"; |
| } |
| elseif($menu == '1'){ |
| if($type != null){ |
| $u=json_decode(file_get_contents("https://www.call2all.co.il/ym/api/GetTextFile?token={$did}:{$pass}&what=ivr2:{$path}/{$ApiCallId}.txt&"), true); |
| $contents=$u['contents']; |
| $text="{$contents}{$txt}"; |
| $text = str_replace("%", " ", $text); |
| $text = str_replace("null", "", $text); |
| $text = str_replace(".", "", $text); |
| print "read=m-2289.a-{$text} =type,,,,1,NO,yes,yes,,*,,Ok,null,,no,"; |
| }else{ |
| print "read=t-, עד כאן איות הטקסט=menu,,,,1,NO,yes,yes,,*,,Ok,null,,no,"; |
| } |
| } |
| elseif($menu == '2'){ |
| $u=json_decode(file_get_contents("https://www.call2all.co.il/ym/api/GetTextFile?token={$did}:{$pass}&what=ivr2:{$path}/{$ApiCallId}.txt&"), true); |
| $contents=$u['contents']; |
| $text="{$contents}{$txt}"; |
| $text = str_replace("%", " ", $text); |
| $text = str_replace("null", "", $text); |
| if($type != null){ |
| print "read=m-2289=type,,,,1,NO,yes,yes,,*,,Ok,null,,no,"; |
| }else{ |
| print "read=t-{$text}=menu,,,,1,NO,yes,yes,,*,,Ok,null,,no,"; |
| } |
| } |
| elseif($type == null){ |
| print "read=t-לסיום ואישור ההודעה הקישו 1, לשמיעת הטקסט שהוקלד במילים או באותיות הקישו שתיים, להקשה מחודשת של כל הטקסט הקישו 3, להמשך הקשת הטקסט הקישו 4, לביטול של האות האחרונה הקישו 5,לביטול המילה האחרונה הקישו 6, לביטול ויציאה הקישו 7, לשינוי שפת מקלדת הקישו 8=type,,1,,,NO,yes,yes,,12345678,,,,,no,"; |
| } |
| elseif ($type == '2'){ |
| if($menu == null){ |
| print "read=t-לשמיעת ההודעה אות אחר אות הקישו 1, לשמיעת ההודעה במנוע הקראת מילים הקישו שתיים=menu,,1,,,NO,yes,yes,,12,,,,,no"; |
| } |
| } |
| elseif ($type == '7'){ |
| $ur=json_decode(file_get_contents("https://www.call2all.co.il/ym/api/FileAction?token={$did}:{$pass}&action=delete&what=ivr2:{$path}/{$ApiCallId}.txt&"), true); |
| print "id_list_message=m-2287.g-/{$to}"; |
| } |
| elseif ($type == '1'){ |
| if($file == '0' ){ |
| $obj = json_decode(file_get_contents("https://www.call2all.co.il/ym/api/GetIVR2DirStats?token={$did}:{$pass}&path={$path}&"),true); |
| $files = $obj['maxFile']; |
| $filess = $files['name']; |
| if($filess != null){ |
| $file = $filess + 1 ; |
| } |
| if($file<9){ |
| $file=sprintf("00%u",$file); |
| } |
| elseif($file<99){ |
| $file=sprintf("0%u",$file); |
| } |
| } |
| $u=json_decode(file_get_contents("https://www.call2all.co.il/ym/api/GetTextFile?token={$did}:{$pass}&what=ivr2:{$path}/{$ApiCallId}.txt&"), true); |
| $contents=$u['contents']; |
| $text="{$contents}{$txt}"; |
| if($add == 'yes'){ |
| $tt=$text; |
| $getAdd=json_decode(file_get_contents("https://www.call2all.co.il/ym/api/GetTextFile?token={$did}:{$pass}&what=ivr2:{$path}/{$file}.tts&"), true); |
| $TextAdd=$getAdd['contents']; |
| $text="{$TextAdd}{$tt}"; |
| } |
| $text = str_replace("%", "%20", $text); |
| $text = str_replace(" ", "%20", $text); |
| $text = str_replace("null", "", $text); |
| $url=json_decode(file_get_contents("https://www.call2all.co.il/ym/api/UploadTextFile?token={$did}:{$pass}&what=ivr2:{$path}/{$file}.tts&contents={$valname}{$text}&"), true); |
| file_get_contents("https://www.call2all.co.il/ym/api/UploadTextFile?token=$did:{$pass}&what=ivr2:{$path}/{$file}.txt&contents=Record-CustomerDID-{$did}-Phone-{$phone}-Date-{$time}-Folder-{$extension}-File-{$file}{$valnameext}&"); |
| $ur=json_decode(file_get_contents("https://www.call2all.co.il/ym/api/FileAction?token={$did}:{$pass}&action=delete&what=ivr2:{$path}/{$ApiCallId}.txt&"), true); |
| $status = $url['responseStatus']; |
| if |
| ($status == "OK"){ |
| if($tzlnit != null){ |
| if($tim1 != null){ |
| if($tim2 != null){ |
| if($tim2<$tim1){ |
| if($tim<$tim2||$tim>$tim1){ |
| $tzl=$tzlnit; |
| } |
| }else{ |
| if($tim>$tim1){ |
| if($tim<$tim2){ |
| $tzl=$tzlnit; |
| } |
| } |
| } |
| } |
| } |
| } |
| if($tzl !== null){ |
| $url1=file_get_contents("https://www.call2all.co.il/ym/api/RunTzintuk?token={$did}:{$pass}&callerId={$callerId}&TzintukTimeOut=8&phones=tzl:{$tzl}"); |
| } |
| print "id_list_message=m-3975.g-/{$go} "; |
| } |
| else{ |
| $ur=json_decode(file_get_contents("https://www.call2all.co.il/ym/api/FileAction?token={$did}:{$pass}&action=delete&what=ivr2:{$path}/{$ApiCallId}.txt&"), true); |
| Print "id_list_message= t-שגיאה, יתכן ואחד מהפרטים שהקשתם שגויים, אנא נסו שוב בעוד חצי שעה .g-/{$to}" ; |
| } |
| } |
| }else{ |
| Print "id_list_message=m-1801"; |
| } |
| }else{ |
| $ur=json_decode(file_get_contents("https://www.call2all.co.il/ym/api/FileAction?token={$did}:{$pass}&action=delete&what=ivr2:{$path}/{$ApiCallId}.txt&"), true); |
| } |
| exit(); |
| |
| ?> |
| |