{"id":19936800,"url":"https://github.com/pnguyen215/voipkit","last_synced_at":"2025-05-03T13:31:21.535Z","repository":{"id":79216926,"uuid":"604378219","full_name":"pnguyen215/voipkit","owner":"pnguyen215","description":"The Asterisk VOIP library, implemented in the Go programming language (Golang), is a versatile and powerful tool for building robust voice over IP (VOIP) communication systems.","archived":false,"fork":false,"pushed_at":"2024-09-07T15:01:09.000Z","size":7374,"stargazers_count":8,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-09-08T07:23:42.837Z","etag":null,"topics":["asterisk","asterisk-ami","asterisk-manager-api","asterisk-pbx","go","golang","golang-asterisk","golang-library","golang-package","pbx","pbx-api","voip","voip-security","voip-server","voip-telephony-providers"],"latest_commit_sha":null,"homepage":"https://github.com/pnguyen215/voipkit","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/pnguyen215.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":"2023-02-20T23:48:41.000Z","updated_at":"2024-09-07T15:08:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"8a91c3c2-0267-4db1-8d1c-7b06c48467ae","html_url":"https://github.com/pnguyen215/voipkit","commit_stats":null,"previous_names":["pnguyen215/voipkit","pnguyen215/gobase-voip-core"],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pnguyen215%2Fvoipkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pnguyen215%2Fvoipkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pnguyen215%2Fvoipkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pnguyen215%2Fvoipkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pnguyen215","download_url":"https://codeload.github.com/pnguyen215/voipkit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224363793,"owners_count":17298958,"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":["asterisk","asterisk-ami","asterisk-manager-api","asterisk-pbx","go","golang","golang-asterisk","golang-library","golang-package","pbx","pbx-api","voip","voip-security","voip-server","voip-telephony-providers"],"created_at":"2024-11-12T23:29:00.791Z","updated_at":"2024-11-12T23:29:01.367Z","avatar_url":"https://github.com/pnguyen215.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# VoipKit\n\n_VoipKit_ is an Asterisk VOIP library implemented in the Go programming language (Golang). It provides a powerful and flexible toolkit for building scalable and high-performance VOIP applications. This user guide will walk you through the installation, requirements, and key features of VoipKit.\n\n## Requirement\n\nGo version 1.20 or higher\n\n## Installation\n\nYou can install VoipKit using one of the following methods:\n\n- Use a specific version (tag)\n\n```bash\ngo get github.com/pnguyen215/voipkit@v1.0.1\n```\n\n- Latest version\n\n```bash\ngo get -u github.com/pnguyen215/voipkit@latest\n```\n\n## Features\n\nVoipKit provides a comprehensive set of features for building and managing VOIP applications, including:\n\n- **Asterisk Manager Interface (AMI)**: Enables communication between the Go application and the Asterisk server.\n- **Event Socket**: Allows real-time event handling and monitoring.\n- **Call Control**: Provides advanced call handling capabilities.\n- **Configuration Management**: Supports configuration management and easy integration with existing Asterisk configurations.\n- **Error Handling**: Includes detailed error handling and logging for easy debugging.\n\n## Usage\n\nTo start using VoipKit in your Go project, import the library:\n\n```go\nimport (\n    \"github.com/pnguyen215/voipkit\"\n)\n```\n\n### Connecting to Asterisk\n\nTo establish a connection with the Asterisk server, you need to create an AMI instance and provide the necessary configuration:\n\n```go\nfunc CreateConn() (*ami.AMI, error) {\n    c := ami.GetAmiClientSample().\n        SetEnabled(true).\n        SetHost(\"127.0.0.1\").\n        SetPort(5038).\n        SetUsername(\"username\").\n        SetPassword(\"password\").\n        SetTimeout(10 * time.Second)\n    ami.D().Debug(\"Asterisk server credentials: %v\", c.String())\n    return ami.NewClient(ami.NewTcp(), *c)\n}\n```\n\n### Retrieving SIP Peers\n\nTo retrieve the list of SIP peers from Asterisk, you can use the _GetSIPPeers_ method:\n\n```go\nfunc GetSIPPeers() {\n    c, err := CreateConn()\n    if err != nil {\n        ami.D().Error(err.Error())\n        return\n    }\n    c.Core().AddSession()\n    peers, err := c.Core().GetSIPPeers(c.Context())\n    if err != nil {\n        ami.D().Error(err.Error())\n        return\n    }\n    for _, v := range peers {\n        ami.D().Info(\"Peer: %v\", v.Get(\"object_name\"))\n    }\n}\n```\n\n### Retrieving SIP Peer Status\n\nTo retrieve the status of a specific SIP peer, you can use the _GetSIPPeerStatus_ method:\n\n```go\nfunc GetSIPPeerStatus() {\n   c, err := createConn()\n    if err != nil {\n        ami.D().Error(err.Error())\n        return\n    }\n    c.Core().AddSession()\n    peer, err := c.Core().GetSIPPeerStatus(c.Context(), \"1004\")\n    if err != nil {\n        ami.D().Error(err.Error())\n        return\n    }\n    ami.D().Info(\"Peer: %v| Status: %v\", peer.Get(\"peer\"), peer.Get(\"peer_status\"))\n}\n```\n\n### Executing Asterisk CLI Commands\n\nTo execute Asterisk CLI commands, you can use the Command method:\n\n```go\nfunc ExecuteCLICommand() {\n    c, err := CreateConn()\n    if err != nil {\n        ami.D().Error(err.Error())\n        return\n    }\n    c.Socket().SetDebugMode(true)\n    c.Core().AddSession()\n    response, err := c.Core().Command(c.Context(), \"sip show users\")\n    if err != nil {\n        ami.D().Error(err.Error())\n        return\n    }\n    fmt.Println(ami.JsonString(response))\n```\n\n## Github Action\n\nVoipKit leverages Github Actions for continuous integration and deployment. The following actions are used:\n\n- [Action gh-release](https://github.com/softprops/action-gh-release): This action automates the creation of Github releases.\n- [Github Security guides](https://docs.github.com/en/actions/security-guides): Follow these security guides to ensure the safety and integrity of your Github Actions workflows.\n\n## Reference\n\n- [Asterisk Documentation](https://docs.asterisk.org): Official documentation for Asterisk, providing comprehensive guides and reference materials.\n- [Official Asterisk Repositories](https://github.com/asterisk/documentation): Github repositories containing Asterisk documentation and related resources.\n\n## Conclusion\n\nVoipKit is a powerful and flexible library for building VOIP applications using Go and Asterisk. With its rich set of features and modular architecture, it enables developers to create scalable and efficient VOIP solutions. By following this user guide and leveraging the provided resources, you can quickly get started with VoipKit and build robust VOIP applications.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpnguyen215%2Fvoipkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpnguyen215%2Fvoipkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpnguyen215%2Fvoipkit/lists"}