{"id":27999274,"url":"https://github.com/voximplant/pds-sample-client","last_synced_at":"2025-05-08T22:57:35.960Z","repository":{"id":77510740,"uuid":"220435918","full_name":"voximplant/pds-sample-client","owner":"voximplant","description":"Go-based Predictive Dialer client","archived":false,"fork":false,"pushed_at":"2024-01-24T09:39:50.000Z","size":45,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-05-08T22:57:29.011Z","etag":null,"topics":["dialer","voximplant"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/voximplant.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-08T09:45:33.000Z","updated_at":"2023-09-11T00:07:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"8222aec6-6387-4f70-9229-07cc33f23187","html_url":"https://github.com/voximplant/pds-sample-client","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voximplant%2Fpds-sample-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voximplant%2Fpds-sample-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voximplant%2Fpds-sample-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/voximplant%2Fpds-sample-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/voximplant","download_url":"https://codeload.github.com/voximplant/pds-sample-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253160790,"owners_count":21863627,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dialer","voximplant"],"created_at":"2025-05-08T22:57:35.350Z","updated_at":"2025-05-08T22:57:35.946Z","avatar_url":"https://github.com/voximplant.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Voximplant PDS client\n\n## Build\n\nTo build a Voximplant PDS client, make sure the following requirements are installed\n* Golang 1.17\n* `make` utils \n\nThen run `make compile` to build the client.\n  \n## Protocol initialization\n\n1. After opening a bidirectional connection via the `PDS.Start` method, send a PDS agent initialization request: `message RequestMessage` of the `INIT` type).\n2. Wait for a response to the initialization request: `message ServiceMessage` of the `INIT_RESPONSE` type. The response contains the `session_id`. You can save it to use in future initializations to use the accumulated statistics.\n3. Wait for the request from the server: `message ServiceMessage` of the `GET_TASK` type.\n4. After receiving the `GET_TASK` request, send the desired tasks as soon as possible.\n   \n## Nuances\n\n1. If you send more tasks than the server requested, or if you send the task before getting the request, the connection will be closed.\n2. If you receive any Voximplant-related errors (e.g. scenario start error), the connection may be closed. In this case, call the `PDS.Start` method again and repeat the initialization process again.\n   \n## PDS behavior in different situations\n\n- if you the number of operators increases, the task distribution becomes quicker\n- if the call duration increases, the task distribution becomes slower\n- if the answer percentage improves, the task distribution becomes slower\n- if the number of free operators increases, the task distribution becomes slightly quicker\n  \n### PDS behavior when changing working conditions\n\n- if the answer percentage suddenly increases, the customer queue peaks at the start. After the queue normalizes, PDS will work according to the new statistics\n- if the answer percentage suddenly decreases, the operator waiting time decreases. It takes about 2-3 minutes for PDS to adapt to the new statistics (depends on the number of operators and the call duration: the higher the call duration, the more time it takes to adapt to the new statistics)\n- if the call duration increases, the customer queue peaks at the start\n- if the call duration decreases, the operator waiting time increases\n- if the number of operators increases, the dialing time decreases. If the number of operators highly increases, the operator waiting time can temporarily increase\n- if the number of operators decreases, the customer queue increases. After the queue normalizes, PDS will work according to the new statistics\n  \n## VoxEngine scenario\n\n* The scenario parameters are received in the following format:\n  \n```\n{\n    \"users_data\":{}, // custom json with a phone number, customer's name and etc \n    \"task_uuid\" : \"string\",\n    \"agent_uuid\": \"string\",\n    \"queue_id\": 1,\n    \"queue_name\": \"string\",\n    \"callback_url\":\"https://pds.voximplant.com/v1/result\"\n}\n```\n\n* Parameters parsing:\n  \n```javascript\nvar data = JSON.parse(VoxEngine.customData());\nLogger.write(JSON.stringify(data.users_data)); // custom data with customer's information\n\nfunction sendResult(status) {\n\tvar pd = {\n\t\tagent: data.agent_uuid,\n\t\ttask_uuid: data.task_uuid,\n\t\ttype: status\n\t};\n\tLogger.write('SEND RESULT ' + status)\n\tif (sended) return false\n\tNet.httpRequest(data.callback_url, function (e) {\n\t\tif (e.code == 200) {\n\t\t\tLogger.write(\"Connected successfully\");\n\t\t\tLogger.write(\"code:  \" + e.code);\n\t\t\tsended = true\n\t\t} else {\n\t\t\tLogger.write(\"Unable to connect\");\n\t\t}\n\t\tif (status === 'FAIL') VoxEngine.terminate()\n\t}, {\n\t\trawOutput: true,\n\t\tmethod: \"POST\",\n\t\tpostData: JSON.stringify(pd)\n\t});\n}\n```\n\n* Send the following request if the call succeeds:\n  \n```javascript\nsendResult(\"DIAL_COMPLETE\");\n```\n\n* Send the following request if the call fails:\n  \n```javascript\nsendResult(\"FAIL\");\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoximplant%2Fpds-sample-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvoximplant%2Fpds-sample-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvoximplant%2Fpds-sample-client/lists"}