{"id":16446450,"url":"https://github.com/fbukevin/testtwilio","last_synced_at":"2025-10-20T00:47:10.952Z","repository":{"id":70827659,"uuid":"48705036","full_name":"fbukevin/testTwilio","owner":"fbukevin","description":null,"archived":false,"fork":false,"pushed_at":"2015-12-28T19:00:56.000Z","size":3073,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-09T01:49:35.719Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/fbukevin.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}},"created_at":"2015-12-28T17:53:34.000Z","updated_at":"2015-12-28T17:55:38.000Z","dependencies_parsed_at":"2023-02-22T20:30:47.163Z","dependency_job_id":null,"html_url":"https://github.com/fbukevin/testTwilio","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/fbukevin%2FtestTwilio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbukevin%2FtestTwilio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbukevin%2FtestTwilio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbukevin%2FtestTwilio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fbukevin","download_url":"https://codeload.github.com/fbukevin/testTwilio/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240831380,"owners_count":19864718,"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":[],"created_at":"2024-10-11T09:47:40.350Z","updated_at":"2025-10-20T00:47:05.904Z","avatar_url":"https://github.com/fbukevin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n##說明\n\n```javascript\napp.js:\n\tvar ivr = require('./routes/ivr');\n\tapp.use('/ivr', ivr);\n\nivr.js:\n\trouter.post('/', ...);\t\t\t// 1\n\trouter.post('/welcome', ...);\t// 2\n```\n\n以上這樣子是連到 `/ivr` 時會導到 1，連到 `/ivr/welcome` 時會導到 2\n\n\n##運作方式\n\n```javascript\n// POST: '/ivr/welcome'\nrouter.post('/welcome', twilio.webhook({validate: false}), function (request, response) {\n    console.log('a call comming...');\n    // TwIML 是一個回應的設定物件\n    var twiml = new twilio.TwimlResponse();  \n    twiml.gather({\n        action: \"/ivr/menu\",  // 同 form 的 action\n        numDigits: \"1\",       // 使用者輸入的數字長度\n        method: \"POST\"        // 同 form 的 method\n    }, function (node) {\n        node.play(\"http://howtodocs.s3.amazonaws.com/et-phone.mp3\", {loop: 3}); // 回應一段語音\n    });\n    response.send(twiml); // 回覆這個物件\n});\n\n```\n\n你在網站設定好你這支電話對應的 request url (如：`http://\u003chost\u003e:\u003cport\u003e/ivr/welcome`)，你打到那個電話，就會被 express routing 到 /routes/ivr.js 的 router.postg('/welcome') 中，已經測試成功可以用了！\n\n![](call_come.png)\n\n![](call_chinese.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffbukevin%2Ftesttwilio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffbukevin%2Ftesttwilio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffbukevin%2Ftesttwilio/lists"}