-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1e10c21
commit b4070b0
Showing
44 changed files
with
73 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,27 @@ Asterisk in Golang provides a wide range of features, including call routing, re | |
|
||
With Asterisk in Golang, developers benefit from the strengths of both the Golang language and the Asterisk ecosystem, resulting in reliable and efficient VOIP solutions that meet the demands of modern communication systems. | ||
|
||
### Requirement | ||
|
||
The go version 1.20 | ||
|
||
### Installation | ||
|
||
- Use a specific version (tag) | ||
|
||
```bash | ||
go get github.com/pnguyen215/[email protected] | ||
``` | ||
|
||
- Latest version | ||
|
||
```bash | ||
go get -u github.com/pnguyen215/voipkit@latest | ||
``` | ||
|
||
### Usage | ||
|
||
- [Asterisk Manager Interface (AMI)](https://github.com/pnguyen215/gobase-voip-core/blob/master/docs/ami.md) | ||
- [Asterisk Manager Interface (AMI)](https://github.com/pnguyen215/voipkit/blob/master/docs/ami.md) | ||
|
||
### Github Action | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,5 @@ | ||
# Asterisk Manager Interface (AMI) | ||
|
||
## Installation | ||
|
||
```sh | ||
go get -u github.com/pnguyen215/[email protected] | ||
``` | ||
|
||
## Usage | ||
|
||
1. Open connection to asterisk server | ||
|
@@ -32,7 +26,7 @@ package main | |
import ( | ||
"log" | ||
|
||
"github.com/pnguyen215/gobase-voip-core/pkg/ami" | ||
"github.com/pnguyen215/voipkit/pkg/ami" | ||
) | ||
|
||
func NewClient() (*ami.AMI, error) { | ||
|
@@ -41,7 +35,7 @@ func NewClient() (*ami.AMI, error) { | |
} | ||
|
||
func main() { | ||
|
||
client, err := NewClient() | ||
|
||
if err != nil { | ||
|
@@ -52,7 +46,7 @@ func main() { | |
``` | ||
|
||
2. Custom listen all events from asterisk | ||
// note: using go func(){...} | ||
// note: using go func(){...} | ||
|
||
```Go | ||
// AllEvents subscribes to any AMI message received from Asterisk server | ||
|
@@ -75,8 +69,8 @@ import ( | |
"log" | ||
"strings" | ||
|
||
"github.com/pnguyen215/gobase-voip-core/pkg/ami" | ||
"github.com/pnguyen215/gobase-voip-core/pkg/ami/config" | ||
"github.com/pnguyen215/voipkit/pkg/ami" | ||
"github.com/pnguyen215/voipkit/pkg/ami/config" | ||
) | ||
|
||
func NewClient() (*ami.AMI, error) { | ||
|
@@ -120,7 +114,7 @@ package main | |
import ( | ||
"log" | ||
|
||
"github.com/pnguyen215/gobase-voip-core/pkg/ami" | ||
"github.com/pnguyen215/voipkit/pkg/ami" | ||
) | ||
|
||
func NewClient() (*ami.AMI, error) { | ||
|
@@ -146,6 +140,7 @@ func main() { | |
``` | ||
|
||
4. Listen events and get field from event by adding key-value you want to take value from that field | ||
|
||
##### Example | ||
|
||
```Go | ||
|
@@ -154,7 +149,7 @@ package main | |
import ( | ||
"log" | ||
|
||
"github.com/pnguyen215/gobase-voip-core/pkg/ami" | ||
"github.com/pnguyen215/voipkit/pkg/ami" | ||
) | ||
|
||
func NewClient() (*ami.AMI, error) { | ||
|
@@ -184,7 +179,8 @@ func main() { | |
``` | ||
|
||
5. Listen events and get field from event by adding key-value you want to take value from that field. | ||
You can customize event by adding new callback function | ||
You can customize event by adding new callback function | ||
|
||
##### Example | ||
|
||
```Go | ||
|
@@ -193,7 +189,7 @@ package main | |
import ( | ||
"log" | ||
|
||
"github.com/pnguyen215/gobase-voip-core/pkg/ami" | ||
"github.com/pnguyen215/voipkit/pkg/ami" | ||
) | ||
|
||
func NewClient() (*ami.AMI, error) { | ||
|
@@ -224,4 +220,4 @@ func main() { | |
}) | ||
}() | ||
} | ||
``` | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module github.com/pnguyen215/gobase-voip-core | ||
module github.com/pnguyen215/voipkit | ||
|
||
go 1.20 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.