Multiple Outbound Carriers

Any and all non-support discussions

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

Multiple Outbound Carriers

Postby thephaseusa » Wed Feb 14, 2018 9:37 am

Version: 2.14b0.5
SVN Version: 2872
DB Schema Version: 1527
ViciBox v.7.0.4| Asterisk 11.25.1-vici |
4 Box Cluster of 1 Database, 1 Asterisk, 1 Web, & 1 Archive Server.
Fundraising Call Center

If I have 2 carriers configured for outbound calls on the same asterisk dialer, will Vicidial use both of them, and if so how does it split them up? One call from carrier one from another, 50-50, or is additional configuration required to tell vicidial how to split the calls between 2 active carriers?

John M
thephaseusa
 
Posts: 345
Joined: Tue May 16, 2017 2:23 pm

Re: Multiple Outbound Carriers

Postby blackbird2306 » Wed Feb 14, 2018 10:15 am

Yes it's possible to use different carriers for each different single campaign. Just put different dial prefixes in campaign settings to use different carriers:
Dial Prefix 9 dialplan:
Code: Select all
exten => _91999NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _91999NXXXXXX,2,Dial(${TESTSIPTRUNK}/${EXTEN:2},,To)
exten => _91999NXXXXXX,3,Hangup

Dial Prefix 8 dialplan:
Code: Select all
exten => _81999NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _81999NXXXXXX,2,Dial(${TESTSIPTRUNK2}/${EXTEN:2},,To)
exten => _81999NXXXXXX,3,Hangup

[edit by williamconley: put the 8 in front of the "dial prefix 8" diaplan. lol]
-----------------------------------
Or failover dialplan, when carrier1 call fails then use carrier2:
Code: Select all
exten=>_91999NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten=>_91999NXXXXXX,n,Dial(${TESTSIPTRUNK}/${EXTEN:1},,To)
exten=>_91999NXXXXXX,n,Dial(${TESTSIPTRUNK2}/${EXTEN:1},,To)
exten=>_91999NXXXXXX,n,Hangup

Or look here for random use of different carriers in single campaign (but random means game of luck and not 50 / 50):
http://vicidial.org/VICIDIALforum/viewtopic.php?t=23169
Vicibox 6.0.2 from Vicibox_v.6.0.x86_64-6.0.2.iso | Vicidial 2.12-560a build: 160617-1427 | Asterisk 1.8.32.3
blackbird2306
 
Posts: 409
Joined: Mon Jun 23, 2014 5:31 pm

Re: Multiple Outbound Carriers

Postby thephaseusa » Sat Feb 17, 2018 2:18 pm

Thanks blackbird for your reply.

What if i have 2 active carriers for outbound at the same time.

I am not talking about altering dial plans. I have 2 carriers and each has its own dial plan, and each one is set to active. When i log into a campaign, what will asterisk do? Will it dial exclusively with the 1st carrier it finds? Will it dial some numbers from one, some from another? Will it use one and ignore the other?

I ask because I have used both carriers, and both work. But i have only used one active at a time. What happens if you have more than one active carrier?

Also, when i tried alternating carriers i didnt change any campaign settings. I just changed carriers from active to not active.

John
thephaseusa
 
Posts: 345
Joined: Tue May 16, 2017 2:23 pm

Re: Multiple Outbound Carriers

Postby blackbird2306 » Sun Feb 18, 2018 7:59 am

Yes sure you can use 2 (or more) carriers at same time with setting to "Y". But it's bad practice to use exactly the same dialplan without putting a prefix in front of the dialplan for both carriers, because then you are not able to control which carrier will be used for dialing. Please read "asterisk pattern matching" (particularly: Order of Pattern Matching) here:
https://wiki.asterisk.org/wiki/display/AST/Pattern+Matching
Asterisk uses a simple set of rules to sort the extensions and patterns so that the best match is found first. The best match is simply the most specific pattern

For example in your case:
Code: Select all
;Carrier 1 dialplan:
exten => _91999NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _91999NXXXXXX,2,Dial(${TESTSIPTRUNK}/${EXTEN:2},,To)
exten => _91999NXXXXXX,3,Hangup
;Carrier 2 dialplan exactly same (but different dial string):
exten => _91999NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _91999NXXXXXX,2,Dial(${TESTSIPTRUNK2}/${EXTEN:2},,To)
exten => _91999NXXXXXX,3,Hangup

Now Asterisk looks for the best matching pattern, but this is not possible, because "_91999NXXXXXX" is for both dialplans the same and equivalent. So what happens? You think Asterisk will randomly use both carriers. No this won't happen. Asterisk takes the matching one, which is previously/above defined "extensions-vicidial.conf", and this is always the same one.
That's why you should put different prefixes in front of both carrier dialplans like here:
Carrier1: exten => _91999NXXXXXX
Carrier2: exten => _81999NXXXXXX

And now you change in campaign settings the dial prefix to "8" or "9" (or different). So every call from this campaign gets this prefix dialed in front of your called number. Now Asterisk knows, which dialplan to use because of matching 9 or 8 in front.

But if you want to use both in parallel then use this dialplan with random order (as described before):
1. Define carrier1 with dial prefix "8" with global string "TESTSIPTRUNK"
2. Define carrier2 with dial prefix "9" with global string "TESTSIPTRUNK2" and put in dialplan entry of carrier2 this:
Code: Select all
exten => _91999NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _91999NXXXXXX,n,Set(Trunk=${RAND(1|2)})
exten => _91999NXXXXXX,n,GoToIf($[${Trunk} = 1]?trunkA)
exten => _91999NXXXXXX,n,GoToIf($[${Trunk} = 2]?trunkB)
exten => _91999NXXXXXX,n(trunkA),Dial(${TESTSIPTRUNK}/${EXTEN:2},,To)
exten => _91999NXXXXXX,n(trunkB),Dial(${TESTSIPTRUNK2}/${EXTEN:2},,To)
exten => _91999NXXXXXX,n,Hangup
Vicibox 6.0.2 from Vicibox_v.6.0.x86_64-6.0.2.iso | Vicidial 2.12-560a build: 160617-1427 | Asterisk 1.8.32.3
blackbird2306
 
Posts: 409
Joined: Mon Jun 23, 2014 5:31 pm

Re: Multiple Outbound Carriers

Postby thephaseusa » Sun Feb 18, 2018 9:22 am

Thank you.

Does this solution mean that if you have campaign A set to dial prefix 8, all calls on that campaign route through carrier 1, and campaign B set to dial prefix 9, calls on it route randomly, or equally, to either carrier 1 or carrier 2?

John
thephaseusa
 
Posts: 345
Joined: Tue May 16, 2017 2:23 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 62 guests