קוד php לא עובד טוב בטלפון
-
אני מנסה להריץ דרך הטלפון זה מבקש סיסמת ניהול ואחרי שאני מקיש (בין נכונה , ובין לא) שומעים רק שקט עד לניתוק (בדפדפן עובד רגיל)
ולפניכם תמונה מהלוג api

הקוד<?php $playStop = $_GET['PlayStop']; $text = "1"; $pass = $_GET['pass']; $did = $_GET['ApiDID']; $ApiCallId=$_REQUEST['ApiCallId']; $add=$_REQUEST['add']; $what=$_REQUEST['what']; date_default_timezone_set('Asia/Jerusalem'); $time = date("Y-m-d-H-i-s"); $did=$_REQUEST['ApiDID']; $phone=$_REQUEST['ApiPhone']; $extension=$_REQUEST['ApiExtension']; $path2=$_REQUEST['path2']; if($pass == null){print "read=t- הקישוא את סיסמת הניהול וסולמית לסיום=pass1,yes,,1,24,Digits,"; exit(); } $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"){ Print "id_list_message=t-שגיאה, יתכן ואחד מהפרטים שהקשתם שגויים, אנא נסו שוב בעוד חצי שעה .g-/" ; exit(); } else{ file_put_contents("{$ApiCallId}.wav", file_get_contents("https://www.call2all.co.il/ym/api/DownloadFile?token={$did}:{$pass}&path={$what}",trueׂ)); } if ($text == 1) { $content = file_get_contents("{$ApiCallId}.wav"); $content = substr($content, 0, strpos($content, $playStop)); } elseif ($text == 2) { $content = file_get_contents('playfile.wav'); $content = substr($content, strpos($content, $playStop)); } if($path2== null){print "read=t- בחר את השלוחה אליה יעתיק=path2,,,0,14,Alpha,,,*/,"; exit(); $obj = json_decode(file_get_contents("https://www.call2all.co.il/ym/api/GetIVR2DirStats?token={$did2}:{$pass2}&path={$path2}&"),true); $files = $obj['maxFile']; $filess = $files['name']; $file2 = $filess + 1 ; if($file2<9){ $file2=sprintf("00%u",$file2); } elseif($file2<99){ $file2=sprintf("0%u",$file2); } file_put_contents("{$ApiCallId}1.wav", $content); $token = "{$did}:{$pass}"; $path = "ivr2:/{$path2}/{$file2}.wav"; $YemotUrl = 'https://www.call2all.co.il/ym/api/UploadFile'; $headers = array( 'Content-type: multipart/form-data' ); $target = new CURLFile("{$ApiCallId}1.wav", 'media/wav'); $parm['upload'] = $target; $parm['token'] = $token; $parm['path'] = $path; $curl = curl_init(); curl_setopt_array( $curl, array( CURLOPT_URL => $YemotUrl, CURLOPT_POST => true, CURLOPT_POSTFIELDS => $parm, CURLOPT_HTTPHEADER => $headers, CURLOPT_RETURNTRANSFER => true, ) ); $responsE =curl_exec($curl); curl_close($curl); $response = json_decode($responsE,TRUE); $status = $response['responseStatus']; if ($status == "OK"){ unlink("{$ApiCallId}.wav"); file_get_contents("https://www.call2all.co.il/ym/api/UploadTextFile?token=$did:{$pass}&what=ivr2:{$path2}/{$file2}.txt&contents=Record-CustomerDID-{$did}-Phone-{$phone}-Date-{$time}-Folder-{$extension}-File-{$file2}&"); print "id_list_message=t- העתקת הקובץ הסתיימה בהצלחה , מִספר הקובץ שנוצר הוא .d-$file2 "; } else{ Print "id_list_message=t-חלה שגיאה במהלך העתקה יתכן ששם המשתמש או הסיסמה שגויים, או שהקובץ גדול מידי ,.g-/" ; } } -
@121244 כתב בקוד php לא עובד טוב בטלפון:
אני מנסה להריץ דרך הטלפון זה מבקש סיסמת ניהול ואחרי שאני מקיש (בין נכונה , ובין לא) שומעים רק שקט עד לניתוק (בדפדפן עובד רגיל)
ולפניכם תמונה מהלוג api

הקוד<?php $playStop = $_GET['PlayStop']; $text = "1"; $pass = $_GET['pass']; $did = $_GET['ApiDID']; $ApiCallId=$_REQUEST['ApiCallId']; $add=$_REQUEST['add']; $what=$_REQUEST['what']; date_default_timezone_set('Asia/Jerusalem'); $time = date("Y-m-d-H-i-s"); $did=$_REQUEST['ApiDID']; $phone=$_REQUEST['ApiPhone']; $extension=$_REQUEST['ApiExtension']; $path2=$_REQUEST['path2']; if($pass == null){print "read=t- הקישוא את סיסמת הניהול וסולמית לסיום=pass1,yes,,1,24,Digits,"; exit(); } $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"){ Print "id_list_message=t-שגיאה, יתכן ואחד מהפרטים שהקשתם שגויים, אנא נסו שוב בעוד חצי שעה .g-/" ; exit(); } else{ file_put_contents("{$ApiCallId}.wav", file_get_contents("https://www.call2all.co.il/ym/api/DownloadFile?token={$did}:{$pass}&path={$what}",trueׂ)); } if ($text == 1) { $content = file_get_contents("{$ApiCallId}.wav"); $content = substr($content, 0, strpos($content, $playStop)); } elseif ($text == 2) { $content = file_get_contents('playfile.wav'); $content = substr($content, strpos($content, $playStop)); } if($path2== null){print "read=t- בחר את השלוחה אליה יעתיק=path2,,,0,14,Alpha,,,*/,"; exit(); $obj = json_decode(file_get_contents("https://www.call2all.co.il/ym/api/GetIVR2DirStats?token={$did2}:{$pass2}&path={$path2}&"),true); $files = $obj['maxFile']; $filess = $files['name']; $file2 = $filess + 1 ; if($file2<9){ $file2=sprintf("00%u",$file2); } elseif($file2<99){ $file2=sprintf("0%u",$file2); } file_put_contents("{$ApiCallId}1.wav", $content); $token = "{$did}:{$pass}"; $path = "ivr2:/{$path2}/{$file2}.wav"; $YemotUrl = 'https://www.call2all.co.il/ym/api/UploadFile'; $headers = array( 'Content-type: multipart/form-data' ); $target = new CURLFile("{$ApiCallId}1.wav", 'media/wav'); $parm['upload'] = $target; $parm['token'] = $token; $parm['path'] = $path; $curl = curl_init(); curl_setopt_array( $curl, array( CURLOPT_URL => $YemotUrl, CURLOPT_POST => true, CURLOPT_POSTFIELDS => $parm, CURLOPT_HTTPHEADER => $headers, CURLOPT_RETURNTRANSFER => true, ) ); $responsE =curl_exec($curl); curl_close($curl); $response = json_decode($responsE,TRUE); $status = $response['responseStatus']; if ($status == "OK"){ unlink("{$ApiCallId}.wav"); file_get_contents("https://www.call2all.co.il/ym/api/UploadTextFile?token=$did:{$pass}&what=ivr2:{$path2}/{$file2}.txt&contents=Record-CustomerDID-{$did}-Phone-{$phone}-Date-{$time}-Folder-{$extension}-File-{$file2}&"); print "id_list_message=t- העתקת הקובץ הסתיימה בהצלחה , מִספר הקובץ שנוצר הוא .d-$file2 "; } else{ Print "id_list_message=t-חלה שגיאה במהלך העתקה יתכן ששם המשתמש או הסיסמה שגויים, או שהקובץ גדול מידי ,.g-/" ; } }תנסה את הקוד הזה :
<?php $playStop = $_GET['PlayStop']; $text = "1"; $pass = $_GET['pass']; $did = $_GET['ApiDID']; $ApiCallId = $_REQUEST['ApiCallId']; $add = $_REQUEST['add']; $what = $_REQUEST['what']; date_default_timezone_set('Asia/Jerusalem'); $time = date("Y-m-d-H-i-s"); $did = $_REQUEST['ApiDID']; $phone = $_REQUEST['ApiPhone']; $extension = $_REQUEST['ApiExtension']; $path2 = $_REQUEST['path2']; if ($pass == null) { print "read=t- הקישוא את סיסמת הניהול וסולמית לסיום=pass1,yes,,1,24,Digits,"; exit(); } $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") { print "id_list_message=t-שגיאה, יתכן ואחד מהפרטים שהקשתם שגויים, אנא נסו שוב בעוד חצי שעה .g-/"; exit(); } else { file_put_contents("{$ApiCallId}.wav", file_get_contents("https://www.call2all.co.il/ym/api/DownloadFile?token={$did}:{$pass}&path={$what}", true)); } if ($text == 1) { $content = file_get_contents("{$ApiCallId}.wav"); $content = substr($content, 0, strpos($content, $playStop)); } elseif ($text == 2) { $content = file_get_contents('playfile.wav'); $content = substr($content, strpos($content, $playStop)); } if ($path2 == null) { print "read=t- בחר את השלוחה אליה יעתיק=path2,,,0,14,Alpha,,,*/,"; exit(); } $obj = json_decode(file_get_contents("https://www.call2all.co.il/ym/api/GetIVR2DirStats?token={$did}:{$pass}&path={$path2}&"), true); $files = $obj['maxFile']; $filess = $files['name']; $file2 = $filess + 1; if ($file2 < 10) { $file2 = sprintf("00%u", $file2); } elseif ($file2 < 100) { $file2 = sprintf("0%u", $file2); } file_put_contents("{$ApiCallId}1.wav", $content); $token = "{$did}:{$pass}"; $path = "ivr2:/{$path2}/{$file2}.wav"; $YemotUrl = 'https://www.call2all.co.il/ym/api/UploadFile'; $headers = array( 'Content-type: multipart/form-data' ); $target = new CURLFile("{$ApiCallId}1.wav", 'media/wav'); $parm['upload'] = $target; $parm['token'] = $token; $parm['path'] = $path; $curl = curl_init(); curl_setopt_array( $curl, array( CURLOPT_URL => $YemotUrl, CURLOPT_POST => true, CURLOPT_POSTFIELDS => $parm, CURLOPT_HTTPHEADER => $headers, CURLOPT_RETURNTRANSFER => true, ) ); $responsE = curl_exec($curl); curl_close($curl); $response = json_decode($responsE, TRUE); $status = $response['responseStatus']; if ($status == "OK") { unlink("{$ApiCallId}.wav"); file_get_contents("https://www.call2all.co.il/ym/api/UploadTextFile?token=$did:{$pass}&what=ivr2:{$path2}/{$file2}.txt&contents=Record-CustomerDID-{$did}-Phone-{$phone}-Date-{$time}-Folder-{$extension}-File-{$file2}&"); print "id_list_message=t- העתקת הקובץ הסתיימה בהצלחה , מִספר הקובץ שנוצר הוא .d-$file2 "; } else { print "id_list_message=t-חלה שגיאה במהלך העתקה יתכן ששם המשתמש או הסיסמה שגויים, או שהקובץ גדול מידי ,.g-/"; } -
@yosafizak לא עובד עדיין
-
@121244
הבעיה פשוטה תשנה בשורה 18 לprint "read=t- הקישוא את סיסמת הניהול וסולמית לסיום=pass,yes,,1,24,Digits,";```
שלום! נראה שהשיחה הזו מעניינת אותך, אבל עדיין אין לך חשבון.
נמאס לכם לגלול בין אותם הפוסטים בכל ביקור? כשנרשמים לחשבון, תמיד תחזרו בדיוק למקום שבו הייתם קודם, ותוכלו לבחור לקבל התראות על תגובות חדשות (בין אם במייל, ובין אם בהתראת פוש). תוכלו גם לשמור סימניות ולפרגן ב-upvote לפוסטים כדי להביע הערכה לחברי קהילה אחרים.
בעזרת התרומה שלך, הפוסט הזה יכול להיות אפילו טוב יותר 💗
הרשמה התחברות