Tuesday, June 26, 2012

How to send attachment with unix 'mail' command

We can send attachment with the uuencode command as below:

uuencode file-to-be-attached  file-to-be-attached | mail -s "subject" send-to -- -r send-from

the 1st parameter to uuencode is the file to be attached while the 2nd parameter is the filename seen by the recipient.

In case uuencode command is not found on your system, you can get it as below:

yum install sharutils

Saturday, June 16, 2012

MOH not working in Asterisk 1.4.x

According to Asterisk documentation, we need to answer a channel before playing back or moh.

In 1.4.x, if you encounter problem where moh is not working even after answer, you might fix it as below:

exten => s, 1, Answer
exten => s, n, SetMusicOnHold(default)
exten => s, n, Playback(silence/1) ; play back something to trigger the audio flow
exten => s, n, Queue(myqueue)