Re: [asterisk-users] Escape characters or replace function
Tilghman Lesher wrote: On Monday 12 May 2008 01:36:04 Daniel Grad wrote: I need to use the ${DATETIME} macro inside the filename saved by Record, but the colons (':') used in the time interfere with the command (everything after the colon is interpreted as the format I wish to save to): My command is: Record(/path/to/voicemail/${EXTEN}-${DATETIME}-${UNIQUEID}:wav) I need some function to escape the colons inside DATETIME... I'm sure it's something really basic, but I couldn't find it Use ${STRFTIME()} instead to get the format that you want and do not include colons in the format. "core show function STRFTIME" should give you the details on this dialplan function. Found STRFTIME just after I posted the message. I tried ${STRFTIME(${EPOCH}, %d%m%Y-%H\:%M\:%S)} but it returned an empty string (I wanted to get the same output as DATETIME but with escaped colons. What would have been the correct syntax? I finally used just ${EPOCH} instead, but I'm curious how I could have escaped the colons. smime.p7s Description: S/MIME Cryptographic Signature ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[asterisk-users] Escape characters or replace function
Hello, I need to use the ${DATETIME} macro inside the filename saved by Record, but the colons (':') used in the time interfere with the command (everything after the colon is interpreted as the format I wish to save to): My command is: Record(/path/to/voicemail/${EXTEN}-${DATETIME}-${UNIQUEID}:wav) I need some function to escape the colons inside DATETIME... I'm sure it's something really basic, but I couldn't find it Daniel smime.p7s Description: S/MIME Cryptographic Signature ___ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Re: [Asterisk-Users] FAX and AGI
Florian Overkamp wrote: Hi, Daniel Grad wrote: I am writing a script (php script that runs via fastAGI) that takes incoming calls and processes them in various ways depending on settings from a database. At some point, I need the script to receive an incoming fax. But the problem is that if I run NVFaxDetect from the script, then asterisk crashes. If I run rxFax without NVFaxDetect, then I get errors when sending the fax. What can I do? How can I receive a fax with a PHP fastAGI script? You could use a goto to exit the AGI script first and jump to a fax reception context/extension. Florian OK. I use a goto in the script, then exit the script. But, I get an error when sending the fax I finally brought down the problem to setting a variable before calling NVFaxDetect. So, if I have this in my dialplan: [incoming] ... exten => 0800888,1,Setvar(FAXFILE=/var/spool/asterisk/fax/${UNIQUEID}.tif) exten => 0800888,2,Goto(fax,2201,1) ... [fax] exten => 2201,1,NVFaxDetect() exten => 2201,2,Hangup exten => fax,1,RxFax(${FAXFILE}.tif) ... Then I get an error when sending the fax. Here is the fax log: ... efax: 14:34 remote has no document(s) to send, and can receive efax: 14:34 local 196lpi 14.4kbps 8.5"/215mm any 1D- - 0ms efax: 14:34 remote 196lpi 9600bps 8.5"/215mm 11"/A4 2D- - 0ms efax: 14:34 session 196lpi 9600bps 8.5"/215mm any 1D- - 0ms efax: 14:34 sent TSI - caller ID efax: 14:36 sent DCS - session format efax: 14:38 sent TCF - channel check of 1800 bytes efax: 14:39 received DCN - disconnect efax: 14:39 Error: invalid response to DCS (0x5f) efax: 14:40 sent DCN - disconnect efax: 14:41 failed -> /tmp/kde-root/kdeprintfax_VK9nvHmo.001 efax: 14:43 done, returning 3 (invalid modem response) If I skip the Setvar part in the dialplan, everything works fine: [incoming] ... exten => 0800888,1,Goto(fax,2201,1) ... [fax] exten => 2201,1,NVFaxDetect() exten => 2201,2,Hangup exten => fax,1,RxFax(/var/spool/asterisk/fax/${UNIQUEID}.tif) ... Any ideas? begin:vcard fn:Daniel Grad n:Grad;Daniel org:Think Digital adr:;;;Bucharest;;;Romania email;internet:[EMAIL PROTECTED] tel;cell:+40724891882 note;quoted-printable:YM: [EMAIL PROTECTED] MSN: [EMAIL PROTECTED] ICQ: 219628263=0D=0A= AIM: lunarul url:http://www.online-business.ro version:2.1 end:vcard ___ --Bandwidth and Colocation sponsored by Easynews.com -- Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[Asterisk-Users] FAX and AGI
Hello, I am writing a script (php script that runs via fastAGI) that takes incoming calls and processes them in various ways depending on settings from a database. At some point, I need the script to receive an incoming fax. But the problem is that if I run NVFaxDetect from the script, then asterisk crashes. If I run rxFax without NVFaxDetect, then I get errors when sending the fax. What can I do? How can I receive a fax with a PHP fastAGI script? begin:vcard fn:Daniel Grad n:Grad;Daniel org:Think Digital adr:;;;Bucharest;;;Romania email;internet:[EMAIL PROTECTED] tel;cell:+40724891882 note;quoted-printable:YM: [EMAIL PROTECTED] MSN: [EMAIL PROTECTED] ICQ: 219628263=0D=0A= AIM: lunarul url:http://www.online-business.ro version:2.1 end:vcard ___ --Bandwidth and Colocation sponsored by Easynews.com -- Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
[Asterisk-Users] fax codec problem
Hello, I have the following problem when I send fax to asterisk: -- Executing RxFAX("IAX2/[EMAIL PROTECTED]:4569/2", "/var/spool/asterisk/fax/_1125039307.1.tif") in new stack 2005-08-26 06:55:09 NOTICE[30852]: channel.c:1317 ast_read: Dropping incompatible voice frame on IAX2/[EMAIL PROTECTED]:4569/2 of format slin since our native format has changed to gsm Reading around, I understood that I would have to add `allow=slin' to iax.conf, but this hasn't changed anything. The dis/allow part of my iax.conf is: [general] ... disallow=all allow=gsm allow=slin ... [1002] ... disallow=all allow=gsm allow=slin ... But this didn't change anything. Then, I was told that I should comment the `allow=gms' line. But this made things worse. Now, when I dial asterisk I get the following error: 2005-08-26 07:50:44 NOTICE[31232]: chan_iax2.c:5783 socket_read: Rejected connect attempt from 213.210.63.73, requested/capability 0x8/0xff0f incompatible with our capability 0xf840. I don't know much of how codecs work or how to configure asterisk, so please help Thank You, Daniel begin:vcard fn:Daniel Grad n:Grad;Daniel org:Think Digital adr:;;;Bucharest;;;Romania email;internet:[EMAIL PROTECTED] tel;cell:+40724891882 note;quoted-printable:YM: [EMAIL PROTECTED] MSN: [EMAIL PROTECTED] ICQ: 219628263=0D=0A= AIM: lunarul url:http://www.online-business.ro version:2.1 end:vcard ___ --Bandwidth and Colocation sponsored by Easynews.com -- Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users