Jonathan H
2016-Nov-04 21:26 UTC
[asterisk-users] Any way of creating a file to write to from the dialplan, or must I use AGI?
Seems I can write to an existing file, but is there really no way of creating a new file to log some data to, without reverting to AGI? (will be different for each caller ID)
John Covici
2016-Nov-04 21:32 UTC
[asterisk-users] Any way of creating a file to write to from the dialplan, or must I use AGI?
Won't the system command do it? On Fri, 04 Nov 2016 17:26:13 -0400, Jonathan H wrote:> > Seems I can write to an existing file, but is there really no way of > creating a new file to log some data to, without reverting to AGI? > (will be different for each caller ID) > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > Check out the new Asterisk community forum at: https://community.asterisk.org/ > > New to Asterisk? Start here: > https://wiki.asterisk.org/wiki/display/AST/Getting+Started > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users-- Your life is like a penny. You're going to lose it. The question is: How do you spend it? John Covici covici at ccs.covici.com
Jonathan H
2016-Nov-04 21:40 UTC
[asterisk-users] Any way of creating a file to write to from the dialplan, or must I use AGI?
Yes, that would also work (thanks!). It just seems a bit hacky - STAT...GotoIf... System..,Return...FILE.... Has there been any previous discussion as to why FILE can't/won't create a file and write to it in one shot? If so, what was the outcome? Should I suggest it? Thanks! On 4 November 2016 at 21:32, John Covici <covici at ccs.covici.com> wrote:> Won't the system command do it? > > On Fri, 04 Nov 2016 17:26:13 -0400, > Jonathan H wrote: >> >> Seems I can write to an existing file, but is there really no way of >> creating a new file to log some data to, without reverting to AGI? >> (will be different for each caller ID) >> >> -- >> _____________________________________________________________________ >> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >> >> Check out the new Asterisk community forum at: https://community.asterisk.org/ >> >> New to Asterisk? Start here: >> https://wiki.asterisk.org/wiki/display/AST/Getting+Started >> >> asterisk-users mailing list >> To UNSUBSCRIBE or update options visit: >> http://lists.digium.com/mailman/listinfo/asterisk-users > > -- > Your life is like a penny. You're going to lose it. The question is: > How do > you spend it? > > John Covici > covici at ccs.covici.com > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > Check out the new Asterisk community forum at: https://community.asterisk.org/ > > New to Asterisk? Start here: > https://wiki.asterisk.org/wiki/display/AST/Getting+Started > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users
John Kiniston
2016-Nov-04 21:50 UTC
[asterisk-users] Any way of creating a file to write to from the dialplan, or must I use AGI?
I'm able to use the FILE function to create files just fine. Set(FILE(${CALLFILE},,,al,u)=Extension: s) On Fri, Nov 4, 2016 at 2:26 PM, Jonathan H <lardconcepts at gmail.com> wrote:> Seems I can write to an existing file, but is there really no way of > creating a new file to log some data to, without reverting to AGI? > (will be different for each caller ID) > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > Check out the new Asterisk community forum at: https://community.asterisk. > org/ > > New to Asterisk? Start here: > https://wiki.asterisk.org/wiki/display/AST/Getting+Started > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >-- A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects. ---Heinlein -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20161104/faa0c8ca/attachment.html>
Jonathan H
2016-Nov-04 22:14 UTC
[asterisk-users] Any way of creating a file to write to from the dialplan, or must I use AGI?
That's just what I'm using, John. But I'm getting (eg) [Nov 4 21:46:16] ERROR[1676][C-00000003]: func_env.c:449 file2format: Cannot open '/home/logs/anonymous.txt': No such file or directory [Nov 4 21:46:16] ERROR[1676][C-00000003]: func_env.c:949 file_write: File '/home/logs/anonymous.txt' not in line format Asterisk is running as root (yeah, I know!), and has permissions on that directory. Hmmm.... On 4 November 2016 at 21:50, John Kiniston <johnkiniston at gmail.com> wrote:> I'm able to use the FILE function to create files just fine. > > Set(FILE(${CALLFILE},,,al,u)=Extension: s) > > On Fri, Nov 4, 2016 at 2:26 PM, Jonathan H <lardconcepts at gmail.com> wrote: >> >> Seems I can write to an existing file, but is there really no way of >> creating a new file to log some data to, without reverting to AGI? >> (will be different for each caller ID) >> >> -- >> _____________________________________________________________________ >> -- Bandwidth and Colocation Provided by http://www.api-digital.com -- >> >> Check out the new Asterisk community forum at: >> https://community.asterisk.org/ >> >> New to Asterisk? Start here: >> https://wiki.asterisk.org/wiki/display/AST/Getting+Started >> >> asterisk-users mailing list >> To UNSUBSCRIBE or update options visit: >> http://lists.digium.com/mailman/listinfo/asterisk-users > > > > > -- > A human being should be able to change a diaper, plan an invasion, butcher a > hog, conn a ship, design a building, write a sonnet, balance accounts, build > a wall, set a bone, comfort the dying, take orders, give orders, cooperate, > act alone, solve equations, analyze a new problem, pitch manure, program a > computer, cook a tasty meal, fight efficiently, die gallantly. > Specialization is for insects. > ---Heinlein > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > Check out the new Asterisk community forum at: > https://community.asterisk.org/ > > New to Asterisk? Start here: > https://wiki.asterisk.org/wiki/display/AST/Getting+Started > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users