Hi, I've some analogic lines and I'm asked if it's possible to program an asterisk for "checking" the inbound calls without answering them, doing something like this: analog line 1 -----+---------- asterisk | \______ analog phone when a call enter, asterisk sense it and store its values (callerid, date and time, etc) somewhere, but nothing more, people will answer using the old analog phone. The goal is to have a log of the inbound calls without touching the old analog system (it's shared between different subjects). I'm pretty sure it's something possible, but how to tell asterisk: "ok, call this AGI, and then don't answer and do nothing more". Any idea? Thanks
kevin.larsen at pioneerballoon.com
2017-Apr-20 20:32 UTC
[asterisk-users] log incoming calls without answering
> From: Fabio Moretti <fmoretti at tecytal.com> > To: Asterisk Users Mailing List - Non-Commercial Discussion > <asterisk-users at lists.digium.com> > Date: 04/20/2017 03:26 PM > Subject: [asterisk-users] log incoming calls without answering > Sent by: asterisk-users-bounces at lists.digium.com > > Hi, > > I've some analogic lines and I'm asked if it's possible to program > an asterisk for "checking" the inbound calls without answering them, > doing something like this: > > analog line 1 -----+---------- asterisk > | > \______ analog phone > > when a call enter, asterisk sense it and store its values (callerid, > date and time, etc) somewhere, but nothing more, people will answer > using the old analog phone. > The goal is to have a log of the inbound calls without touching the > old analog system (it's shared between different subjects). > > I'm pretty sure it's something possible, but how to tell asterisk: > "ok, call this AGI, and then don't answer and do nothing more". > > Any idea? > > ThanksThis gets kinda Rube Golberg-ish, but convert the incoming analog line to sip, route it through asterisk and have asterisk do its thing before converting it back to analog to send to the phone. Only problem is you get a lot of extra hardware involved in the mix to make it work. It will be a lot of expense and trouble, so you need to make sure that whatever part you want asterisk to play is worth that effort. Also, I wouldn't touch a fax line in this manner. If you could give a bit more info on what you want asterisk to do, we could maybe give better advice on how to solve your problem. ______________________________________________________________________ This email has been scanned by the Symantec Email Security.cloud service. For more information please visit http://www.symanteccloud.com ______________________________________________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20170420/624d8f47/attachment.html>
Il 20/04/2017 17:32, kevin.larsen at pioneerballoon.com ha scritto:> > This gets kinda Rube Golberg-ish, but convert the incoming analog line > to sip, route it through asterisk and have asterisk do its thing > before converting it back to analog to send to the phone. Only problem > is you get a lot of extra hardware involved in the mix to make it > work. It will be a lot of expense and trouble, so you need to make > sure that whatever part you want asterisk to play is worth that > effort. Also, I wouldn't touch a fax line in this manner. > > If you could give a bit more info on what you want asterisk to do, we > could maybe give better advice on how to solve your problem.Hi Kevin, I've already proposed your solution (is the most reasonable) but they have more than 60 analogs lines (no faxes) and some of them terminate in appliances like alarms, etc, so the solution must not touch in any way the connection between the line and his termination: doing a analog to digital conversion, passing it to asterisk and the convert it back to analog is prone to problems (what if asterisk crashes? or if a gateway fail?). I can split the existing lines (there are no complex things like adsl or digital signaling), convert the branches to digital and terminate then into an asterisk machine, so any failure will not affect the old circuit, but of course I've to configure asterisk to ONLY LOG calls and nothing more. This is what they want: - line 1 ring - line 1 is splitted in two, the first branch (let's say the "analog" branch) go to an analog phone, that rings - the second branch go through a gateway and then to asterisk - asterisk log (with an AGI for example) "line 1 rings at .... from ...." no more is required from asterisk, if someone answer the analog phone or not is not my business.
>>>>> "FM" == Fabio Moretti <fmoretti at tecytal.com> writes:FM> when a call enter, asterisk sense it and store its values (callerid, FM> date and time, etc) somewhere, but nothing more, people will answer FM> using the old analog phone. The goal is to have a log of the inbound FM> calls without touching the old analog system (it's shared between FM> different subjects). IIUC, the pots line has both some number of analog phones a/o fax machines on it, plus a fxo->sip gateway, yes? You can route the sip portion to asterisk and have the dialplan log everything but never answer. You may want to call the Ringing dialplan application, but even that may not be required. OTOH, calling Ringing should prevent the gateway from assuming that the asterisk machine never saw the INVITE. Eventually, when the other extension answers, the fxo->sip gateway will cancel the sip call just like it would if the caller hung up. (There is a possibility that any given gateway may not cancel the sip call until the analog call is completed; you need to test.) -JimC -- James Cloos <cloos at jhcloos.com> OpenPGP: 0x997A9F17ED7DAEA6
Fabio, this doesn't answer your question directly and it's not Asterisk related in any way, but it's another way to engineer a solution to the problem and I've seen it done before. Many analog modems will decode the caller ID on the analog line and provide it as part of the 'RING' notification on their serial port. This can be used as input on a script on a computer to log the caller ID and datestamp. For the Asterisk solution you propose to be able to work, the analog line has to support caller ID. If it does that then it will work with any of these modems too. It's a purely passive connection to the line (just bridge it over the pair) and it may be cheaper/simpler/easier for you to build. Food for thought? Pete> On 21/04/2017, at 8:26 am, Fabio Moretti <fmoretti at tecytal.com> wrote: > > Hi, > > I've some analogic lines and I'm asked if it's possible to program an asterisk for "checking" the inbound calls without answering them, doing something like this: > > analog line 1 -----+---------- asterisk > | > \______ analog phone > > when a call enter, asterisk sense it and store its values (callerid, date and time, etc) somewhere, but nothing more, people will answer using the old analog phone. > The goal is to have a log of the inbound calls without touching the old analog system (it's shared between different subjects). > > I'm pretty sure it's something possible, but how to tell asterisk: "ok, call this AGI, and then don't answer and do nothing more". > > Any idea? > > Thanks-------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3577 bytes Desc: not available URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20170421/934cd152/attachment.bin>
J Montoya or A J Stiles
2017-Apr-21 08:36 UTC
[asterisk-users] log incoming calls without answering
On Thursday 20 Apr 2017, Fabio Moretti wrote:> Hi, > > I've some analogic lines and I'm asked if it's possible to program an > asterisk for "checking" the inbound calls without answering them, doing > something like this: > > analog line 1 -----+---------- asterisk > > \______ analog phone > > when a call enter, asterisk sense it and store its values (callerid, date > and time, etc) somewhere, but nothing more, people will answer using the > old analog phone. The goal is to have a log of the inbound calls without > touching the old analog system (it's shared between different subjects). > > I'm pretty sure it's something possible, but how to tell asterisk: "ok, > call this AGI, and then don't answer and do nothing more". > > Any idea?You can get FXO cards, such as the TDM410P/E; which connect to an analogue line just like a telephone and then allow the line to be treated as a DAHDI channel. (You would need an FXS card to connect to an analogue telephone; this has an additional power supply to generate the 48V DC line voltage and 80V, 25 Hz ringing voltage. Usually these cards have 4 or 8 slots for either FXO or FXS modules; make sure you buy the right ones. Explaining to the vendor what you want it for may be the best way.) So you could have Asterisk as an extension to your analogue line, and it could monitor incoming calls. (You would not be able to monitor outgoing calls, though; unless you connected each analogue telephone to an FXS port, and used Asterisk as a simple PABX.) You do not need to Answer() the line to get the caller ID; it comes down the line (either as 300 baud modem tones representing ASCII, or DTMF digit tones, depending on your telephone company) between the polarity reversal and the first ring. And there is no need to have Answer()ed before running an AGI (in fact, you might have good reasons why you would want to have a pre-answer script, such as deciding which extension to ring, if you want to direct inbound callers straight back to the agent who called them earlier). All your AGI need do is fork(), and now -- as far as you are concerned -- there are two parallel universes, each containing a full copy of the original process with the same variables and file handles. In one, which is the parent, fork() returned a non-zero value (which is the PID of the child process, and you might have to clear it out of the process table if it exits before you do); so that process can just exit and return control to Asterisk. In the child process, where the fork() call returned zero (you don't need to know your parent process's PID, since any still-living grandparent will just take care of you), you need just to close STDIN, STDOUT and STDERR (which are still connected to Asterisk) so it will no longer be waiting for your process to do anything -- now you are free! :) You then connect to some sort of database and run a query like INSERT INTO call_history(date,source,dest) VALUES(NOW(),"${CALLERID(num)}","${EXTEN}"); except that ${CALLERID(num)} and ${EXTEN} will have to be passed into the AGI script as parameters. Then. back in extensions.conf, Dial() a local channel that does nothing but Wait() for long enough for the ringing to stop; either because the analogue phone has been picked up, or because the caller has stopped trying. Asterisk should get a Hangup() event when the far end hangs up, at any rate. If you buy a single-channel one of the cheap Chinese clone cards (from The Usual Place), it ought to last long enough and work well enough for you to experiment with; but DO NOT rely on these cheap cards for anything even remotely mission-critical. -- JM Note: Originating address only accepts e-mail from list! If replying off- list, change address to asterisk1list at earthshod dot co dot uk .
Thank for all the replies, a lot of input and information! Sorry for this useless mail, but I really wanted to say thank you. Il 20/04/2017 17:26, Fabio Moretti ha scritto:> Hi, > > I've some analogic lines and I'm asked if it's possible to program an asterisk for "checking" the inbound calls without answering them, doing something like this: > > analog line 1 -----+---------- asterisk > | > \______ analog phone > > when a call enter, asterisk sense it and store its values (callerid, date and time, etc) somewhere, but nothing more, people will answer using the old analog phone. > The goal is to have a log of the inbound calls without touching the old analog system (it's shared between different subjects). > > I'm pretty sure it's something possible, but how to tell asterisk: "ok, call this AGI, and then don't answer and do nothing more". > > Any idea? > > Thanks > > > > > >-- Fabio Moretti Gerente de Sistemas www.tecytal.com <http://www.tecytal.com> 0800 8780 (+598) 248 77921
On Thu, 2017-04-20 at 17:26 -0300, Fabio Moretti wrote:> Any idea?I used to play with an analog telephone line and Asterisk by using a Linksys SPA-3102 Voice Gateway. I think it is no longer manufactured, but maybe you con buy a used one on eBay or you can find an equivalent device from another manufacturer.