Re: [asterisk-users] Any way of creating a file to write to from the dialplan, or must I use AGI?
Ugh. Thanks, John. I took another look at your example, and saw that you had a ,u at the end. So, even though that supposedly only specifies the line format, it also seems to act as "create if not exist". Problem solved - thanks! I'll add that to my ever lengthening list of Asterisk tips/gotchas! On 4 November 2016 at 23:02, John Kinistonwrote: > Could it be SELinux blocking you? > > If you change the path to /tmp does it work? > > > On Fri, Nov 4, 2016 at 3:14 PM, Jonathan H wrote: >> >> That's just what I'm using, John. >> >> But I'm getting (eg) >> >> [Nov 4 21:46:16] ERROR[1676][C-0003]: func_env.c:449 file2format: >> Cannot open '/home/logs/anonymous.txt': No such file or directory >> [Nov 4 21:46:16] ERROR[1676][C-0003]: 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 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 >> > 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 >> >> -- >> _ >> -- 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 -- _ -- 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
Re: [asterisk-users] Any way of creating a file to write to from the dialplan, or must I use AGI?
Could it be SELinux blocking you? If you change the path to /tmp does it work? On Fri, Nov 4, 2016 at 3:14 PM, Jonathan Hwrote: > That's just what I'm using, John. > > But I'm getting (eg) > > [Nov 4 21:46:16] ERROR[1676][C-0003]: func_env.c:449 file2format: > Cannot open '/home/logs/anonymous.txt': No such file or directory > [Nov 4 21:46:16] ERROR[1676][C-0003]: 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 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 > 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 > > -- > _ > -- 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
Re: [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-0003]: func_env.c:449 file2format: Cannot open '/home/logs/anonymous.txt': No such file or directory [Nov 4 21:46:16] ERROR[1676][C-0003]: 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 Kinistonwrote: > 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 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 -- _ -- 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
Re: [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 Hwrote: > 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
Re: [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 Coviciwrote: > 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 > cov...@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 -- _ -- 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
Re: [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 cov...@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
[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) -- _ -- 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