-
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
f2b29ee
commit 1427ea2
Showing
20 changed files
with
418 additions
and
600 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ import ( | |
"strings" | ||
|
||
"github.com/pnguyen215/gobase-voip-core/pkg/ami/config" | ||
"github.com/pnguyen215/gobase-voip-core/pkg/ami/utils" | ||
) | ||
|
||
func NewChannel() *AMIChannel { | ||
|
@@ -18,7 +17,7 @@ func NewChannel() *AMIChannel { | |
|
||
func (c *AMIChannel) SetChannelProtocol(protocol string) *AMIChannel { | ||
if ok := config.AmiChannelProtocols[protocol]; !ok { | ||
msg := fmt.Sprintf(config.AmiErrorProtocolMessage, strings.Join(utils.Keys(config.AmiChannelProtocols), ",")) | ||
msg := fmt.Sprintf(config.AmiErrorProtocolMessage, strings.Join(Keys(config.AmiChannelProtocols), ",")) | ||
log.Panic(config.AmiErrorInvalidProtocol, "\n", msg) | ||
} | ||
c.ChannelProtocol = protocol | ||
|
@@ -66,10 +65,10 @@ func (c *AMIChannel) ValidWith(channelProtocol string, regex string, digitsExten | |
if len(digitsExten) == 0 { | ||
return false | ||
} | ||
if utils.IsEmptyAbsolute(extension) { | ||
if IsEmptyAbsolute(extension) { | ||
return false | ||
} | ||
if utils.IsEmptyAbsolute(regex) { | ||
if IsEmptyAbsolute(regex) { | ||
return false | ||
} | ||
c.SetChannelProtocol(channelProtocol) | ||
|
@@ -103,7 +102,7 @@ func (c *AMIChannel) ValidSIPDefaultWith(digitsExten []interface{}, extension st | |
// Return as form [email protected] | ||
func (c *AMIChannel) JoinHostChannel(protocol, ip string) string { | ||
c.SetChannelProtocol(protocol) | ||
host, _, _ := utils.IPDecode(ip) | ||
host, _, _ := IPDecode(ip) | ||
form := "%v@%v" | ||
|
||
if len(host) > 0 { | ||
|
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.