Recieved list
This commit is contained in:
@@ -0,0 +1,233 @@
|
||||
<!-- *********************************************************************** -->
|
||||
|
||||
<SCRIPT type="text/JavaScript">
|
||||
var in_call_list = new Array(new Array("17.07.2012 15:55:23","030468194451","1","00:00:40"), new Array("17.07.2012 12:13:04","016097941642","","00:00:00"), new Array("17.07.2012 11:00:57","02143056256","1","00:02:07"), new Array("16.07.2012 20:16:42","03053142218","1","00:01:09"), new Array("16.07.2012 13:02:37"," ","","00:00:00"), new Array("16.07.2012 09:40:42","03091701406","1","00:00:22"));
|
||||
var anrl_sum = in_call_list.length;
|
||||
</SCRIPT>
|
||||
<!-- *********************************************************************** -->
|
||||
|
||||
|
||||
==============================================================
|
||||
|
||||
|
||||
--- login() --------------------------------------
|
||||
Username=admin&Password=NTM3OTUzMDY=
|
||||
Cookie: SessionID_R3=8UTiifjN86x
|
||||
Status: 200
|
||||
--- getList() --------------------------------------
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
|
||||
<HTML>
|
||||
|
||||
<HEAD>
|
||||
|
||||
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<META name="author" content="J.Huber, R.Kunz">
|
||||
|
||||
<SCRIPT language="JavaScript">
|
||||
gVarPubEnable = 'Enable';
|
||||
gVarPubsEnable = 'Enable';
|
||||
gVarPubDisable = 'Disable';
|
||||
gVarPubApply = 'Submit';
|
||||
gVarPubNew = 'New';
|
||||
gVarPubRemove = 'Remove';
|
||||
gVarPubHelp = 'Help';
|
||||
gVarPubConfigure = 'Settings';
|
||||
gVarPubSequence = 'Index';
|
||||
gVarDay = 'days';
|
||||
gVarHour = 'hours';
|
||||
gVarMinute = 'minutes';
|
||||
gVarSecond = 'seconds';
|
||||
gVar_Up = 'Up';
|
||||
gVar_Down = 'Down';
|
||||
gVar_Auto = 'Auto';
|
||||
gVar_Full = 'Full';
|
||||
gVar_Half = 'Half';
|
||||
gVarConnecting = 'Connecting';
|
||||
gVarConnected = 'Connected';
|
||||
gVarPending = 'PendingDisconnect';
|
||||
gVarDisConnecting = 'Disconnecting';
|
||||
gVarDisConnected = 'Disconnected';
|
||||
gVarAuthenticating = 'Authenticating';
|
||||
gVarAcc_eth = 'Ethernet';
|
||||
gVarAlertNot_Add = 'Please add one item at least!';
|
||||
gVarAlertNot_Select = 'Please select one item at least!';
|
||||
gVarDeleteLinkConfirm = 'Related IP/PPP connections will also be deleted. Are you sure to delete?';
|
||||
gVarPubFlush = 'Flush';
|
||||
gVarPubRefresh = 'Refresh';gVarStatusDetails = 'Status-Details / Anruferliste';
|
||||
gVarZurck = 'Zur�ck';
|
||||
gVarAktualisieren = 'Aktualisieren';
|
||||
gVarAnruferliste = 'Anruferliste';
|
||||
gVarTelefonnummer = 'Telefonnummer';
|
||||
gVarAS = 'AS';
|
||||
gVarZeitpunkt = 'Zeitpunkt';
|
||||
gVarDauer = 'Dauer';
|
||||
|
||||
</SCRIPT>
|
||||
<TITLE>Speedport W 723V Konfigurationsprogramm</TITLE>
|
||||
|
||||
<SCRIPT type="text/JavaScript" charset="iso-8859-1" src="/pub/js_top_25.js"></SCRIPT>
|
||||
<SCRIPT type="text/JavaScript" charset="iso-8859-1" src="/pub/js_menu_25.js"></SCRIPT>
|
||||
<SCRIPT type="text/JavaScript" charset="iso-8859-1" src="/pub/js_str_de_25.js"></SCRIPT>
|
||||
<SCRIPT type="text/JavaScript" charset="iso-8859-1" src="/pub/js_info_25.js"></SCRIPT>
|
||||
<SCRIPT type="text/JavaScript">g_VarUserLevel=2</SCRIPT>
|
||||
|
||||
|
||||
<!-- *********************************************************************** -->
|
||||
|
||||
<SCRIPT type="text/JavaScript">
|
||||
var in_call_list = new Array(new Array("17.07.2012 15:55:23","030468194451","1","00:00:40"), new Array("17.07.2012 12:13:04","016097941642","","00:00:00"), new Array("17.07.2012 11:00:57","02143056256","1","00:02:07"), new Array("16.07.2012 20:16:42","03053142218","1","00:01:09"), new Array("16.07.2012 13:02:37"," ","","00:00:00"), new Array("16.07.2012 09:40:42","03091701406","1","00:00:22"));
|
||||
var anrl_sum = in_call_list.length;
|
||||
</SCRIPT>
|
||||
<!-- *********************************************************************** -->
|
||||
|
||||
|
||||
<SCRIPT type="text/JavaScript">
|
||||
<!--
|
||||
var pseudo_cookie = new WebPseudoCookie("SessionID_R3,8UTiifjN86x");
|
||||
function chk(){
|
||||
infothema = "iStatusdetailsAnruferliste";
|
||||
initInfo("status");
|
||||
start_refresh();
|
||||
mark_akt = 42;
|
||||
stAInit();
|
||||
}
|
||||
|
||||
function stAkt(){
|
||||
location.href = make_href_url("hcti_status_telanrl.php");
|
||||
}
|
||||
|
||||
function stDel(){
|
||||
if (confirmEx(mld1_StatusdetailsAnruferliste)==true){
|
||||
document.getElementById("ausblend").style.visibility='visible';
|
||||
trigger_annimation('picAnim');
|
||||
HideDeleteAndSubmitBut();
|
||||
var form = new webSubmitForm();
|
||||
form.setAction('delLog.cgi?type=0&RequestFile=/auth/hcti_status_telanrl.php');
|
||||
form.submit();
|
||||
}
|
||||
}
|
||||
|
||||
function stZrk(){
|
||||
location.href = make_href_url("hcti_status.php");
|
||||
}
|
||||
for(i=0;i<anrl_sum;i++)
|
||||
{
|
||||
if(' '==in_call_list[i][1])
|
||||
{
|
||||
in_call_list[i][1]="Unbekannt";
|
||||
}
|
||||
}
|
||||
//-->
|
||||
|
||||
</SCRIPT>
|
||||
|
||||
<LINK rel="stylesheet" href="/pub/style_25.css" type="text/css">
|
||||
|
||||
<STYLE type="text/css">
|
||||
div.colStd {width: 145px; max-width: 145px;}
|
||||
div.colText {width: 40px; max-width: 40px; text-align: center;}
|
||||
div.colStd2 {width: 120px; max-width: 120px;}
|
||||
|
||||
#scroll{HEIGHT: 445px;}
|
||||
#picAnim {background-image:none;}
|
||||
</STYLE>
|
||||
|
||||
</HEAD>
|
||||
|
||||
<BODY onload="chk()">
|
||||
|
||||
<DIV id="frameBanner">
|
||||
<IMG src="/pub/pic_b.gif" alt="">
|
||||
</DIV>
|
||||
|
||||
<SCRIPT type="text/JavaScript">
|
||||
<!--
|
||||
menu(42);
|
||||
//-->
|
||||
</SCRIPT>
|
||||
|
||||
<DIV id="frameEingabe">
|
||||
<DIV id="border">
|
||||
|
||||
<DIV class="pfad"><SCRIPT language="JavaScript" type="text/javascript">document.write(eval("gVarStatusDetails"));</script></DIV>
|
||||
<DIV class="lineThW"></DIV>
|
||||
|
||||
<FORM name="F1" action="hcti_status_telanrl.php" method="post" onSubmit="return false;">
|
||||
|
||||
<SCRIPT type="text/JavaScript">
|
||||
<!--
|
||||
if (anrl_sum > 14) document.write('<DIV id=scroll>');
|
||||
|
||||
if (anrl_sum > 0){
|
||||
document.write(
|
||||
'<DIV class=titel>' +
|
||||
'<DIV class=colStd2>'+gVarZeitpunkt+'<\/DIV>' +
|
||||
'<DIV class=colAbst><\/DIV>' +
|
||||
'<DIV class=colStd>'+gVarTelefonnummer+'<\/DIV>' +
|
||||
'<DIV class=colAbst><\/DIV>' +
|
||||
'<DIV class=colText>'+gVarAS+'<\/DIV>' +
|
||||
'<DIV class=colAbst><\/DIV>' +
|
||||
'<DIV class=colLast>'+gVarDauer+'<\/DIV>' +
|
||||
'<\/DIV>');
|
||||
for (i=0;i<anrl_sum;i++){
|
||||
document.write(
|
||||
'<DIV class=rowStd>' +
|
||||
'<DIV class=colStd2>' + in_call_list[i][0] + '<\/DIV>' +
|
||||
'<DIV class=colAbst><\/DIV>' +
|
||||
'<DIV class=colStd>' + in_call_list[i][1] + '<\/DIV>' +
|
||||
'<DIV class=colAbst><\/DIV>' +
|
||||
'<DIV class=colText>' + in_call_list[i][2] + '<\/DIV>' +
|
||||
'<DIV class=colAbst><\/DIV>' +
|
||||
'<DIV class=colLast>' + in_call_list[i][3] + '<\/DIV>' +
|
||||
'<\/DIV>');
|
||||
if (i<anrl_sum-1) document.write('<DIV class=lineBtw><\/DIV>');
|
||||
}
|
||||
}
|
||||
else{
|
||||
document.write(
|
||||
'<DIV class=titel><DIV class=colVoll>'+gVarAnruferliste+'<\/DIV><\/DIV>' +
|
||||
'<DIV class=rowStd>' +
|
||||
'<DIV class=colLast>Es liegen bisher keine Anrufe vor.<\/DIV>' +
|
||||
'<\/DIV>');
|
||||
}
|
||||
|
||||
if (anrl_sum > 14) document.write('<DIV class=rowLeer><\/DIV><\/DIV>');
|
||||
//-->
|
||||
|
||||
</SCRIPT>
|
||||
|
||||
<DIV class=rowBottom></DIV>
|
||||
|
||||
</FORM>
|
||||
|
||||
</DIV>
|
||||
|
||||
<DIV id="ausblend"></DIV>
|
||||
<SCRIPT type="text/JavaScript">
|
||||
fit_animation('picAnim', '/pub/pic_c_verzoeg_1.gif');
|
||||
</SCRIPT>
|
||||
|
||||
</DIV>
|
||||
|
||||
<DIV id="frameBut">
|
||||
<DIV id="but1" class="but" onclick="startseite()" onmouseover="rahmen(1,1)" onmouseout="rahmen(0,1)"><< <<</DIV>
|
||||
<SCRIPT type="text/JavaScript">
|
||||
<!--
|
||||
if (anrl_sum > 0){
|
||||
document.write('<DIV id=but2 class=but onclick="stDel()" onmouseover="rahmen(1,2)" onmouseout="rahmen(0,2)">L�schen<\/DIV>');
|
||||
}
|
||||
//-->
|
||||
|
||||
</SCRIPT>
|
||||
<DIV id="but3" class="but" onclick="stZrk()" onmouseover="rahmen(1,3)" onmouseout="rahmen(0,3)"><SCRIPT language="JavaScript" type="text/javascript">document.write(eval("gVarZurck"));</script> <<</DIV>
|
||||
<DIV id="but4" class="but" onclick="stAkt()" onmouseover="rahmen(1,4)" onmouseout="rahmen(0,4)"><SCRIPT language="JavaScript" type="text/javascript">document.write(eval("gVarAktualisieren"));</script></DIV>
|
||||
</DIV>
|
||||
|
||||
<DIV id="frameInfo"></DIV>
|
||||
|
||||
</BODY>
|
||||
|
||||
</HTML>
|
||||
--- logout() --------------------------------------
|
||||
@@ -1,20 +1,36 @@
|
||||
package de.tilman.callerId;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Scanner;
|
||||
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.HttpRequest;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.NameValuePair;
|
||||
import org.apache.http.ProtocolException;
|
||||
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.apache.http.impl.client.DefaultRedirectStrategy;
|
||||
import org.apache.http.message.BasicNameValuePair;
|
||||
import org.apache.http.protocol.HttpContext;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
|
||||
public class CallerIdClient {
|
||||
|
||||
DefaultHttpClient httpclient = new DefaultHttpClient();
|
||||
|
||||
|
||||
String password = com.sun.org.apache.xerces.internal.impl.dv.util.Base64.encode("53795306".getBytes());
|
||||
String cookie;
|
||||
|
||||
@@ -22,19 +38,27 @@ public class CallerIdClient {
|
||||
|
||||
// com.sun.org.apache.xerces.internal.impl.dv.util.Base64.encode(null);
|
||||
|
||||
// plain Java
|
||||
try {
|
||||
login();
|
||||
getList();
|
||||
logout();
|
||||
} catch (Exception e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
|
||||
// Apache http client
|
||||
// try {
|
||||
// apacheLogin();
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
private void login() throws Exception {
|
||||
System.out.println("Login:");
|
||||
String body = "Username=" + URLEncoder.encode("admin", "UTF-8") + "&"
|
||||
+ "Password=" + password;
|
||||
System.out.println("--- login() --------------------------------------");
|
||||
String body = "Username=" + URLEncoder.encode("admin", "UTF-8") + "&" + "Password=" + password;
|
||||
System.out.println(body);
|
||||
|
||||
URL url2 = new URL("https://speedport.ip/index/login.cgi");
|
||||
@@ -55,42 +79,45 @@ public class CallerIdClient {
|
||||
if (line.startsWith("SessionID_R3")) {
|
||||
System.out.println("Cookie: " + line);
|
||||
cookie = line.substring(13);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
System.out.println("Answer: " + line);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int status = connection.getResponseCode();
|
||||
System.out.println("Status: " + status);
|
||||
|
||||
|
||||
writer.close();
|
||||
reader.close();
|
||||
}
|
||||
|
||||
|
||||
private void getList() throws Exception {
|
||||
// SessionID_R3=TGmoTck49mz
|
||||
System.out.println("--- getList() --------------------------------------");
|
||||
//https://speedport.ip/auth/hcti_status_telanrl.php?cookie=SessionID_R3,xctyNRvrwuh
|
||||
|
||||
URL u = new URL("https://speedport.ip/auth/hcti_status_telanrl.php?cookie=SessionID_R3," + cookie);
|
||||
URLConnection urlConn = u.openConnection();
|
||||
String cookieString = "SessionID_R3=" + cookie;
|
||||
urlConn.setRequestProperty("Cookie", cookieString);
|
||||
InputStream response = urlConn.getInputStream();
|
||||
|
||||
URL u = new URL("https://speedport.ip/");
|
||||
String r = new Scanner(u.openStream()).useDelimiter("\\Z").next();
|
||||
String r = new Scanner(response).useDelimiter("\\Z").next();
|
||||
System.out.println(r);
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void logout() throws Exception {
|
||||
|
||||
System.out.println("--- logout() --------------------------------------");
|
||||
URL myUrl = new URL("https://speedport.ip/auth/logout.cgi?RequestFile=/pub/top_beenden.php&cookie=SessionID_R3," + cookie);
|
||||
URLConnection urlConn = myUrl.openConnection();
|
||||
String cookieString = "SessionID_R3=" + cookie;
|
||||
urlConn.setRequestProperty("Cookie", cookieString);
|
||||
urlConn.connect();
|
||||
|
||||
// URL u = new URL("https://speedport.ip/pub/top_beenden.php");
|
||||
// // https://speedport.ip/logout.cgi?RequestFile=/pub/top_beenden.php
|
||||
// String r = new Scanner(u.openStream()).useDelimiter("\\Z").next();
|
||||
// System.out.println("Logout:");
|
||||
// System.out.println(r);
|
||||
|
||||
// URL u = new URL("https://speedport.ip/pub/top_beenden.php");
|
||||
// // https://speedport.ip/logout.cgi?RequestFile=/pub/top_beenden.php
|
||||
// String r = new Scanner(u.openStream()).useDelimiter("\\Z").next();
|
||||
// System.out.println("Logout:");
|
||||
// System.out.println(r);
|
||||
}
|
||||
|
||||
private void plainJava() throws Exception {
|
||||
@@ -120,6 +147,65 @@ public class CallerIdClient {
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void apacheLogin() throws Exception {
|
||||
httpclient.setRedirectStrategy(new DefaultRedirectStrategy() {
|
||||
public boolean isRedirected(HttpRequest request, HttpResponse response, HttpContext context) {
|
||||
boolean isRedirect = false;
|
||||
try {
|
||||
isRedirect = super.isRedirected(request, response, context);
|
||||
} catch (ProtocolException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (!isRedirect) {
|
||||
int responseCode = response.getStatusLine().getStatusCode();
|
||||
if (responseCode == 301 || responseCode == 302) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return isRedirect;
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
* // Apache 1 HttpPost httpPost = new
|
||||
* HttpPost("https://speedport.ip/index/login.cgi"); List<NameValuePair>
|
||||
* nvps = new ArrayList<NameValuePair>(); nvps.add(new
|
||||
* BasicNameValuePair("Username", "admin")); nvps.add(new
|
||||
* BasicNameValuePair("Password", password)); httpPost.setEntity(new
|
||||
* UrlEncodedFormEntity(nvps)); HttpResponse response2 =
|
||||
* httpclient.execute(httpPost);
|
||||
*
|
||||
* try { System.out.println(response2.getStatusLine()); HttpEntity
|
||||
* entity2 = response2.getEntity(); // do something useful with the
|
||||
* response body // and ensure it is fully consumed
|
||||
* EntityUtils.consume(entity2); } finally {
|
||||
* httpPost.releaseConnection(); }
|
||||
*/
|
||||
|
||||
/*
|
||||
* // Apache 2 PostMethod post = new
|
||||
* PostMethod("https://speedport.ip/index/login.cgi"); NameValuePair[]
|
||||
* data = { new NameValuePair("Username", "admin"), new
|
||||
* NameValuePair("Password", password) }; post.setRequestBody(data);
|
||||
*
|
||||
* // post.setParameter("Cookie", "SessionID_R3=Rian5OU7Cuj");
|
||||
* post.addRequestHeader("Referer", "https://speedport.ip/");
|
||||
* post.addRequestHeader("Cookie", "SessionID_R3=Rian5OU7Cuj");
|
||||
*
|
||||
* try { int resp = client.executeMethod(post);
|
||||
* System.out.println("Response Code: " + resp); } catch (HttpException
|
||||
* e1) { e1.printStackTrace(); } catch (IOException e1) {
|
||||
* e1.printStackTrace(); }
|
||||
*
|
||||
* // execute method and handle any error responses. try { InputStream
|
||||
* in = post.getResponseBodyAsStream(); System.out.println("response: "
|
||||
* + in); } catch (IOException e) { e.printStackTrace(); }
|
||||
*/
|
||||
|
||||
httpclient.getConnectionManager().shutdown();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param args
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user