To receive a voice call, your application must monitor the phone control object (/pps/services/phone/private/control). When the phone service receives an incoming voice call, it writes the following information to that PPS object:
msg::incoming_call
dat:json:{"call_id":13}
To answer the call, you must send the answer_call command to the same object:
echo 'msg::answer_call\nid::1\ndat:json:{"answer_call_id":"13"}\n'
> /pps/services/phone/private/control
If the command is successful, the response is:
res::answer_call
id::1
dat:json:{"call_id":13}
To end the call, you must send the end_call command, specifying the call_id given in the response to the answer_call command:
# echo 'msg::end_call\nid::2\ndat:json:{"call_id":"13"}\n'
> /pps/services/phone/private/control
The response is:
res::end_call
id::2
dat:json:{"call_id":13}
The logging information shows the following activity:
Mar 25 11:06:40.694 qwf_voice_service.13815866 low_rate 3076 QWF_TR
NOTIFY_PHONE_INCOMING, connID:1
Mar 25 11:06:40.775 qwf_phone_service.13807671 high_rate 3070 QWF_TR
start_voice: Start audio succeed
msg::incoming_call
dat:json:{"call_id":13}
Mar 25 11:06:43.379 qwf_phone_service.13807671 low_rate 3070 QWF_TR
Answer call
Mar 25 11:06:43.690 qwf_voice_service.13815866 low_rate 3076 QWF_TR
NOTIFY_PHONE_CONNECTED, connID:1
res::answer_call
id::1
dat:json:{"call_id":13}
Mar 25 11:07:07.811 qwf_phone_service.13807671 low_rate 3070 QWF_TR
End call
Mar 25 11:07:08.079 qwf_voice_service.13815866 low_rate 3076 QWF_TR
NOTIFY_PHONE_DISCONNECTED, connID:1
res::end_call
id::2
dat:json:{"call_id":13}
Mar 25 11:07:08.575 qwf_phone_service.13807671 high_rate 3070 QWF_TR
end_voice: Stop audio succeed