diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 6c3e9a5e2..5a7a3d429 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -43,6 +43,7 @@ information, please see the [`CONTRIBUTING.md`](CONTRIBUTING.md) file. | @noahmehl | Noah Mehl | | @elfranne | Tom Braarup Cuykens | | @rbarrabe | Régis Barrabé | +| @J0hnSteel | John Koce Steel | diff --git a/apier/v1/apier.go b/apier/v1/apier.go index 88bcbcf4d..6bb6ea7bd 100644 --- a/apier/v1/apier.go +++ b/apier/v1/apier.go @@ -387,7 +387,8 @@ func (self *ApierV1) LoadTariffPlanFromStorDb(attrs AttrLoadTpFromStorDb, reply } if len(cstKeys) != 0 && self.CdrStatsSrv != nil { - if err := self.CdrStatsSrv.Call("CDRStatsV1.ReloadQueues", cstKeys, nil); err != nil { + var out int + if err := self.CdrStatsSrv.Call("CDRStatsV1.ReloadQueues", cstKeys, &out); err != nil { return err } } diff --git a/data/tutorials/osips_async/opensips/etc/opensips/opensips.cfg b/data/tutorials/osips_async/opensips/etc/opensips/opensips.cfg index e9d24d589..3733d6c60 100644 --- a/data/tutorials/osips_async/opensips/etc/opensips/opensips.cfg +++ b/data/tutorials/osips_async/opensips/etc/opensips/opensips.cfg @@ -98,6 +98,7 @@ modparam("acc", "evi_extra", "cgr_reqtype=$avp(cgr_reqtype); cgr_account=$avp(cgr_account); cgr_destination=$avp(cgr_destination); cgr_supplier=$avp(cgr_supplier); + cgr_answertime=$dlg_val(atime); dialog_id=$DLG_did") #modparam("acc", "db_url", "flatstore:/tmp") #modparam("acc", "db_flag", "CDR") @@ -344,6 +345,7 @@ route{ route[relay] { # for INVITEs enable some additional helper routes if (is_method("INVITE") && !has_totag()) { + t_on_reply("MSG_REPLY"); #added for completeness not tested t_on_failure("missed_call"); } if (!t_relay()) { @@ -367,3 +369,11 @@ failure_route[missed_call] { } } +onreply_route[MSG_REPLY]{ + if (t_check_status("200") && !$dlg_val(atime)){#so we set it ONLY ONCE + $dlg_val(atime)=$Ts; + } + if (t_check_status("4..")){#CAPTURE ALL ERROR CODES NEGATIVE ASR record + $dlg_val(atime)=NULL; + } +} diff --git a/glide.yaml b/glide.yaml index a6911d41c..33d4f11a7 100644 --- a/glide.yaml +++ b/glide.yaml @@ -1,6 +1,7 @@ package: github.com/cgrates/cgrates import: - package: github.com/DisposaBoy/JsonConfigReader +- package: github.com/cenk/hub - package: github.com/cenkalti/rpc2 - package: github.com/cgrates/fsock - package: github.com/cgrates/kamevapi diff --git a/sessionmanager/osipsevent.go b/sessionmanager/osipsevent.go index cbb5052f9..a8f6981f4 100644 --- a/sessionmanager/osipsevent.go +++ b/sessionmanager/osipsevent.go @@ -151,11 +151,11 @@ func (osipsev *OsipsEvent) GetSetupTime(fieldName, timezone string) (time.Time, return utils.ParseTimeDetectLayout(sTimeStr, timezone) } func (osipsev *OsipsEvent) GetAnswerTime(fieldName, timezone string) (time.Time, error) { - aTimeStr := utils.FirstNonEmpty(osipsev.osipsEvent.AttrValues[fieldName], osipsev.osipsEvent.AttrValues[TIME]) + aTimeStr := utils.FirstNonEmpty(osipsev.osipsEvent.AttrValues[fieldName], osipsev.osipsEvent.AttrValues[CGR_ANSWERTIME]) if strings.HasPrefix(fieldName, utils.STATIC_VALUE_PREFIX) { // Static value aTimeStr = fieldName[len(utils.STATIC_VALUE_PREFIX):] } else if fieldName == utils.META_DEFAULT { - aTimeStr = osipsev.osipsEvent.AttrValues[TIME] + aTimeStr = osipsev.osipsEvent.AttrValues[CGR_ANSWERTIME] } return utils.ParseTimeDetectLayout(aTimeStr, timezone) } @@ -250,7 +250,7 @@ func (osipsev *OsipsEvent) PassesFieldFilter(*utils.RSRField) (bool, string) { } func (osipsev *OsipsEvent) GetExtraFields() map[string]string { primaryFields := []string{TO_TAG, SETUP_DURATION, OSIPS_SETUP_TIME, "method", "callid", "sip_reason", OSIPS_EVENT_TIME, "sip_code", "duration", "from_tag", "dialog_id", - CGR_TENANT, CGR_CATEGORY, CGR_REQTYPE, CGR_ACCOUNT, CGR_SUBJECT, CGR_DESTINATION, utils.CGR_SUPPLIER, CGR_PDD} + CGR_TENANT, CGR_CATEGORY, CGR_REQTYPE, CGR_ACCOUNT, CGR_SUBJECT, CGR_DESTINATION, utils.CGR_SUPPLIER, CGR_PDD,CGR_ANSWERTIME} extraFields := make(map[string]string) for field, val := range osipsev.osipsEvent.AttrValues { if !utils.IsSliceMember(primaryFields, field) {