Harel
2017-Jun-26 12:06 UTC
[asterisk-users] Autodialer - call simultaneously to both ends
Hello List, I'm working on an autodialer project. At the moment I use the Originate application then I "throw" it to an extension where I Dial() the other party and then both legs are bridged. The problem is that the Dial() will only run after the Originate finish its bit and I have lots of wasted time or even worse, the remote party hanging the call because instead of a human speaking to him the call setup to the 2nd leg only starts when remote answers. Is there a way to start calling both parties at the same time and bridge them when one answers (which will then hear the ringback tone until 2nd party answers)? Thank you Harel
Jean Aunis
2017-Jun-26 12:15 UTC
[asterisk-users] Autodialer - call simultaneously to both ends
Hello, You can certainly do this with the ARI interface but you will have to write some code. You could for example originate two channels, send them to the same Stasis application, create a bridge and place both channels in it. Best regards Jean Aunis Le 26/06/2017 ? 14:06, Harel a ?crit :> Hello List, > I'm working on an autodialer project. > At the moment I use the Originate application then I "throw" it to an extension where I Dial() the other party and then both legs are bridged. The problem is that the Dial() will only run after the Originate finish its bit and I have lots of wasted time or even worse, the remote party hanging the call because instead of a human speaking to him the call setup to the 2nd leg only starts when remote answers. > Is there a way to start calling both parties at the same time and bridge them when one answers (which will then hear the ringback tone until 2nd party answers)? > Thank you > Harel > >
Antony Stone
2017-Jun-26 12:18 UTC
[asterisk-users] Autodialer - call simultaneously to both ends
On Monday 26 June 2017 at 14:06:10, Harel wrote:> Hello List, > I'm working on an autodialer project. > At the moment I use the Originate application then I "throw" it to an > extension where I Dial() the other party and then both legs are bridged. > > The problem is that the Dial() will only run after the Originate finish > its bit and I have lots of wasted time or even worse, the remote party > hanging the call because instead of a human speaking to him the call setup > to the 2nd leg only starts when remote answers.Sounds like you're dialling the legs the wrong way round.> Is there a way to start calling both parties at the same time and bridge > them when one answers (which will then hear the ringback tone until 2nd > party answers)?You should dial the extension of the person who wants the autodial function first (ie: the person who knows about this system). They answer their phone (which should be quick, because they're expecting it to ring after they've initiated the autodial), and they then wait for the remote party (who doesn't know there's an autodialler involved) to answer. Dialling both numbers simultaneously always runs the risk that the remote party (who doesn't know about the autodialler) will answer the call first, so unless you have some recorded announcement "please wait while we connect your call" (which if I heard it would make me hang up immediately, because I'd know it was some automated dialler, probably a cold-calling sales organisation), they answer the phone, hear ringing, think "what the hell?" or even "oh, one of them again" and hang up. Always start from the "local" end - ie: the person who knows about the auto- dialler. Antony. -- Atheism is a non-prophet-making organisation. Please reply to the list; please *don't* CC me.
J Montoya or A J Stiles
2017-Jun-26 16:01 UTC
[asterisk-users] Autodialer - call simultaneously to both ends
On Monday 26 Jun 2017, Harel wrote:> Hello List, > I'm working on an autodialer project. > At the moment I use the Originate application then I "throw" it to an > extension where I Dial() the other party and then both legs are bridged. > The problem is that the Dial() will only run after the Originate finish > its bit and I have lots of wasted time or even worse, the remote party > hanging the call because instead of a human speaking to him the call setup > to the 2nd leg only starts when remote answers. Is there a way to start > calling both parties at the same time and bridge them when one answers > (which will then hear the ringback tone until 2nd party answers)? Thank > youOur auto-dialler works as follows; * Agent clicks number on screen in their web browser * Agent's phone rings * Agent picks up phone * Far end party's phone rings * Far end party answers * Agent and far end party are bridged. and is implemented using the truly ancient technology of callfiles. All you need then is a Perl or PHP script, which accepts the destination number as a query parameter. Your script then needs to identify the workstation by means of its IP address and determine the number of the nearest phone (this does require proper configuration of DHCP server, but is worth it), then write out a callfile. Note: There exists a race condition in Asterisk (at least, when using the common Linux file systems, which update a folder's directory as soon as the *first* block of a file is written) which means that if a callfile exceeds one block, Asterisk could end up reading only the first block and ignoring the rest. If there is any danger that a callfile could exceed one block on your filesystem, you must write the callfile to a different folder, and then use the `mv` command to move it to /var/spool/asterisk/outgoing/ . This sidesteps the race condition due to the behaviour of the mv command. When moving *within* a filesystem, the whole file was already on the disk anyway when the directory is updated; when moving from one filesystem to another, it does not update the directory of the destination folder until the *last* block is written. -- JM or AJS Note: Originating address only accepts e-mail from list! If replying off- list, change address to asterisk1list at earthshod dot co dot uk .
Antony Stone
2017-Jun-26 16:12 UTC
[asterisk-users] Autodialer - call simultaneously to both ends
On Monday 26 June 2017 at 18:01:22, J Montoya or A J Stiles wrote:> On Monday 26 Jun 2017, Harel wrote: > > Hello List, > > I'm working on an autodialer project. > > At the moment I use the Originate application then I "throw" it to an > > extension where I Dial() the other party and then both legs are bridged. > > The problem is that the Dial() will only run after the Originate finish > > its bit and I have lots of wasted time or even worse, the remote party > > hanging the call because instead of a human speaking to him the call > > setup to the 2nd leg only starts when remote answers. Is there a way to > > start calling both parties at the same time and bridge them when one > > answers (which will then hear the ringback tone until 2nd party > > answers)? Thank you > > Our auto-dialler works as follows; > > * Agent clicks number on screen in their web browser > * Agent's phone rings > * Agent picks up phone > * Far end party's phone rings > * Far end party answers > * Agent and far end party are bridged. > > and is implemented using the truly ancient technology of callfiles.These work well and are implementable using any language capable of producing a text file. It's also extremely simple (so long as you can write a network client application) to achieve the same thing using an AMI Originate request.> All you need then is a Perl or PHP script, which accepts the destination > number as a query parameter. Your script then needs to identify the > workstation by means of its IP address and determine the number of the > nearest phone (this does require proper configuration of DHCP server, but > is worth it), then write out a callfile. > > > Note: There exists a race condition in Asterisk (at least, when using the > common Linux file systems, which update a folder's directory as soon as the > *first* block of a file is written) which means that if a callfile exceeds > one block, Asterisk could end up reading only the first block and ignoring > the rest. If there is any danger that a callfile could exceed one block > on your filesystem, you must write the callfile to a different folder, and > then use the `mv` command to move it to /var/spool/asterisk/outgoing/ . > This sidesteps the race condition due to the behaviour of the mv command. > When moving *within* a filesystem, the whole file was already on the disk > anyway when the directory is updated; when moving from one filesystem to > another, it does not update the directory of the destination folder until > the *last* block is written.Yes, that is a very important point. Always use mv with callfiles :) However, to get back to the original poster's question, I believe it's the logic of which way round the calls are being made that's the problem (I agree toally with your 6-step summary above), rather than the mechanism for being able to make calls. Antony. -- BASIC is to computer languages what Roman numerals are to arithmetic. Please reply to the list; please *don't* CC me.