{"id":20302574,"url":"https://github.com/asterisk/asterisk-external-media","last_synced_at":"2025-04-11T13:43:18.592Z","repository":{"id":44838473,"uuid":"217531144","full_name":"asterisk/asterisk-external-media","owner":"asterisk","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-11T13:16:41.000Z","size":255,"stargazers_count":74,"open_issues_count":10,"forks_count":31,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-25T09:53:02.434Z","etag":null,"topics":["speech-recognition"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/asterisk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-25T12:41:41.000Z","updated_at":"2025-03-15T08:15:26.000Z","dependencies_parsed_at":"2023-01-25T23:00:16.066Z","dependency_job_id":null,"html_url":"https://github.com/asterisk/asterisk-external-media","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/asterisk%2Fasterisk-external-media","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asterisk%2Fasterisk-external-media/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asterisk%2Fasterisk-external-media/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asterisk%2Fasterisk-external-media/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asterisk","download_url":"https://codeload.github.com/asterisk/asterisk-external-media/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248410852,"owners_count":21098782,"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":["speech-recognition"],"created_at":"2024-11-14T16:32:33.877Z","updated_at":"2025-04-11T13:43:18.551Z","avatar_url":"https://github.com/asterisk.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n# Asterisk External Media Sample\n\nThis package demonstrates how to use the ARI External Media feature to transcribe\nthe audio from a bridge using the Google Speech APIs. \n\n## Installation\n\n#### Prerequisites\n* A functional Asterisk 16.6.0+ installation.\n* A conference bridge or phone configured.\n* Node.JS version 10 or greater.\n* Google Speech API credentials set in environment variable GOOGLE_APPLICATION_CREDENTIALS.  \nSee https://cloud.google.com/speech-to-text/docs/ for more information.\n\nRun `npm install` from the top of the source tree.\nThis will install the required npm packages including `node-ari-client` and `@google-cloud/speech`.\nYou can then run the transcriber as `bin/ari-transcriber`.  If you add the `-g`\noption to `npm install` to install system wide, you can just run `ari-transcriber`. \n\n## Usage\n\n```\n$ ari-transcriber --help\nari-transcriber [options] \u003cdialstring\u003e\n\nStart the transcription server\n\nPositionals:\n  dialstring  Extension to dial such as \"Local/1234\"\n\nIncoming Audio Server\n  --format, -f        Asterisk format/codec                                         [string] [choices: \"ulaw\", \"slin16\"] [default: \"ulaw\"]\n  --listenServer, -l  Address and port on which to listen for audio from Asterisk                     [string] [default: \"127.0.0.1:9999\"]\n\nSpeech\n  --speechModel         Google Speech API model                  [string] [choices: \"phone_call\", \"video\", \"default\"] [default: \"default\"]\n  --speechLang          BCP-47 Language code.  en-US, fr-CA, etc.                  [string] [choices: \"en-US\", \"fr-CA\"] [default: \"en-US\"]\n  --speakerDiarization  Outputs words associated to speaker index to the console.                               [boolean] [default: false]\n\nARI\n  --ariServerUrl, -a  The URL for the Asterisk instance                                        [string] [default: \"http://127.0.0.1:8088\"]\n  --ariUser, -u       The user configured in ari.conf                                                       [string] [default: \"asterisk\"]\n  --ariPassword, -p   The password for the user configured in ari.conf                                      [string] [default: \"asterisk\"]\n\nTranscription WebSocket\n  --sslCert  WebSocket secure server (wss) certificate. If omitted, a non-secures (ws) websocket server will be created           [string]\n  --sslKey   WebSocket secure server key. Must be supplied if sslCert is ssplied                                                  [string]\n  --wssPort  WebSocket server port.  If omitted, no websocket server will be started                                              [number]\n\nOptions:\n  --version          Show version number                                                                                         [boolean]\n  --help             Show help                                                                                                   [boolean]\n  --audioOutput, -o  A file into which the raw audio from Asterisk can be written                                                 [string]\n\nExamples:\n  ari-transcriber --format=slin16 --sslCert=/etc/letsencrypt/live/myserver/fullchain.pem\n  --sslKey=/etc/letsencrypt/live/myserver/privkey.pem --wssPort=39990 --speakerDiarization 'Local/1234'\n```\n\nThe ari-transcriber performs several tasks:\n* Creates an ari-client instance\n* Creates a WebSocket server from which the live transcription can be accessed\n* Starts an audio server to receive the audio from Asterisk\n* Creates an instance of Google Speech Provider that takes the audio from the server, transcribes it, and sends the transcription out the websocket\n* Uses the ARI instance to:\n  * Create a mixing bridge\n  * Create a Local channel which dials the conference bridge to be monitored\n  * Place the local channel into the mixing bridge\n  * Create an External Media channel that directs the audio to the audio server\n  * Place the External Media channel into the mixing bridge\n\nWhy the Local channel and bridge?  To keep the sample as simple as possible,\nit's assumes that a conference bridge is already available.  Since that\nbridge wouldn't be controlled by ARI/Stasis, we can't just add the External\nMedia channel directly to it.  Instead we have to create a Local channel that _dials_\nthe conference bridge, then bridge _that_ channel with the External Media\nchannel.  If you were ading External Media capabilities to your own application,\nchances are that your app would already control the participant bridge and you\nwouldn't need the Local channel and mixing bridge.\n\n## Try It!\n\nYou don't need the WebSocket transcription server to try this.\nJust a phone to call.\n\n```\n$ export GOOGLE_APPLICATION_CREDENTIALS=\u003cpath to Google API credentials\u003e\n$ ari-transcriber --format=slin16 'Local/1234'\n````\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasterisk%2Fasterisk-external-media","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasterisk%2Fasterisk-external-media","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasterisk%2Fasterisk-external-media/lists"}