You can make a voice call by sending the start_call command (with the phone_number parameter set to the number that you're calling) to the phone control object. Because this is a server object, to observe the response, you must force the shell to keep the file descriptor open. In the following example, we use the exec command to do this, then direct the response messages to stderr:
# echo 'msg::start_call\nid::1\ndat:json:{"phone_number":"nnnnnnnnnn"}\n' > /pps/services/phone/private/control
If the command is successful, the response is:
res::start_call id::1 dat:json:{"phone_number":"nnnnnnnnnn","line":"cellular","call_id":7, "call_type":"outgoing"}
To end the call, you must send the end_call command to the same PPS object, specifying the call_id given in the response to the start_call command:
# echo 'msg::end_call\nid::2\ndat:json:{"call_id":"7"}\n' > /pps/services/phone/private/control
The response is:
res::end_call id::2 dat:json:{"call_id":7}
The logging information shows the following activity:
Mar 25 10:22:22.715 qwf_phone_service.13807671 low_rate 3070 QWF_TR Start call Mar 25 10:22:26.662 qwf_voice_service.13815866 low_rate 3076 QWF_TR NOTIFY_PHONE_RINGING, connID:1 Mar 25 10:22:26.728 qwf_phone_service.13807671 high_rate 3070 QWF_TR start_voice: Start audio succeed res::start_call id::1 dat:json:{"phone_number":"nnnnnnnnnn","line":"cellular","call_id":7,"call_type":"outgoing"} Mar 25 10:22:30.069 qwf_voice_service.13815866 low_rate 3076 QWF_TR NOTIFY_PHONE_CONNECTED, connID:1 Mar 25 10:22:47.356 qwf_phone_service.13807671 low_rate 3070 QWF_TR End call Mar 25 10:22:47.647 qwf_voice_service.13815866 low_rate 3076 QWF_TR NOTIFY_PHONE_DISCONNECTED, connID:1 res::end_call id::2 dat:json:{"call_id":7} Mar 25 10:22:48.171 qwf_phone_service.13807671 high_rate 3070 QWF_TR end_voice: Stop audio succeed