Java Mailet for the James mail server that does email conversion to another text and/or to a SIP object.
Build from source
Use git to retrieve the sources. There is an issue with nginx certificates that needs a work around:
git -c http.sslVerify=false clone http://gitbucket.pitagoral.com/git/pablo/text2sip.git
git config http.sslVerify false
The Apache James java mail server gets an email to be processed as SIP data. The root processor in the mailetcontainer.xml file has an entry that detects the emails by matching whatever the user specifies from the emails (for example, the sender), and sends those to the text2sip processor as shown here:
<mailet match="RecipientIsemail@example.com" class="ToProcessor">
In the text2sip processor, there are some checks and conversions, like getting only text, and then, the Text2SipFeeder does the bulk job.
<!-- This processor converts text to sip and sends it to an asterix server -->
<processor state="text2sip" enableJmx="true">
<mailet match="All" class="OnlyText" />
<mailet match="RecipientIsfirstname.lastname@example.org" class="com.smartgart.mailet.Text2SipFeeder">
Text2SipFeeder extracts the textual payload from the email (from, to, date, subject, text and also a mapping from email-to (address) to SIP-to (number)) (TBC: where does it come from). Then, if OK, it feeds the new message to Asterisk's gateway interface.
It is also possible to do a text to SIP conversion in java. The generated SIP object would then be passed to Asterisk.