More on Asterisk (Evolution)

I wanted to change the email message that’s sent out when someone leaves a voicemail. The easy way would be to modify /etc/asterisk/voicemail.conf, adding the following to the “[general]” section: emailbody=New voicemail message received\n\nDuration: ${VM_DUR}\nTime: ${VM_DATE}\nSender: ${VM_CALLERID}\n\n\t\t\t\t–Asterisk\n

Of course, on Evolution the system reads from the database (though there’s a way to change that, I didn’t want to mess it up so I left it in the database) and not from the conf files, so that didn’t work.

Instead I had to use this SQL:

insert into ast_config set
id=“131259”,
cat_metric=“14”,
var_metric=“15”,
commented=“0”,
filename=“voicemail.conf”,
category=“general”,
var_name=“emailbody”,
var_value=“New voicemail message received\n\nDuration: ${VM_DUR}\nTime: ${VM_DATE}\nSender: ${VM_CALLERID}\n\n\t\t\t\t–Asterisk\n”
);

Breaking it down:

  • 131259 is max(id) (key for ast_config table) + 1.
  • 14 is the cat_metric — not actually sure what that is, but it matches other “general” categories.
  • 15 is the sequence number of entries in the “general” category of the “voicemail.conf” filename — max(local set of var_metric)+1.
  • 0 — I have no idea, but I didn’t have a comment.
  • voicemail.conf is the filename where the information would normally reside.
  • general is the section of that file where the information would normally reside.
  • emailbody is the variable, and that mess of stuff in var_value is the message.

So it’s not really that complicated, and it’s actually pretty intuitive, once you figure out what is going on and where you are.