first test success 05/12/2024
This commit is contained in:
@@ -152,6 +152,7 @@ public class Main {
|
||||
@Override
|
||||
public void CalleePickup(SIP_Response resp) {
|
||||
Logger.info("Callee Pickup, Response: {}",resp);
|
||||
oncallResponse = resp;
|
||||
SipStatus = "Communication with "+resp.CallID;
|
||||
}
|
||||
});
|
||||
@@ -245,6 +246,15 @@ public class Main {
|
||||
}
|
||||
break;
|
||||
case "call":
|
||||
int extension = ParseInt(req.getData(),-1) ;
|
||||
if (extension>0){
|
||||
if (Call(""+extension)){
|
||||
resp = new SocketioResponse("success", "Call to "+extension+" is successful");
|
||||
} else {
|
||||
resp = new SocketioResponse("error", "Call to "+extension+" is failed");
|
||||
}
|
||||
} else resp = new SocketioResponse("error", "Invalid Extension");
|
||||
break;
|
||||
case "getDiskInfo":
|
||||
resp = new SocketioResponse("error", "Not Implemented");
|
||||
break;
|
||||
@@ -265,7 +275,7 @@ public class Main {
|
||||
callButton.setOnLongPress(vv->{
|
||||
Logger.info("Call Button Long Pressed");
|
||||
//pickupCall();
|
||||
CallTest("100");
|
||||
Call("100");
|
||||
});
|
||||
callButton.setOnShortPress(vv->{
|
||||
Logger.info("Call Button Short Pressed");
|
||||
@@ -357,6 +367,10 @@ public class Main {
|
||||
return MessageFormat.format("sip:{0}@{1}", extension, client.getServerAddress());
|
||||
}
|
||||
|
||||
private static boolean Call(String extension){
|
||||
return client.Call(CreateSipCallNumber(extension));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private static void CallTest(String extension){
|
||||
String callnumber = CreateSipCallNumber(extension);
|
||||
|
||||
@@ -12,7 +12,6 @@ import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.LinkOption;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Properties;
|
||||
|
||||
Reference in New Issue
Block a user