Skip to content

Commit 58f4a72

Browse files
committed
WIP
1 parent 291ff0a commit 58f4a72

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

lib/cgrates/client.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,10 +271,10 @@ def get_cost(tenant:, subject:, category:, destination:, usage:, **)
271271
)
272272
end
273273

274-
def get_max_session_time(tenant:, account:, category:, destination:, time_start: nil, time_end: nil, duration_seconds: nil, **)
275-
duration_seconds ||= 3 * 60 * 60
274+
def get_max_session_time(tenant:, account:, category:, destination:, time_start: nil, time_end: nil, max_duration_seconds: nil, **)
275+
max_duration_seconds ||= 3 * 60 * 60
276276
time_start ||= Time.now
277-
time_end ||= time_start + duration_seconds
277+
time_end ||= time_start + max_duration_seconds
278278

279279
api_request(
280280
"Responder.GetMaxSessionTime",

spec/cgrates/client_spec.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,8 @@ module CGRateS
554554
tenant: "cgrates.org",
555555
account: "sample-account-sid",
556556
category: "call",
557-
destination: "85510"
557+
destination: "85510",
558+
max_duration_seconds: 60
558559
)
559560

560561
expect(response).to have_attributes(result: a_kind_of(Integer))
@@ -570,7 +571,7 @@ module CGRateS
570571
expect(
571572
Time.parse(request_body.params.fetch("TimeEnd")) -
572573
Time.parse(request_body.params.fetch("TimeStart"))
573-
).to eq(3 * 60 * 60)
574+
).to eq(60)
574575
}
575576
end
576577
end

0 commit comments

Comments
 (0)