Nexmo를 처음 사용하고 App-to-Phone 통화를 설정하려고합니다. 음성 통화는 인터넷을 통해 모바일 Ionic/Cordova 앱 사용자가 시작하며 PSTN에서 전화벨이 울립니다. 수신자가 응답하고 양 당사자는 말하고들을 수 있습니다.App-to-Phone 통화 Nexmo
이제 서버를 설정하고 PSTN에서 전화를받을 수있게되었습니다. 응답 할 수 있으며 NCCO를 사용하여 수신자에게 텍스트를 말할 수 있습니다.
그러나 발신자 클라이언트 측에서 Nexmo를 처리하는 방법을 알 수는 없습니다. 앱과 PSTN 간의 연결을 설정하려면 어떻게해야합니까? Nexmo를 통해 음성 교환을 송수신하는 방법은 무엇입니까? docs와 npm nexmo 패키지에서 Text-to-Speech를 사용하는 예제 만 찾을 수 있습니다.
내 서버는 Nexmo docs에서이 코드를 가지고 자세한 정보가 필요한 경우
<?php
include 'application_generate_jwt.php';
//Connection information
$base_url = 'https://api.nexmo.com' ;
$version = '/v1';
$action = '/calls';
//User and application information
$application_id = "id-for-your-voice-application";
//Mint your JWT
$keyfile="application_secret_key.txt";
$jwt = generate_jwt($application_id, $keyfile);
//Add the JWT to the request headers
$headers = array('Content-Type: application/json', "Authorization: Bearer " . $jwt) ;
//Change the to parameter to the number you want to call
$payload = '{
"to":[{
"type": "phone",
"number": "441632960961"
}],
"from": {
"type": "phone",
"number": "441632960960"
},
"answer_url": ["https://nexmo-community.github.io/ncco-examples/first_call_talk.json"]
}';
//Create the request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $base_url . $version . $action);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
$response = curl_exec($ch);
echo $response;
은 알려 주시기 바랍니다!
현재 Nexmo Voice API는 클라이언트 측 기술이 아닌 서버 측 기술과 함께 작동하도록 제작되었습니다. 따라서 클라이언트 측 앱을 통해 클라이언트에서 호출을 제어 할 수 없습니다. – leggetter
안녕하세요, 저는 통화 흐름이 서버 측에서 처리되는 것을 알고 있습니다. 그러나 Nexmo Voice API를 사용하여 PSTN의 번호로 인터넷을 통해 (내 서버를 통해) 모바일 응용 프로그램 내에서 전화를 걸 수 있습니까? 아니면 SIP를 사용해야합니까? – Thev