866.766.5050

SmartRoutes Example 1

Example 1 consists of seven (7) SmartRoutes that track the call, identifies the DID, and ultimately route or divert the call.

STEP1_get_tas_account:
SELECT account_code, account_code as userfield FROM dbo.did_numbers WHERE did_numbers=’${FROM_DID}’

Figure 1

This SmartRoute pulls the account number associated with the DID from our CRM. The account is saved for use in later dialplan processing (TASACCT) and recorded in the  CDR.

STEP2_special_did_handling:
SELECT ‘${FROM_DID}’

Figure 2

This SmartRoute looks for special DIDs that might need custom SmartRoute handling.  Examples would be customers that overflow to special queues or other call centers.

 

STEP3_track_calls:
SELECT COUNT(*) FROM (SELECT src,dst,uniqueid FROM smartroute_currentcalls WHERE (dst=${FROM_DID} AND calldate < DATE_SUB(NOW(), INTERVAL 2 MINUTE))) as T

Figure 3

This SmartRoute monitors simultaneous call bursts to an individual DID within a 2 minute period.  The 6+ calls get diverted to a smartroute that ultimately sends them to queue 998.

 

STEP4_route_tas_calls:
SELECT CAST(difficulty as varchar(1)) as difficulty, (RTRIM(account_name)+’-‘) AS account_name FROM dbo.account WHERE account_code=’${TASACCT}’

Figure 4

This SmartRoute pulls info from the customer CRM regarding the DID to determine which queue the call should be sent to.

 

track_calls_DIVERTED_998:
SELECT CAST(difficulty as varchar(1)) as difficulty, (RTRIM(account_name)+’-‘) AS account_name FROM dbo.account WHERE account_code=’${TASACCT}’

Figure 5

Calls diverted in STEP3 are routed to queue 998.

 

track_calls_DIVERTED_999:
SELECT CAST(difficulty as varchar(1)) as difficulty, (RTRIM(account_name)+’-‘) AS account_name FROM dbo.account WHERE account_code=’${TASACCT}’

Figure 6

Calls diverted in STEP3 can be routed to queue 999.

 

x_special_did_6788891339:
SELECT COUNT(*) FROM (SELECT src,dst,uniqueid FROM smartroute_currentcalls WHERE (dst=${FROM_DID} AND calldate < DATE_SUB(NOW(), INTERVAL 2 MINUTE))) as T

Figure 7

This special DID handler from STEP2 will divert calls to an overflow call center using a different DID.