How to limit the session/connection on DB for each call

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

How to limit the session/connection on DB for each call

Postby jessiekidfernando » Wed Jun 12, 2019 1:49 pm

Hello Everyone,

We are having issues with DB connection. Is there any other way to limit the connection or session on each call? We are using 8380 as routing extension. Our cluster consists of 20 dialers and each of it has 300 MAX trunks. Technically we are getting almost 8K sessions given the dial method we are using ADAPT_AVERAGE.

Thanks in advance.

[MARIADB]
dsn=asterisk
readsql=select called_count from vicidial_auto_calls a inner join vicidial_list b on a.lead_id=b.lead_id where a.phone_number=${ARG1} limit 1


; AMD detection based from called_count
exten => 8380,1,Playback(sip-silence)
same => n,AGI(agi://127.0.0.1:4577/call_log)
same => n,NoOp(${DIALEDPEERNUMBER:12})
same => n,NoOp(${ODBC_MARIADB(${DIALEDPEERNUMBER:12})})
same => n,GotoIf($[${ODBC_MARIADB(${DIALEDPEERNUMBER:12})}>=4]?AMD:NoAMD)
same => n(AMD),AMD(2000,2000,1000,5000,120,50,4,256)
same => n,NoOp(${AMDSTATUS})
same => n,NoOp(${AMDCAUSE})
same => n,AGI(VD_amd.agi,${EXTEN})
same => n,AGI(agi-VDAD_ALL_outbound.agi,NORMAL-----SO)
same => n,Hangup()
same => n(NoAMD),AGI(agi-VDAD_ALL_outbound.agi,NORMAL-----SO)
same => n,Hangup()
OS: Linux version 4.4.155-68-default (geeko@buildhost) (gcc version 4.8.5 (SUSE Linux) )
VERSION: 2.14-717a
BUILD: 190724-1603
Asterisk: 13.21.1-vici
Dahdi: 2.11.1
jessiekidfernando
 
Posts: 152
Joined: Fri Feb 08, 2019 5:49 pm

Re: How to limit the session/connection on DB for each call

Postby williamconley » Wed Jun 12, 2019 2:02 pm

We are having issues with DB connection

You would probably get more "on point" answers by sharing the "issues" in question. Too many connections? Raise the limit. That limit is entirely artificial.

limit the connection or session on each call

limit what connection to what? what session? Perhaps you should share the technical limitation you see or barrier you are hitting.

select called_count from vicidial_auto_calls a inner join vicidial_list b on a.lead_id=b.lead_id where a.phone_number=${ARG1} limit 1


I read this to be that you appear to have multiple calls to the same phone number simultaneously? (more than one entry for the same phone number in the auto-calls table?) That's not a good idea (and can get you sued if you are calling businesses, by law you can only autodial ONE at a time to a business across all lines)

If you are looking for "total calls to this number historically" there is a called count field in the vicidial_list table with a single value.

Also: running a "join" command with another table on the vicidial_list table is dangerous. Luckily the auto calls table is usually fairly small, but still, this locks the vicidial_list table and can create havoc if you're not careful.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: How to limit the session/connection on DB for each call

Postby jessiekidfernando » Wed Jun 12, 2019 2:24 pm

Hello William,

Actually we are doing dup check hence no duplicate number on vicidial_list table. Our goal is to check the called_count every time the dialer dials a lead.

Regards,

Jessie Kid Fernando
OS: Linux version 4.4.155-68-default (geeko@buildhost) (gcc version 4.8.5 (SUSE Linux) )
VERSION: 2.14-717a
BUILD: 190724-1603
Asterisk: 13.21.1-vici
Dahdi: 2.11.1
jessiekidfernando
 
Posts: 152
Joined: Fri Feb 08, 2019 5:49 pm

Re: How to limit the session/connection on DB for each call

Postby williamconley » Wed Jun 12, 2019 2:43 pm

1) You are checking for entries in auto-calls table. Why?

2) Vicidial already has a feature to avoid calling a number based on the called count. Campaign Detail View => Call Count Limit. Of course, that doesn't provide AMD vs No AMD.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: How to limit the session/connection on DB for each call

Postby jessiekidfernando » Wed Jun 12, 2019 2:52 pm

1) You are checking for entries in auto-calls table. Why? - to match and get the called_count of the lead that is being dialed by the dialer.

2) Vicidial already has a feature to avoid calling a number based on the called count. Campaign Detail View => Call Count Limit - Based from the custom dialplan for 8380, we want to enable only amd detection based from the called count. If the called_count is more than 4 then that's the only time that the dialer should enable the amd detection.

same => n,GotoIf($[${ODBC_MARIADB(${DIALEDPEERNUMBER:12})}>=4]?AMD:NoAMD)
OS: Linux version 4.4.155-68-default (geeko@buildhost) (gcc version 4.8.5 (SUSE Linux) )
VERSION: 2.14-717a
BUILD: 190724-1603
Asterisk: 13.21.1-vici
Dahdi: 2.11.1
jessiekidfernando
 
Posts: 152
Joined: Fri Feb 08, 2019 5:49 pm

Re: How to limit the session/connection on DB for each call

Postby williamconley » Wed Jun 12, 2019 2:57 pm

Please use quotes as enclosed tags, not by just adding text to the end of the line. It's difficult to see who said what and gets worse with each succession.
jessiekidfernando wrote:to match and get the called_count of the lead that is being dialed by the dialer.


why would you match auto-calls to get a value from the vicidial-list table? the phone number and called count fields are both in vicidial_list ... there's no need for the auto-calls table.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20258
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)


Return to Support

Who is online

Users browsing this forum: Bing [Bot] and 90 guests