Search for (incoming) calls

(fnc_search_for_calls)

Object name: fnc_search_for_calls
Type: Table value function
Description: A “helper” function to make is easier to search for calls – given a set of known criterias.
Parameters:
Name Datatype Description
@source_number varchar(100) The caller’s number.
@destination_number varchar(100) The number called
@dte_from datetime The earliest start for the call(s)
@dte_to datetime The latest start for the call(s)
@answered bit

Should the call have been answered or not? Set 1 for yes, 0 for no, and NULL if you don’t have any opinion.

 

The parameters might be empty/null. The more you specify as parameter values, the less will the result be. 
Returns: Returns a table containing one and only one column; call_id with datatype numeric(19,0).
Samples:
  • Get the all call_events for answered calls coming from phone ‘87654321’ between 09:00 and 11:00 on June 3rd 2016:
select * from call_events 
where call_id in (select call_id from dbo.fnc_search_for_calls
	('42793704',
	NULL,
	'3-jun-2016 09:00',
	'3-jun-2016 11:00',1))

 

Published

Last updated

3
-1