2016-07-05 17 views
0

내 Yealink VOIP 전화로 웹 페이지에서 tel : -link를 사용하기 위해 Windows 7 컴퓨터에서 완벽하게 작동하는이 스크립트를 작성했습니다. 'reg-file'을 사용하여 주석에있는 스크립트의 tel-link uasage를 활성화했습니다. 하지만 이제 Windows 10에서는 더 이상 사용할 수 없습니다! 누구든지 브라우저에서 "tel link"를 Windows 10에서 다시 내 스크립트에 "링크"할 수있는 방법을 알려줍니다.Windows 사용자 정의 tel/callto 앱을 등록하십시오.

* 특정 URI 체계를 처리 할 수있는 응용 프로그램을 등록하려면 사용자 정의 URI 계획 처리 응용 프로그램 등록이와 함께, 새로운 키를 추가

/* 
test usage: cscript Z:\tel_link_open\tel.js [phone number] 

create register_me.reg with: 
REGEDIT4 

[HKEY_CLASSES_ROOT\tel] 
@="URL:knoop.frl Custom Telephone Protocol for VoIP phone" 
"URL Protocol"="" 

[HKEY_CLASSES_ROOT\tel\shell] 

[HKEY_CLASSES_ROOT\tel\shell\open] 

[HKEY_CLASSES_ROOT\tel\shell\open\command] 
@="cscript \"Z:\\tel_link_open\\tel.js\" -c \"\\%1\"" 

*/ 

var call_number = WScript.Arguments(0); 
call_number = call_number.replace(/\|.+/g,''); 
//         spatie -. 
call_number = call_number.replace(/(\\tel:|%20|\(|\)|[a-z:\\ -]+)/g,''); 
//         +  31  ( 0 ) 
call_number = call_number.replace(/(\+|%2b)([0-9]+)(\(|%28)0(\)|%29)/ig,'00$2'); 
call_number = call_number.replace(/^0031/ig,'0'); 

WScript.Echo("\n\nGoing to dail: " + call_number + "\n\n"); 

//WScript.Sleep(50000000); 

var outgoing_uri = "31"+"513"+"[number]"+"[internal extension]"; 
var login_name = "XXX"; 
var login_pass = "yyy"; 
var get_url  = "http://192.168.xx.yy/servlet?number=" + call_number + "&outgoing_uri=" + outgoing_uri; 

// Load the WinHttpRequest object. 
var WinHttpReq = new ActiveXObject("WinHttp.WinHttpRequest.5.1"); 

// HttpRequest SetCredentials flags 
HTTPREQUEST_SETCREDENTIALS_FOR_SERVER = 0; 

// Specify the target resource. 
WinHttpReq.open("GET", 
           get_url, 
           false); 

if (login_name.length) { // Set credentials for server. 
    WinHttpReq.SetCredentials(login_name, 
                 login_pass, 
                 HTTPREQUEST_SETCREDENTIALS_FOR_SERVER); 
} 

// It might also be necessary to supply credentials 
// to the proxy if you connect to the Internet 
// through a proxy that requires authentication. 

// Send a request to the server and wait for 
// a response. 
WinHttpReq.send(); 

// Display the results of the request. 
WScript.Echo("Result status: " + WinHttpReq.Status + " " + WinHttpReq.StatusText + "\n"); 
WScript.Echo(WinHttpReq.GetAllResponseHeaders()); 

/* To save a binary file use this code instead of previous line 
BinStream = new ActiveXObject("ADODB.Stream"); 
BinStream.Type = 1; 
BinStream.Open(); 
BinStream.Write(WinHttpReq.ResponseBody); 
BinStream.SaveToFile("out.bin"); 
*/ 

답변

0

난 당신이 MSDN Microsoft의 해결책을 찾을 수 있다고 생각 적절한 하위 키와 값을 HKEY_CLASSES_ROOT에 추가합니다. 루트 키는 추가되는 URI 스킴과 일치해야합니다.

HKEY_CLASSES_ROOT
[프로토콜 이름]
URL 프로토콜 = ""이 새로운 키 아래

, URL을 다음과 같이 예를 들어, 계획을 추가하려면, HKEY_CLASSES_ROOT에 [프로토콜 이름] 키를 추가 프로토콜 문자열 값은이 키가 사용자 지정 플러그 가능한 프로토콜 처리기를 선언 함을 나타냅니다. 이 키가 없으면 핸들러 응용 프로그램이 실행되지 않습니다. 값은 빈 문자열이어야합니다.
...
사용자가 사용자 지정 URI 체계가 포함 된 링크를 클릭하면 Windows Internet Explorer는 해당 URI 체계에 대해 등록 된 플러그 가능한 프로토콜 처리기를 시작합니다. 레지스트리에 지정된 지정된 개방 명령은 % 1 매개 변수가 포함되어있는 경우, Internet Explorer는 등록 된 플러그 프로토콜 핸들러 응용 프로그램에 URI를 전달합니다. *

자세한 내용은이를 위해 노력하고 있습니다

Registering an Application to a URI Scheme

아래 참조 tel-URI이지만 callto-URI는 Skype에 등록 된 어딘가입니다. 레지스트리에서 레지스트리를 검색하고 거기에 애플리케이션을 추가해야합니다.

+0

스택 오버 플로우에 오신 것을 환영합니다! 이것은 이론적으로 질문에 대답 할 수 있지만 여기에 대답의 핵심 부분을 포함하고 참조 용 링크를 제공하는 것이 바람직합니다 (// meta.stackoverflow.com/q/8259). – Takarii