NAP Status and other NAP Information
All the status fields of the NAPs are provided for use by the routing scripts. For developers: see the nap status provider for more details on which fields are available in the CEngineStatTransNap.hpp file.
Notice: These values may change between major release.
Routing script call attribute name Description
--------------------------------------------------------------------------------------------
"name" NAP name.
"signaling_type" Signaling type (SS7, ISDN, CASR2, SIP)
"profile" Profile name.
"sip_destination_ip" Destination IP address.
"sip_destination_port" Destination IP port.
"sip_transport_type" SIP transport type (:udp, :tcp, or :tls) (Toolpack 3.1 and more)
"inst_incoming_call_cnt" Instantaneous Count of incoming calls.
"inst_outgoing_call_cnt" Instantaneous Count of outgoing calls.
"available_cnt" Number of available circuits or channels.
"unavailable_cnt" Number of unavailable circuits or channels.
"availability_percent" Percentage of available circuits or channels.
"usage_percent" Percentage of used circuits or channels.
"unused_shared_percent" Percentage of used circuits or channels of this NAP available to make new calls with (taking into account shared with other NAPs)
"total_incoming_call_cnt" Total Count of incoming calls.
"global_asr_percent" Global calculated ASR percentage.
"total_outgoing_call_cnt" Total Count of outgoing calls.
"last_24h_asr_percent" Last 24 hours calculated ASR percentage.
"last_24h_outgoing_call_cnt" Last 24 hours outgoing calls.
"current_hour_asr_percent" Current hour calculated ASR percentage.
"current_hour_outgoing_call_cnt" Current hour outgoing calls.
"last_hour_asr_percent" Last hour calculated ASR percentage.
"last_hour_outgoing_call_cnt" Last hour outgoing calls.
"poll_remote_proxy" Remote proxy polling enabled
"is_available" Remote proxy actually available or not
"time_since_polling" Time since the last availibility polling
"time_available_seconds" Number of seconds since the NAP is available
"time_unavailable_seconds" Number of seconds since the NAP is unavailable
"register_to_proxy" Register to proxy enabled
"registered" Actually registered or not
"time_since_refresh" Time since the last refresh
"time_registered_seconds" Number of seconds since the NAP is registered
"time_not_registered_seconds" Number of seconds since the NAP is not registered
"asr_stats_incoming_struct" Detailed Answer-Seizure Rate incoming statistics.
{
"global_asr_percent" Global calculated ASR percentage.
"total_call_cnt" Total count of calls.
"total_accepted_call_cnt" Total count of accepted calls (not dropped due to congestion or rate-limiting).
"total_answered_call_cnt" Total count of answered calls.
"last_24h_asr_percent" Last 24 hours calculated ASR percentage.
"last_24h_call_cnt" Last 24 hours count of calls.
"current_hour_asr_percent" Current hour calculated ASR percentage.
"current_hour_call_cnt" Current hour count of calls.
"last_hour_asr_percent" Last hour calculated ASR percentage.
"last_hour_call_cnt" Last hour count of calls.
}
"asr_stats_outgoing_struct" Detailed Answer-Seizure Rate outgoing statistics.
{
"global_asr_percent" Global calculated ASR percentage.
"total_call_cnt" Total count of calls.
"total_accepted_call_cnt" Total count of accepted calls (not dropped due to congestion or rate-limiting).
"total_answered_call_cnt" Total count of answered calls.
"last_24h_asr_percent" Last 24 hours calculated ASR percentage.
"last_24h_call_cnt" Last 24 hours count of calls.
"current_hour_asr_percent" Current hour calculated ASR percentage.
"current_hour_call_cnt" Current hour count of calls.
"last_hour_asr_percent" Last hour calculated ASR percentage.
"last_hour_call_cnt" Last hour count of calls.
}
"mos_struct" Detailed Mean Opinion Score statistics.
{
"last_24h_ingress" Last 24 hours calculated MOS for incoming RTP packets.
"last_24h_egress" Last 24 hours calculated MOS for outgoing RTP packets.
"current_hour_ingress" Current hour calculated MOS for incoming RTP packets.
"current_hour_egress" Current hour calculated MOS for outgoing RTP packets.
"last_hour_ingress" Last hour calculated MOS for incoming RTP packets.
"last_hour_egress" Last hour calculated MOS for outgoing RTP packets.
}
"network_quality_struct" Detailed network quality statistics.
{
"last_24h_ingress" Last 24 hours network quality percentage for incoming RTP packets.
"last_24h_egress" Last 24 hours network quality percentage for outgoing RTP packets.
"current_hour_ingress" Current hour network quality percentage for incoming RTP packets.
"current_hour_egress" Current hour network quality percentage for outgoing RTP packets.
"last_hour_ingress" Last hour network quality percentage for incoming RTP packets.
"last_hour_egress" Last hour network quality percentage for outgoing RTP packets.
}
The nap status is part of a substructure and will be a hash containing all subfield elements.
Example to access NAP information and NAP status of the current call
To find the incoming nap in a routing script, we can do this in before_filter or after_filter and use these lines to create a symbol:
incoming_nap = params[:call][:nap].to_sym
log_trace 1, "incoming_nap = " + incoming_nap.inspect
To get the configured NAP list, you can do this:
nap_lists = params[:naps]
log_trace 1, "nap_lists = " + nap_lists.inspect
From the list above, you can find how many calls you have on this NAP:
log_trace 1,"Incoming NAP call count=" + nap_lists[incoming_nap][:asr_stats_incoming_struct][:total_call_cnt].inspect
Or which network the call is coming from:
log_trace 1,"Incoming NAP signaling type=" + nap_lists[incoming_nap][:signaling_type].inspect
If you are using a "NAP Columns" custom parameter (Create New NAP Column), you can get the information (since incoming_nap is a symbol):
network_type = nap_lists[incoming_nap][:network_type]
log_trace 1, "For incoming_nap = " + incoming_nap.inspect + " network_type is: " + network_type.inspect
If you want to modify something according to nap information, you may need to do a loop like this:
nap_lists.each do |nap_list,nap_info|
log_trace 1, "NAP: " + nap_info[:name].inspect + " network_type: " + nap_info[:network_type].inspect
end
Last updated
Was this helpful?