Skip to main content

Example Email Conference Control


by excelsio 2010.04.20 (ancient)

Currently we have a nice script Examples_JavaScript_Conference_IVR for setting up a publicly available conferencing system.

Unfortunatelay I haven´t seen any possibility for my users to create their own conferences. In the following I´ll show some hints for setting up a kind of basic email based remote control for the IVR based conference mentioned above. Users from your given domain will write an email with subject ADD and a body consisting of the triplet: conf_room mod_password conf_name This will finally add an entry to your MySQL database.

Click here to expand Table of Contents


ADDing a conference room entry


  • no checking whether there´s already a conference room with the given number. So the entries in you database will be overwritten by the next email with the same conf_room name
  • no EDIT of conference rooms
  • no DELETE of conference rooms

Email Example

If you want to set up a conference room with number 10000, moderator password of 123456 and name Conference, your users will have to write an email with:

Subject: ADD
Body: 10000 123456 Conference

Procmail Configuration

Everything that comes from my mail server, having an email address ending within and subject ADD will be parsed to the insert script which will itself make some modifications on the database called freeswitch. Look at the "b" of :0b*. This will forward only the body of the email. The rest, i.e. :0: will be thrown away. This will be your .procmail.rc


* ^Received:.*
* ^From:.*
* ^To:
* ^Subject: ADD
|/usr/src/insert | mysql -uYOUR_DB_USER -pYOURPASSWORD freeswitch


Insert script

This is written with the help of awk.

#!/bin/awk -f

FS=" "
if (length($0) == 0) next

if (NF != 3) {
print "error line: "NR

do {
printf ("insert into freeswitch.conferences (conf_room, mod_password, conf_name) VALUES (" $1 ", " $2 ", " $3 ")\n");
} while (true)

Fetchmail configuration

This will download the emails with POP3 protocol from your provider. So this will be your .fetchmail.rc Change owner from .fetchmailrc with chown fetchmail ./fetchmailrc

poll with proto POP3
user "" there with password "YOURPASSWORD is "YOURLOCALUSERWITHTHE.configFILES" here
mda "/usr/bin/procmail -d %s"


Finally crontab will automatically run fetchmail every minute:

0-59/1 * * * * /usr/bin/fetchmail -av