diff --git a/asterisk/asterisk.go b/asterisk/asterisk.go index bc959e6..55686a1 100644 --- a/asterisk/asterisk.go +++ b/asterisk/asterisk.go @@ -62,13 +62,13 @@ func (t *TelephonyConfig) AppendPhonePrefix(values ...string) *TelephonyConfig { return t } -func (t *TelephonyConfig) SetDigitsExten(values []interface{}) *TelephonyConfig { - t.DigitsExten = values +func (t *TelephonyConfig) SetDigitExtensions(values []interface{}) *TelephonyConfig { + t.DigitExtensions = values return t } -func (t *TelephonyConfig) AppendDigitExten(values ...interface{}) *TelephonyConfig { - t.DigitsExten = append(t.DigitsExten, values...) +func (t *TelephonyConfig) AppendDigitExtensions(values ...interface{}) *TelephonyConfig { + t.DigitExtensions = append(t.DigitExtensions, values...) return t } @@ -103,7 +103,7 @@ func GetAsteriskConfigSample() *AsteriskConfig { a := NewAsteriskConfig() t := NewTelephonyConfig() t.SetRegion("VN") - t.AppendDigitExten(4, 5, 6) + t.AppendDigitExtensions(4, 5, 6) t.AppendPhonePrefix("9", "6064") a.SetEnabled(true) a.SetHost("http://127.0.0.1") diff --git a/asterisk/asterisk_model.go b/asterisk/asterisk_model.go index b74ecd4..5fc4ec8 100644 --- a/asterisk/asterisk_model.go +++ b/asterisk/asterisk_model.go @@ -3,9 +3,9 @@ package asterisk import "time" type TelephonyConfig struct { - Region string `json:"region" yaml:"region"` - PhonePrefix []string `json:"phone_prefix" yaml:"phone-prefix"` - DigitsExten []interface{} `json:"digits_exten" yaml:"digits-exten"` + Region string `json:"region" yaml:"region"` + PhonePrefix []string `json:"phone_prefix" yaml:"phone_prefix"` + DigitExtensions []interface{} `json:"digit_extensions" yaml:"digit_extensions"` } type AsteriskConfig struct { @@ -16,7 +16,7 @@ type AsteriskConfig struct { Username string `json:"username" binding:"required" yaml:"username"` Password string `json:"-" yaml:"password"` Telephony TelephonyConfig `json:"telephony" yaml:"telephony"` - Timeout time.Duration `json:"-" yaml:"-"` + Timeout time.Duration `json:"timeout" yaml:"timeout"` } type asteriskOptionConfig struct { diff --git a/keys/default_cluster_multi_tenant_conf.yaml b/keys/default_cluster_multi_tenant_conf.yaml index 1b9df1f..b49183b 100755 --- a/keys/default_cluster_multi_tenant_conf.yaml +++ b/keys/default_cluster_multi_tenant_conf.yaml @@ -11,10 +11,10 @@ clusters: password: pwd telephony: region: VN - phone-prefix: + phone_prefix: - "9" - "6064" - digits-exten: + digit_extensions: - 4 - 5 - 6 @@ -275,10 +275,10 @@ clusters: password: pwd telephony: region: VN - phone-prefix: + phone_prefix: - "9" - "6064" - digits-exten: + digit_extensions: - 4 - 5 - 6 @@ -500,10 +500,10 @@ clusters: password: pwd telephony: region: VN - phone-prefix: + phone_prefix: - "9" - "6064" - digits-exten: + digit_extensions: - 4 - 5 - 6 @@ -764,10 +764,10 @@ clusters: password: pwd telephony: region: VN - phone-prefix: + phone_prefix: - "9" - "6064" - digits-exten: + digit_extensions: - 4 - 5 - 6 @@ -989,10 +989,10 @@ clusters: password: pwd telephony: region: VN - phone-prefix: + phone_prefix: - "9" - "6064" - digits-exten: + digit_extensions: - 4 - 5 - 6 @@ -1253,10 +1253,10 @@ clusters: password: pwd telephony: region: VN - phone-prefix: + phone_prefix: - "9" - "6064" - digits-exten: + digit_extensions: - 4 - 5 - 6 @@ -1478,10 +1478,10 @@ clusters: password: pwd telephony: region: VN - phone-prefix: + phone_prefix: - "9" - "6064" - digits-exten: + digit_extensions: - 4 - 5 - 6 @@ -1742,10 +1742,10 @@ clusters: password: pwd telephony: region: VN - phone-prefix: + phone_prefix: - "9" - "6064" - digits-exten: + digit_extensions: - 4 - 5 - 6 diff --git a/keys/default_cluster_multi_tenant_conf_v1.0.0.yaml b/keys/default_cluster_multi_tenant_conf_v1.0.0.yaml index c0d8aa7..f2d2be2 100755 --- a/keys/default_cluster_multi_tenant_conf_v1.0.0.yaml +++ b/keys/default_cluster_multi_tenant_conf_v1.0.0.yaml @@ -11,10 +11,10 @@ clusters: password: pwd telephony: region: VN - phone-prefix: + phone_prefix: - "9" - "6064" - digits-exten: + digit_extensions: - 4 - 5 - 6 @@ -194,10 +194,10 @@ clusters: password: pwd telephony: region: VN - phone-prefix: + phone_prefix: - "9" - "6064" - digits-exten: + digit_extensions: - 4 - 5 - 6 @@ -325,10 +325,10 @@ clusters: password: pwd telephony: region: VN - phone-prefix: + phone_prefix: - "9" - "6064" - digits-exten: + digit_extensions: - 4 - 5 - 6 @@ -508,10 +508,10 @@ clusters: password: pwd telephony: region: VN - phone-prefix: + phone_prefix: - "9" - "6064" - digits-exten: + digit_extensions: - 4 - 5 - 6 @@ -639,10 +639,10 @@ clusters: password: pwd telephony: region: VN - phone-prefix: + phone_prefix: - "9" - "6064" - digits-exten: + digit_extensions: - 4 - 5 - 6 @@ -822,10 +822,10 @@ clusters: password: pwd telephony: region: VN - phone-prefix: + phone_prefix: - "9" - "6064" - digits-exten: + digit_extensions: - 4 - 5 - 6 @@ -953,10 +953,10 @@ clusters: password: pwd telephony: region: VN - phone-prefix: + phone_prefix: - "9" - "6064" - digits-exten: + digit_extensions: - 4 - 5 - 6 @@ -1136,10 +1136,10 @@ clusters: password: pwd telephony: region: VN - phone-prefix: + phone_prefix: - "9" - "6064" - digits-exten: + digit_extensions: - 4 - 5 - 6 diff --git a/keys/default_conf.yaml b/keys/default_conf.yaml index cc17317..cd2f389 100755 --- a/keys/default_conf.yaml +++ b/keys/default_conf.yaml @@ -11,10 +11,10 @@ asterisk: password: pwd telephony: region: VN - phone-prefix: + phone_prefix: - "9" - "6064" - digits-exten: + digit_extensions: - 4 - 5 - 6 @@ -335,10 +335,10 @@ asterisk-seekers: password: pwd telephony: region: VN - phone-prefix: + phone_prefix: - "9" - "6064" - digits-exten: + digit_extensions: - 4 - 5 - 6 diff --git a/keys/default_conf_v1.0.0.yaml b/keys/default_conf_v1.0.0.yaml index 5f76713..5ee3ee7 100755 --- a/keys/default_conf_v1.0.0.yaml +++ b/keys/default_conf_v1.0.0.yaml @@ -11,10 +11,10 @@ asterisk: password: pwd telephony: region: VN - phone-prefix: + phone_prefix: - "9" - "6064" - digits-exten: + digit_extensions: - 4 - 5 - 6 @@ -246,10 +246,10 @@ asterisk-seekers: password: pwd telephony: region: VN - phone-prefix: + phone_prefix: - "9" - "6064" - digits-exten: + digit_extensions: - 4 - 5 - 6 diff --git a/keys/default_multi_tenant_conf.yaml b/keys/default_multi_tenant_conf.yaml index 9ce8b54..f51d062 100755 --- a/keys/default_multi_tenant_conf.yaml +++ b/keys/default_multi_tenant_conf.yaml @@ -10,10 +10,10 @@ config: password: pwd telephony: region: VN - phone-prefix: + phone_prefix: - "9" - "6064" - digits-exten: + digit_extensions: - 4 - 5 - 6 @@ -274,10 +274,10 @@ config: password: pwd telephony: region: VN - phone-prefix: + phone_prefix: - "9" - "6064" - digits-exten: + digit_extensions: - 4 - 5 - 6 diff --git a/keys/default_multi_tenant_conf_v1.0.0.yaml b/keys/default_multi_tenant_conf_v1.0.0.yaml index 66b430b..18a0de2 100755 --- a/keys/default_multi_tenant_conf_v1.0.0.yaml +++ b/keys/default_multi_tenant_conf_v1.0.0.yaml @@ -10,10 +10,10 @@ config: password: pwd telephony: region: VN - phone-prefix: + phone_prefix: - "9" - "6064" - digits-exten: + digit_extensions: - 4 - 5 - 6 @@ -193,10 +193,10 @@ config: password: pwd telephony: region: VN - phone-prefix: + phone_prefix: - "9" - "6064" - digits-exten: + digit_extensions: - 4 - 5 - 6