Termination (Attempt)
Introduction
An SCP Lua script may request that the call be terminated to a B-Party by sending INAP Continue
or INAP Connect
on the SSP transaction using RequestReportBCSMEvent
to arm for the
Answer, NoAnswer, Busy, RouteSelectFailure, and Abandon event detection points.
The Disconnect EDPs are not armed. There will be no ApplyCharging
, nor CallInformationRequest
.
The use of FurnishChargingInformation
and/or SendChargingInformation
is optional.
If an SRF is currently open then a prior DisconnectForwardConnection
will be sent on the SSP
transaction, and any external SRF transaction will be ended according to the applicable SRF configuration.
The processing will suspend until one of the armed EDPs is returned, or a guard timer expires. If the call is Answered or Abandoned or timed-out then no further telephony methods are permitted.
If the call result is Busy, NoAnswer, or RouteSelectFailure, then the service logic may carry on and attempt other telephony actions.
The LhoScpLuaService Termination (Attempt) API
.termination_attempt
This method provides full access to the Termination (Attempt) mechanism and is provided for use by custom service developers. In the majority of scenarios, one of the subsequently-described convenience methods should be sufficient and preferable. However, this full-featured alternative is provided for use by complex or non-standard services.
This method sends INAP Connect
if the .address_digits
is present, or INAP
Continue
if the address digits are not specified.
This method takes a single details
parameter which is a Lua table with the following structure:
Field | Type | Description |
---|---|---|
details
|
Object | [Required] The detailed SCP control parameters for the message. |
.no_answer_timeout
|
Integer |
Specify the value to send in the dPSpecificCriteria.applicationTimer .For CAMEL1 MSCs this value is used for an internal SCP NoAnswer timer. This value must not exceed the configured possible maximum value for the SSP model. (Default = use the default configured for the SSP model, if any). |
.fci
|
String |
Specify the content of the FCIBillingChargingCharacteristics in the FurnishChargingInformation to send.(Default = do not send FurnishChargingInformation ).
|
.sci
|
String |
Specify the content of the sCIBillingChargingCharacteristics in the SendChargingInformation to send.(Default = do not send SendChargingInformation ).
|
.address_digits
|
Digit String |
Specify the normalised destinationRoutingAddress digits (only 0-9A-F ).The applicable configured 'called_party' denormalisation on the LhoScpApp will be applied. If this field is present, then INAP Connect will be used, else INAP Continue is sent.
|
.orig_called_digits
|
Digit String |
This field is only relevant when address_digits is specified.Specify the normalised destinationRoutingAddress digits (only 0-9A-F ).The applicable configured 'calling_party' denormalisation on the LhoScpApp will be applied. (Default = not present). |
.redirecting_digits
|
Digit String |
This field is only relevant when address_digits is specified.Specify the normalised redirectingPartyID digits (only 0-9A-F ).The applicable configured 'calling_party' denormalisation on the LhoScpApp will be applied. (Default = not present). |
.redirection_info
|
Object |
This field is only relevant when address_digits is specified.(Default = not present). |
.orig_reason
|
0 - 15
|
Specify an explicit redirection information original reason. (Default = 0). |
.indicator
|
0 - 7
|
Specify an explicit redirection information indicator. (Default = 0). |
.reason
|
0 - 15
|
Specify an explicit redirection information reason. (Default = 0). |
.national_use
|
0 / 1
|
Specify an explicit redirection information national use value. (Default = 0). |
.counter
|
0 - 7
|
Specify an explicit redirection information counter. (Default = 1). |
.bparty_beep
|
Object |
Specify a simple Boolean value true to request that a post-answer B-Party beep be played (if supported).(Default = do not play a post-answer beep to the B-Party). |
.play
|
Boolean |
Specifies that the beep should be played. (Default = true when the bparty_beep container is present).
|
.id
|
Integer |
Override the default announcement ID. (Default = use the default configured for the SSP model). |
.monitored
|
Boolean |
Set this flag to indicated that the Monitored Termination type is to be used. (Default = do not use the Monitored Termination type). |
.charged
|
Boolean |
Set this flag to indicated that the Charged Termination type is to be used. (Default = do not use the Charged Termination type). |
.max_call_secs
|
Integer |
When the call is being terminated using the Monitored or Charged Termination type, this is the requested hard-cap maximum permitted talk-time (in seconds). (Default = default maximum call duration for the applicable SSP model). |
.monitor_interval_secs
|
Integer |
When the call is being terminated using the Monitored Termination type, this is the requested monitor report interval (in seconds). (Default = default monitor report interval for the applicable SSP model). |
.grant_secs
|
Integer | [Required for Charged] When the call is being terminated using the Charged termination type, this is the grant time (in seconds). |
.release_at_expiry
|
0 / 1
|
Is this the (first and) only grant? Should the call (both legs) be released when this grant is entirely exhausted. (Default = this is not the only grant). |
.cause
|
0 - 127
|
Specify an explicit release cause to when releasing the call at expiry of the grant time. (Default = default release cause for the applicable SSP model). |
.release_tone
|
0 / 1
|
Should a tone be played (if supported) when performing this final grant? (Default = default release tone flag value for the applicable SSP model). |
The termination_attempt
method returns a structure indicating the result of the termination attempt.
Attribute | Type | Description |
---|---|---|
.controlled
|
Boolean |
Is this call still controlled, i.e. can subsequent telephony actions be performed? This will be `true` when the `.edp_name` is `oCalledPartyBusy_leg2`, `tBusy_leg2`, `oNoAnswer_leg2`, `tNoAnswer_leg2`, `routeSelectFailure_leg2`. This will be `false` when the `.edp_name` is `oAnswer_leg2`, `tAnswer_leg2`, `oAbandon_leg1`, or `tAbandon_leg1`. |
.answered
|
Boolean |
Was this call answered? This will be `true` when the `.edp_name` is `oAnswer_leg2`, `tAnswer_leg2`. This will be `false` for all other EDPs. |
.monitored
|
Boolean |
Is this call currently being monitored, i.e. do you now need to call monitor_check () ?This will be `true` when the original call specified monitored = true and the call was answered.
|
.charged
|
Boolean |
Is this call currently being charged, i.e. do you now need to call charged_check () ?This will be `true` when the original call specified charged = true and the call was answered.
|
.scp
|
Object | Container for various SCP details. |
.edp_name
|
String | This will be one of `oCalledPartyBusy_leg2`, `tBusy_leg2`, `oNoAnswer_leg2`, `tNoAnswer_leg2`, `routeSelectFailure_leg2`, `oAnswer_leg2`, `tAnswer_leg2`, `oAbandon_leg1`, or `tAbandon_leg1`. |
.ring_dsm
|
Integer |
[Required] The ring-time (in deci-seconds) as measured by us. This is the time between us sending the Connect or Continue and us receiving the EventReportBCSM (Answer) .
|
.max_call_secs
|
Integer |
When the call is being terminated using the Monitored or Charged termination type, this returned value is the hard-cap maximum permitted talk-time (in seconds). If the service logic requested a specific maximum talk time, then this will be that value, adjusted for any boundary constraints. If the service logic did not request a specific value, then this will be the configured applicable default value for the SSP model. |
.monitor_interval_secs
|
Integer |
When the call is being terminated using the Monitored termination type, this returned value is monitor reporting interval (in seconds). If the service logic requested a specific monitor reporting interval, then this will be that value, adjusted for any boundary constraints. If the service logic did not request a specific value, then this will be the configured applicable default value for the SSP model. |
.grant_secs
|
Integer |
When the call is being terminated using the Charged termination type, this returned value is grant time (in seconds). This is the value as requested by the service logic, adjusted for any boundary constraints. |
Example (connect to called party with a prefix, no FCI, no SCI, redirection, not monitored/charged):
local n2svcd = require "n2.n2svcd"
local scp_api = require "n2.n2svcd.scp"
local scp_call = ...
local result = scp_api.termination_attempt ({
address_digits = '1703' .. scp_call.normalised_called_party,
redirecting_digits = '00889001234',
redirection_info = { reason = 4, counter = 1 }
})
if (result.answered) then
n2svcd.notice ("CALL ANSWERED = YES")
else
if (result.controlled) then
n2svcd.notice ('Controlled after EDP Name = %s', result.scp.edp_name)
scp_api.release_call (5)
else
n2svcd.notice ('Control Lost after EDP Name = %s', result.scp.edp_name)
end
end
return
.continue_attempt
This is a convenience method for calling termination_attempt ()
which specifies the most commonly used parameters but no address digits,
meaning that INAP Continue
will be used.
The continue_attempt
method takes the following arguments:
Attribute | Type | Description |
---|---|---|
no_answer_timeout
|
Integer |
Specify the NoAnswer timeout to pass to the switch. (Default = use the default configured in LhoScpApp, if any). |
fci
|
String |
Specify the content of the FCIBillingChargingCharacteristics in the FurnishChargingInformation to send.(Default = do not send FurnishChargingInformation ).
|
sci
|
String |
Specify the content of the sCIBillingChargingCharacteristics in the SendChargingInformation to send.(Default = do not send SendChargingInformation ).
|
The continue_attempt
method returns the same result structure as termination_attempt
.
Example (continue with 30 second NoAnswer timer, not monitored/charged):
local n2svcd = require "n2.n2svcd"
local scp_api = require "n2.n2svcd.scp"
local scp_call = ...
local result = scp_api.continue_attempt (30)
-- If result.controlled = true then we are still in control of the call.
if (result.controlled) then
n2svcd.notice ('Controlled after EDP Name = %s', result.scp.edp_name)
scp_api.release_call (5)
else
n2svcd.notice ('Control Lost after EDP Name = %s', result.scp.edp_name)
end
return
.connect_attempt
This is a convenience method for calling termination_attempt ()
which specifies the most commonly used parameters including address digits,
meaning that INAP Connect
will be used.
The connect_attempt
method takes the following arguments:
Attribute | Type | Description |
---|---|---|
address_digits
|
Digit String |
Specify the normalised destinationRoutingAddress digits (only 0-9A-F ).The applicable configured 'called_party' denormalisation on the LhoScpApp will be applied. If this field is present, then INAP Connect will be used, else INAP Continue is sent.
|
no_answer_timeout
|
Integer |
Specify the NoAnswer timeout to pass to the switch. (Default = use the default configured in LhoScpApp, if any). |
fci
|
String |
Specify the content of the FCIBillingChargingCharacteristics in the FurnishChargingInformation to send.(Default = do not send FurnishChargingInformation ).
|
sci
|
String |
Specify the content of the sCIBillingChargingCharacteristics in the SendChargingInformation to send.(Default = do not send SendChargingInformation ).
|
bparty_beep
|
Object |
Specify a simple Boolean value true to request that a post-answer B-Party beep be played (if supported).(Default = do not play a post-answer beep to the B-Party). |
.play
|
Boolean |
Specifies that the beep should be played. (Default = true when the bparty_beep container is present).
|
.id
|
Integer |
Override the default announcement ID. (Default = use the default configured for the SSP model). |
The connect_attempt
method returns the same result structure as termination_attempt
.
Example (connect to called party with a prefix, default NoAnswer, with FCI, not monitored/charged):
local n2svcd = require "n2.n2svcd"
local scp_api = require "n2.n2svcd.scp"
local scp_call = ...
local called_party = '1703' .. scp_call.normalised_called_party
-- Binary in Lua is decimal-specified.
local fci_bin = '\01\02\03\04\255\238\221'
local result = scp_api.connect_attempt (called_party, nil, fci_bin)
if (result.answered) then
n2svcd.notice ("CALL ANSWERED = YES")
end
-- This will automatically release the call (if needed) with default release cause.
return
Example (connect to called party with a prefix, default NoAnswer, no FCI/SCI, B-Party beep with explicit ID, not monitored/charged):
local n2svcd = require "n2.n2svcd"
local scp_api = require "n2.n2svcd.scp"
local scp_call = ...
local called_party = '1703' .. scp_call.normalised_called_party
local result = scp_api.connect_attempt (called_party, nil, nil, nil, { id = 1300 })
if (result.answered) then
n2svcd.notice ("CALL ANSWERED = YES")
end
-- This will automatically release the call (if needed) with default release cause.
return
.connect_monitored
This is a convenience method for calling termination_attempt ()
which sets the monitored
Termination type flag, and
allows for the setting of some commonly used parameters including address digits, meaning that INAP Connect
will be used.
Setting the monitored
flag means that the service logic will continue to be in the call control path for the duration of
the talk time, and will receive monitor notification events after the successful ActivityTest
/ActivityTestResult
performs for each monitor interval.
When the connect_monitored ()
method (or a direct call to the termination_attempt ()
) returns answered
= true
,
the service logic is obliged to repeatedly call the monitor_check ()
method until the returned result no longer indicates
that the call is being monitored.
The connect_monitored
method takes the following arguments:
Attribute | Type | Description |
---|---|---|
address_digits
|
Digit String |
Specify the normalised destinationRoutingAddress digits (only 0-9A-F ).The applicable configured 'called_party' denormalisation on the LhoScpApp will be applied. If this field is present, then INAP Connect will be used, else INAP Continue is sent.
|
no_answer_timeout
|
Integer |
Specify the NoAnswer timeout to pass to the switch. (Default = use the default configured in LhoScpApp, if any). |
monitor_interval_secs
|
Integer |
The requested monitor report interval (in seconds). (Default = default monitor report interval for the applicable SSP model). |
max_call_secs
|
Integer |
The requested hard-cap maximum permitted talk-time (in seconds). (Default = default maximum call duration for the applicable SSP model). |
The connect_monitored
method returns the same result structure as termination_attempt
.
Example (monitored connect to a fixed number, 30 second monitor intervals, 600 seconds maximum call duration):
local n2svcd = require "n2.n2svcd"
local scp_api = require "n2.n2svcd.scp"
local scp_call = ...
local called_party = '07119222'
local result = scp_api.connect_monitored (called_party, nil, 30, 600)
if (result.answered) then
n2svcd.notice ("CALL ANSWERED = YES")
repeat
result = scp_api.monitor_check ()
until (not result.monitored)
end
-- This will automatically release the call (if needed) with default release cause.
return
.monitor_check [Asynchronous]
This monitor check method must be called by any script using monitored calls, after a monitored call attempt has been answered.
- A monitored call attempt is one which sets the
monitored
attribute intermination_attempt
directly or viaconnect_monitored
. - An answered call attempt is one where the
answered
attribute is returnedtrue
.
The logic must repeat calls to result = scp_api.monitor_check
until not result.monitored
.
The script may perform other protocol actions prior to each invocation of monitor_check
. These may include
asynchronous actions, e.g. Diameter client or REST client actions via the corresponding agent.
See also the subsequent sections related to follow-on telephony actions, and to service-initiated hangup
during monitored calls for further discussion of how the monitor_check
method interacts with other
telephony methods.
The monitor_check
method takes no arguments.
The monitor_check
method returns a table with the following structure:
Attribute | Type | Description |
---|---|---|
.controlled
|
Boolean |
[Required] Is this call still controlled at all right now. This value being true indicates that (at least some) telephony API actions can be performed by service logic.Note that in some cases the available control actions may be limited. |
.monitored
|
Boolean |
[Required] Is this call still monitored. When this value returns true it indicates that the A-Leg to B-Leg talk-time is still in progress, and
the total talk time has reached the sum of all monitoring report intervals to-date.When this value returns false it indicates that the A-Leg to B-Leg talk-time is ended, the
end-of-call information fields will be present, and the service logic does not need to call monitor_check any more.
|
.scp
|
Object | Container for various SCP details. |
.monitored_secs
|
Integer |
What is the total talk time confirmed by this and all previous reports. This value is present only when returned .monitored = true .
|
.edp_name
|
String |
[Required] The name of the Event Detection Point which fired. One of: oAbandon_leg1 , tAbandon_leg1 , oDisconnect_leg1 , or tDisconnect_leg1 .This value is present only when .monitored is not true .
|
.ring_dsm
|
Integer |
The ring-time (in deci-seconds) as measured by us, present if and only if the call was answered. This is the same value as originally returned by termination_attempt or connect_monitored .This value is present only when .monitored is not true .
|
.talk_dsm_total
|
Integer |
The total measured talk time (in deci-seconds) from receiving answer notification to receiving disconnect notification. This value is present only if the Termination type was Charged or Montored, and the call was answered. This value is present only when .monitored is not true .
|
.cause
|
Integer |
The value of the received tBusySpecificInfo/tBusyCause_cause OR tNoAnswerSpecificInfo/tNoAnswerCause if received.This value is present only when .monitored is not true .
|
.forward
|
1
|
Present with value 1 iff tBusySpecificInfo/forwardedCall OR tNoAnswerSpecificInfo/forwardedCall was received.This container is present only when .monitored is not true .
|
.cir
|
Object |
Container for any returned CallInformationReport fields which were received.This value is present only when .monitored is not true .
|
.callAttemptElapsedTimeValue
|
Integer |
The value from the received CallInformationReport .
|
.callStopTimeValue_yyyymmddhhmmss
|
String |
The 14-character value from the received CallInformationReport in YYYYMMDDHHMMSS format.
|
.callConnectedElapsedTimeValue
|
Integer |
The value from the received CallInformationReport .
|
.calledAddressValue_digits
|
Hex Digits |
The value from the received CallInformationReport .
|
.calledAddressValue_noa
|
Integer |
The value from the received CallInformationReport .
|
.calledAddressValue_nqi
|
Integer |
The value from the received CallInformationReport .
|
.calledAddressValue_ni
|
Integer |
The value from the received CallInformationReport .
|
.calledAddressValue_npi
|
Integer |
The value from the received CallInformationReport .
|
.calledAddressValue_pri
|
Integer |
The value from the received CallInformationReport .
|
.calledAddressValue_si
|
Integer |
The value from the received CallInformationReport .
|
.releaseCauseValue_cause
|
Integer |
The value from the received CallInformationReport .
|
If the call successfully completes the entire monitoring interval with both legs still connected, then the return value is:
{ controlled = true, monitored = true, monitored_secs = <integer> }
If the B-Leg is terminated but the A-Leg is still available, then follow-on telephony is possible, and the return is:
{ controlled = true, monitored = false, monitored_secs is not present, other fields will be present }
If the A-Leg is terminated, then the B-Leg will also be terminated and the return is:
{ controlled = false, monitored = false, monitored_secs is not present, other fields will be present }
.connect_charged
This is a convenience method for calling termination_attempt ()
which sets the charged
Termination type flag, and
allows for the setting of some commonly used parameters including address digits, meaning that INAP Connect
will be used.
Setting the charged
flag means that the service logic will continue to be in the call control path for the duration of
the talk time, and will be requested to perform subsequent grants in relation to the ApplyCharging
/ApplyChargingReport
which are performed for each charge grant period.
When the connect_monitored ()
method (or a direct call to the termination_attempt ()
) returns answered
= true
,
the service logic is obliged to repeatedly call the charge_check ()
method until the returned result no longer indicates
that the call is being charged. See the description below of charge_check ()
for the use of charge_extend ()
and
charge_deny ()
after charge_check
returns a result with charged
= true
.
The connect_charged
method takes the following arguments:
Attribute | Type | Description |
---|---|---|
address_digits
|
Digit String |
Specify the normalised destinationRoutingAddress digits (only 0-9A-F ).The applicable configured 'called_party' denormalisation on the LhoScpApp will be applied. If this field is present, then INAP Connect will be used, else INAP Continue is sent.
|
no_answer_timeout
|
Integer |
Specify the NoAnswer timeout to pass to the switch. (Default = use the default configured in LhoScpApp, if any). |
grant_secs
|
Integer | [Required] The initial grant period (in seconds). |
max_call_secs
|
Integer |
The requested hard-cap maximum permitted talk-time (in seconds). (Default = default maximum call duration for the applicable SSP model). |
release_at_expiry
|
0 / 1
|
Is this the (first and) only grant and should the call (both legs) be released when this grant is entirely exhausted? (Default = false , this is not the only grant).
|
.release_tone
|
0 / 1
|
Should a tone be played (if supported) when performing this final grant? (Default = default release tone flag value for the applicable SSP model). |
The connect_charged
method returns the same result structure as termination_attempt
.
Example (charged connect to the original number, 60 second initial grant):
local n2svcd = require "n2.n2svcd"
local scp_api = require "n2.n2svcd.scp"
local scp_call = ...
local called_party = scp_call.normalised_called_party
local result = scp_api.connect_charged (called_party, nil, 60)
if (result.answered) then
n2svcd.notice ("CALL ANSWERED = YES")
local num_extends = 0
while (true) do
result = scp_api.charge_check ()
if (not result.charged) then break end
num_extends = num_extends + 1
-- Allow two open-ended extensions.
if (num_extends < 3) then
scp_api.charge_extend (60)
-- The final extension we set the release_at_expiry flag, the call will be ended by us.
else
scp_api.charge_extend (60, true)
end
end
end
-- This will automatically release the call (if needed) with default release cause.
return
.charge_check [Asynchronous]
This charge check method must be called by any script using charged calls, after the charged
call attempt has initially been answered, and then subsequently after each call to charge_extend
.
- A charged call attempt is one which sets the
charged
attribute intermination_attempt
directly or viaconnect_charged
. - An answered call attempt is one where the
answered
attribute is returnedtrue
.
The script may perform other protocol actions prior to each invocation of charge_check
. These may include
asynchronous actions, e.g. Diameter client or REST client actions via the corresponding agent.
See also the subsequent sections related to follow-on telephony actions, and to service-initiated hangup
during monitored calls for further discussion of how the charge_check
method interacts with other
telephony methods.
The charge_check
method takes no arguments.
The charge_check
method returns a table with the following structure:
Attribute | Type | Description |
---|---|---|
.controlled
|
Boolean |
[Required] Is this call still controlled at all right now. This value being true indicates that (at least some) telephony API actions can be performed by service logic.Note that in some cases the available control actions may be limited. |
.charged
|
Boolean |
[Required] Is this call still charged. When this value returns true it indicates that the A-Leg to B-Leg talk-time is still in progress, and
the total talk time has reached the sum of the initial grant and all subsequent grant intervals to-date.
|
.error
|
String |
This field will be present in the case of an unhandled exception in the SCP control logic. The following fields will not be present. Specifically, `.scp.talk_ds_total` will be absent. The Lua service script should maintain a running record of the last confirmed `talk_ds_total` in order to prevent loss-of-revenue in the case of protocol or system exception. |
.scp
|
Object | Container for various SCP details. |
.talk_ds_total
|
Integer | The total talk-time (in deci-seconds) reported by the network. |
.talk_ds_last
|
Integer |
The portion of the talk-time (in deci-seconds) used from the last approved grant. In general this will be equal to the last grant time. |
.edp_name
|
String |
[Required] The name of the Event Detection Point which fired. One of: oAbandon_leg1 , tAbandon_leg1 , oDisconnect_leg1 , or tDisconnect_leg1 .This value is present only when .charged is not true .
|
.ring_dsm
|
Integer |
The ring-time (in deci-seconds) as measured by us, present if and only if the call was answered. This is the same value as originally returned by termination_attempt or connect_monitored .This value is present only when .charged is not true .
|
.talk_dsm_total
|
Integer |
The total measured talk time (in deci-seconds) from receiving answer notification to receiving disconnect notification. This value is present only if the Termination type was Charged or Montored, and the call was answered. This value is present only when .charged is not true .
|
.cause
|
Integer |
The value of the received tBusySpecificInfo/tBusyCause_cause OR tNoAnswerSpecificInfo/tNoAnswerCause if received.This value is present only when .charged is not true .
|
.forward
|
1
|
Present with value 1 iff tBusySpecificInfo/forwardedCall OR tNoAnswerSpecificInfo/forwardedCall was received.This container is present only when .charged is not true .
|
.cir
|
Object |
Container for any returned CallInformationReport fields which were received.This value is present only when .charged is not true .This container has the same structure as defined for the monitor_check () returned result.
|
If the call successfully completes the total granted time with both legs still connected, then the return value is:
{ controlled = true, charged = true, talk_ds_total = <integer> }
If the B-Leg is terminated but the A-Leg is still available, then follow-on telephony is possible, and the return is:
{ controlled = true, charged = false, talk_ds_total = <integer>, other fields will be present }
If the A-Leg is terminated, then the B-Leg will also be terminated and the return is:
{ controlled = false, charged = false, talk_ds_total = <integer>, other fields will be present }
Note: In some exception cases,
.charge_extend [Synchronous]
This charge grant method must be called by any script using charged calls, whenever the
charge_check
method returns result.charged
= true
and the service decides to grant
a subsequent talk-time extension.
If the service does not wish to grant a talk-time extension, it should use the charge_deny ()
method instead.
The service may know in advance that this is to be the final permitted extension in which case it may
use the release_at_expiry
flag to request the service to automatically end the call (both legs) when
this grant is consumed.
The script may perform other protocol actions prior to each invocation of charge_extend
. These may include
asynchronous actions, e.g. Diameter client or REST client actions via the corresponding agent.
See also the subsequent sections related to follow-on telephony actions, and to service-initiated hangup
during monitored calls for further discussion of how the charge_extend
method interacts with other
telephony methods.
The charge_extend
method takes the following arguments:
Field | Type | Description |
---|---|---|
grant_secs
|
Integer |
[Required] Request the additional granted talk-time interval in seconds. The LhoScpApp may enforce minimum and maximum bounds for this value. |
release_at_expiry
|
0 / 1
|
Is this the known-final grant? Should the call (both legs) be released when this grant is entirely exhausted. (Default = this is not the known-final grant). |
cause
|
0 - 127
|
Specify an explicit release cause to when releasing the call at expiry of the grant time. (Default = default release cause for the applicable SSP model). |
.release_tone
|
0 / 1
|
Should a tone be played (if supported) when performing this final grant? (Default = default release tone flag value for the applicable SSP model). |
The charge_extend
method returns true
.
.charge_deny [Synchronous]
This charge grant method must be called by any script using charged calls, whenever the
charge_check
method returns result.charged
= true
and the service decides NOT to grant
a subsequent talk-time extension.
The script may perform other protocol actions prior to the invocation of charge_deny
. These may include
asynchronous actions, e.g. Diameter client or REST client actions via the corresponding agent.
The call be torn-down (both legs).
NOTE: After calling charge_deny
, the service logic must return and call charge_check
one final time.
In this final case, charge_check
is guaranteed to return charged
= false
to indicate that the
call is no longer under charge control.
NOTE: Due to race conditions, it is possible that the A-Party or B-Party may hang-up in the background,
prior to the charge deny operation being executed. Hence the returned value of the final call to
charge_check
may represent either:
- A-Party Hang-Up, call is no longer controlled (the deny did not apply).
- B-Party Hang-Up, call is still controlled (the deny did not apply).
- Charge Deny Hang-Up, call is no longer controlled.
The charge_deny
method takes the following arguments:
Field | Type | Description |
---|---|---|
cause
|
0 - 127
|
Specify an explicit release cause to when releasing the call at expiry of the grant time. (Default = default release cause for the applicable SSP model). |
The charge_deny
method returns true
.
Limited Telephony within Monitor/Charge
The termination_attempt
, monitor_check
, and charge_check
methods can return:
monitored
=true
orcharged
=true
(which will also have)controlled
=true
This is a limited form of telephony control. The service may in theory invoke:
tcap_abort
- Lua
error
- Lua
return
All of these will result in an unclean shutdown.
Follow-On Telephony after Monitor/Charge
The monitor_check
and charge_check
methods can return:
monitored
=false
orcharged
=false
(but with)controlled
=true
This occurs when the B-Leg of the monitored/charged call ends, but the A-Leg is still available.
At this time, all of the standard telephony methods are now available, including follow-on interaction and/or B-Leg termination.
Slow Service Logic
All service logic must respond promptly, within the service_logic_ms
timer (default = 2500
milliseconds)
configured for the LhoScpApp.
If the service logic response is not received within this time whenever it is expected, then the LhoScpApp will assume that call control has been abandoned, and will terminate the in-progress call with the loss of all legs.