我有一个星号扩展,它在一个非常长的行上运行。其中一部分是电子邮件的正文,其中包含几个换行符。如何才能在不弄乱电子邮件的情况下将扩展名分解为多行(为了可读性)?
same => n,System(echo -e "Asterisk call. \n Duration: ${CDR(billsec)} seconds.\n Caller ID ${CDR(clid)} \n Source ${CDR(src)} \n Destination ${CDR(dst)} \n Destination context ${CDR(dcontext)} \n Channel name ${CDR(channel)} \n Destination channel ${CDR(dstchannel)} \n Last app executed ${CDR(lastapp)} \n Last app's arguments ${CDR(lastdata)} \n Time the call started. ${CDR(start)} \n Time the call was answered. ${CDR(answer)} \n Time the call ended. ${CDR(end)} \n Duration of the call. ${CDR(duration)} \n Duration of the call once it was answered. ${CDR(billsec)} \n ANSWERED, NO ANSWER, BUSY ${CDR(disposition)} \n DOCUMENTATION, BILL, IGNORE etc ${CDR(amaflags)} \n The channel's account code. ${CDR(accountcode)} " | mail -s '${RESULTREV} (${CALLERID(num)}) called on ${STRFTIME(${EPOCH},,%A %d.%m.%Y at %H:%M:%S)}' aag@aag.com)
发布于 2016-06-08 02:23:02
创建一个接受各种${CDR}变量的外壳脚本,并使用它生成消息体并启动mail。这样,您就不需要在拨号方案中维护邮件正文。
发布于 2016-06-11 02:55:43
您可以使用quote和doublequote。
http://www.voip-info.org/wiki/view/Asterisk+Expressions
但是,您应该记住,如果字符串长度超过255个字符,星号将忽略任何信息。
https://stackoverflow.com/questions/37685108
复制相似问题