<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.faked.org/index.php?action=history&amp;feed=atom&amp;title=Asterisk%2FSMS</id>
	<title>Asterisk/SMS - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.faked.org/index.php?action=history&amp;feed=atom&amp;title=Asterisk%2FSMS"/>
	<link rel="alternate" type="text/html" href="https://wiki.faked.org/index.php?title=Asterisk/SMS&amp;action=history"/>
	<updated>2026-05-31T01:07:29Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.faked.org/index.php?title=Asterisk/SMS&amp;diff=90&amp;oldid=prev</id>
		<title>Jan: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://wiki.faked.org/index.php?title=Asterisk/SMS&amp;diff=90&amp;oldid=prev"/>
		<updated>2016-08-26T19:10:42Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 21:10, 26 August 2016&lt;/td&gt;
				&lt;/tr&gt;
&lt;!-- diff cache key mediawiki:diff::1.12:old-5:rev-90 --&gt;
&lt;/table&gt;</summary>
		<author><name>Jan</name></author>
	</entry>
	<entry>
		<id>https://wiki.faked.org/index.php?title=Asterisk/SMS&amp;diff=5&amp;oldid=prev</id>
		<title>Jan: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://wiki.faked.org/index.php?title=Asterisk/SMS&amp;diff=5&amp;oldid=prev"/>
		<updated>2016-08-26T19:09:40Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 21:09, 26 August 2016&lt;/td&gt;
				&lt;/tr&gt;
&lt;!-- diff cache key mediawiki:diff::1.12:old-4:rev-5 --&gt;
&lt;/table&gt;</summary>
		<author><name>Jan</name></author>
	</entry>
	<entry>
		<id>https://wiki.faked.org/index.php?title=Asterisk/SMS&amp;diff=4&amp;oldid=prev</id>
		<title>Jan: /* extensions.conf */</title>
		<link rel="alternate" type="text/html" href="https://wiki.faked.org/index.php?title=Asterisk/SMS&amp;diff=4&amp;oldid=prev"/>
		<updated>2011-01-27T17:39:25Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;extensions.conf&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:39, 27 January 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l36&quot;&gt;Line 36:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 36:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;; calls from ISDN&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;; calls from ISDN&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[from-capi]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[from-capi]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;exten =&amp;gt; 97886206&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;/01930100&lt;/del&gt;,&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;1&lt;/del&gt;,&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Goto&lt;/del&gt;(sms-mtrx,${EXTEN},1) &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;; SMS from T-COM SMSC to Asterisk&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;exten =&amp;gt; 97886206,&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;n&lt;/ins&gt;,&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;GotoIf&lt;/ins&gt;(&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;$[&quot;${CALLERID(num)}&quot; = &quot;01930100&quot;]?&lt;/ins&gt;sms-mtrx,${EXTEN},1) &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;     &lt;/ins&gt;; SMS from T-COM SMSC to Asterisk&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;; SMS / Mobile Terminated / Receive (T-Com SMSC -&amp;gt; Asterisk)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;; SMS / Mobile Terminated / Receive (T-Com SMSC -&amp;gt; Asterisk)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key mediawiki:diff::1.12:old-89:rev-4 --&gt;
&lt;/table&gt;</summary>
		<author><name>Jan</name></author>
	</entry>
	<entry>
		<id>https://wiki.faked.org/index.php?title=Asterisk/SMS&amp;diff=89&amp;oldid=prev</id>
		<title>Jan: /* Todo */</title>
		<link rel="alternate" type="text/html" href="https://wiki.faked.org/index.php?title=Asterisk/SMS&amp;diff=89&amp;oldid=prev"/>
		<updated>2011-01-14T17:24:03Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Todo&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=== Message Types ===&lt;br /&gt;
The key in understanding the message types is that Asterisk can act as an mobile phone &amp;#039;&amp;#039;and&amp;#039;&amp;#039; SMSC - depeding on who we&amp;#039;re talking to - while the other parties are always acting as only one role.&lt;br /&gt;
&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;MTRX:&amp;#039;&amp;#039;&amp;#039; Mobile Terminated, Received - the message was received from the T-Com SMSC by Asterisk (as a mobile phone)&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;MORX:&amp;#039;&amp;#039;&amp;#039; Mobile Originated, Received - the message was received by Asterisk (as a SMSC) from the SIP phone&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;MTTX:&amp;#039;&amp;#039;&amp;#039; Mobile Terminated, Transmit - the message will be send from Asterisk (as a SMSC) to the SIP phone&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;MOTX:&amp;#039;&amp;#039;&amp;#039; Mobile Originated, Transmit - the message will be send to the T-Com SMSC from Asterisk (as a mobile phone)&lt;br /&gt;
&lt;br /&gt;
=== Numbers used ===&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;100:&amp;#039;&amp;#039;&amp;#039; SIP phone extension&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;7670:&amp;#039;&amp;#039;&amp;#039; extension called by SIP phone (SMSC configured in SIP phone = 767)&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;97886206:&amp;#039;&amp;#039;&amp;#039; extension for landline in Asterisk&lt;br /&gt;
*&amp;#039;&amp;#039;&amp;#039;0193010:&amp;#039;&amp;#039;&amp;#039; T-Com SMSC for sending SMS via the landline&lt;br /&gt;
**0193010&amp;#039;&amp;#039;&amp;#039;0&amp;#039;&amp;#039;&amp;#039;: Caller ID sent by T-Com SMS to Asterisk&lt;br /&gt;
**0193010&amp;#039;&amp;#039;&amp;#039;1&amp;#039;&amp;#039;&amp;#039;: Caller ID sent by Asterisk to SIP phone, disguising as the T-Com SMSC&lt;br /&gt;
&lt;br /&gt;
=== extensions.conf ===&lt;br /&gt;
Your dialplan needs two new extensions:&lt;br /&gt;
&lt;br /&gt;
*The extension for handling incoming SMS from SIP phones has to be added to your &amp;#039;&amp;#039;&amp;#039;[default]&amp;#039;&amp;#039;&amp;#039; context.&lt;br /&gt;
*The extension for handling incoming SMS from the T-Com SMSC has to be added to the context which handles incoming calls on your landline, for me that is &amp;#039;&amp;#039;&amp;#039;[from-capi]&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Calls going to those extensions will be handed over to each respective context, where the SMS() Application deals with them - either acting as as mobile phone when receiving from the T-Com SMSC (message type =  MTRX), or as an SMSC when receiving from a SIP phone (message type = MORX).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You also need two new contexts (not four, as sending SMS is not handled in the dialplan, but by re-sending received SMS),&lt;br /&gt;
&lt;br /&gt;
* The context &amp;#039;&amp;#039;&amp;#039;[sms-mtrx]&amp;#039;&amp;#039;&amp;#039; answers the call from the T-Com SMSC as as mobile phone with &amp;#039;&amp;#039;SMS(&amp;lt;queuename&amp;gt;, a)&amp;#039;&amp;#039; and then calls an external script (sms-mttx.sh) to send the received SMS to a SIP phone. (MTRX -&amp;gt; MTTX)&lt;br /&gt;
* The context &amp;#039;&amp;#039;&amp;#039;[sms-morx]&amp;#039;&amp;#039;&amp;#039; answers the call from the SIP phone as a SMSC with &amp;#039;&amp;#039;SMS(&amp;lt;queuename&amp;gt;, sa)&amp;#039;&amp;#039; and then calls an external script (sms-motx.sh) to send the received SMS to the T-Com SMSC. (MORX -&amp;gt; MOTX)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
; internal calls&lt;br /&gt;
[default]&lt;br /&gt;
exten =&amp;gt; 7670,1,Goto(sms-morx,${EXTEN},1) ; SMS from SIP phone to Asterisk&lt;br /&gt;
&lt;br /&gt;
; calls from ISDN&lt;br /&gt;
[from-capi]&lt;br /&gt;
exten =&amp;gt; 97886206/01930100,1,Goto(sms-mtrx,${EXTEN},1)  ; SMS from T-COM SMSC to Asterisk&lt;br /&gt;
&lt;br /&gt;
; SMS / Mobile Terminated / Receive (T-Com SMSC -&amp;gt; Asterisk)&lt;br /&gt;
[sms-mtrx]&lt;br /&gt;
exten =&amp;gt; _X.,1,NoOp(Incoming SMS from T-Com SMSC)&lt;br /&gt;
exten =&amp;gt; _X.,n,Answer()&lt;br /&gt;
exten =&amp;gt; _X.,n,Wait(1)&lt;br /&gt;
exten =&amp;gt; _X.,n,SMS(${EXTEN},a)&lt;br /&gt;
exten =&amp;gt; _X.,n,System(/etc/asterisk/sms-mtrx.sh)        ; Forward to SIP phone&lt;br /&gt;
exten =&amp;gt; _X.,n,Wait(1)&lt;br /&gt;
exten =&amp;gt; _X.,n,Hangup()&lt;br /&gt;
&lt;br /&gt;
; SMS / Mobile Originated / Receive (SIP Phone -&amp;gt; Asterisk)&lt;br /&gt;
[sms-morx]&lt;br /&gt;
exten =&amp;gt; _X.,1,NoOp(Incoming SMS from ${CALLERID(num)})&lt;br /&gt;
exten =&amp;gt; _X.,n,Answer()&lt;br /&gt;
exten =&amp;gt; _X.,n,Wait(1)&lt;br /&gt;
exten =&amp;gt; _X.,n,SMS(${CALLERID(num)},sa)&lt;br /&gt;
exten =&amp;gt; _X.,n,System(/etc/asterisk/sms-morx.sh)        ; Forward to T-Com SMSC&lt;br /&gt;
exten =&amp;gt; _X.,n,Wait(1)&lt;br /&gt;
exten =&amp;gt; _X.,n,Hangup()&lt;br /&gt;
&lt;br /&gt;
; SMS / Mobile Terminated / Transmit (Asterisk -&amp;gt; SIP phone)&lt;br /&gt;
;[sms-mttx]&lt;br /&gt;
; resend messages from [sms-mtrx] via sms-mttx.sh&lt;br /&gt;
&lt;br /&gt;
; SMS / Mobile Originated / Transmit (Asterisk -&amp;gt; T-Com SMSC)&lt;br /&gt;
;[sms-motx]&lt;br /&gt;
; resend messages from [sms-morx] via sms-motx.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scripts ===&lt;br /&gt;
The scripts must be ran as the &amp;#039;&amp;#039;&amp;#039;asterisk&amp;#039;&amp;#039;&amp;#039; user, or the user your Asterisk runs as. In theory this shouldn&amp;#039;t matter, as only Asterisk will run them anyways. If you want to use the &amp;#039;&amp;#039;sms-*tx.sh&amp;#039;&amp;#039; scripts for sending SMS from something else, like for Nagios notifications or from a webinterface, don&amp;#039;t run them as any other user than &amp;#039;&amp;#039;&amp;#039;asterisk&amp;#039;&amp;#039;&amp;#039; - it will fsck up the permissions, and you&amp;#039;ll send an endless stream of SMS, which may be very expensive. Just sayin&amp;#039;...&lt;br /&gt;
==== sms-motx.sh ====&lt;br /&gt;
Send SMS via ISDN to T-Com SMSC. Needs 3 arguments: the sender&amp;#039;s number, the recipient&amp;#039;s number and the text.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
SRC=&amp;quot;${1}&amp;quot;&lt;br /&gt;
DST=&amp;quot;${2}&amp;quot;&lt;br /&gt;
MSG=&amp;quot;${3}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
CALLERID=&amp;quot;${SRC}&amp;quot;&lt;br /&gt;
CHANNEL=&amp;#039;CAPI/contr1/0193010&amp;#039;&lt;br /&gt;
&lt;br /&gt;
smsq --mo --tx \&lt;br /&gt;
  --motx-callerid=&amp;quot;${CALLERID}&amp;quot; \&lt;br /&gt;
  --motx-channel=&amp;quot;${CHANNEL}&amp;quot; \&lt;br /&gt;
  --da=&amp;quot;${DST}&amp;quot; \&lt;br /&gt;
  --ud=&amp;quot;${MSG}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== sms-mttx.sh ====&lt;br /&gt;
Send SMS to a SIP phone, disguised as T-Com SMSC. Needs 3 arguments: the sender&amp;#039;s number, the recipient&amp;#039;s number and the text. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
SRC=&amp;quot;${1}&amp;quot;&lt;br /&gt;
DST=&amp;quot;${2}&amp;quot;&lt;br /&gt;
MSG=&amp;quot;${3}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
CALLERID=&amp;#039;01930101&amp;#039;&lt;br /&gt;
CHANNEL=&amp;quot;SIP/${DST}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
smsq --mt --tx \&lt;br /&gt;
  --mttx-callerid=&amp;quot;${CALLERID}&amp;quot; \&lt;br /&gt;
  --mttx-channel=&amp;quot;${CHANNEL}&amp;quot; \&lt;br /&gt;
  --oa=&amp;quot;${SRC}&amp;quot; \&lt;br /&gt;
  --ud=&amp;quot;${MSG}&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== sms-mtrx.sh ====&lt;br /&gt;
Forward all SMS received from the T-Com SMSC to SIP phone 100. (uses sms-mttx.sh)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
SPOOL=&amp;#039;/var/spool/asterisk/sms/mtrx&amp;#039;&lt;br /&gt;
&lt;br /&gt;
for SMS in `ls -1 &amp;quot;$SPOOL&amp;quot;`; do&lt;br /&gt;
  SRC=`grep -e &amp;#039;^oa=&amp;#039; &amp;quot;$SPOOL/$SMS&amp;quot; | sed &amp;#039;s/oa=//&amp;#039;`&lt;br /&gt;
  MSG=`grep -e &amp;#039;^ud=&amp;#039; &amp;quot;$SPOOL/$SMS&amp;quot; | sed &amp;#039;s/ud=//&amp;#039;`&lt;br /&gt;
  /etc/asterisk/sms-mttx.sh &amp;quot;${SRC}&amp;quot; &amp;quot;100&amp;quot; &amp;quot;${MSG}&amp;quot;&lt;br /&gt;
  rm -f &amp;quot;$SPOOL/$SMS&amp;quot;&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== sms-morx.sh ====&lt;br /&gt;
Forward all SMS received from SIP phones to the T-Com SMSC. (uses sms-motx.sh)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
SPOOL=&amp;#039;/var/spool/asterisk/sms/morx&amp;#039;&lt;br /&gt;
&lt;br /&gt;
for SMS in `ls -1 &amp;quot;$SPOOL&amp;quot;`; do&lt;br /&gt;
  DST=`grep -e &amp;#039;^da=&amp;#039; &amp;quot;$SPOOL/$SMS&amp;quot; | sed &amp;#039;s/da=//&amp;#039;`&lt;br /&gt;
  MSG=`grep -e &amp;#039;^ud=&amp;#039; &amp;quot;$SPOOL/$SMS&amp;quot; | sed &amp;#039;s/ud=//&amp;#039;`&lt;br /&gt;
  /etc/asterisk/sms-motx.sh &amp;quot;97886206&amp;quot; &amp;quot;${DST}&amp;quot; &amp;quot;${MSG}&amp;quot;&lt;br /&gt;
  rm -f &amp;quot;$SPOOL/$SMS&amp;quot;&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Todo ===&lt;br /&gt;
*check for the Caller ID of the T-Com SMSC on all MSNs&lt;br /&gt;
*forward incoming SMS to different SIP extensions, based on the called MSN&lt;br /&gt;
*call T-Com SMSC from a different MSN, based on the SIP extension&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;extensions.conf&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[from-capi]&lt;br /&gt;
exten =&amp;gt; _X./01930100,1,Goto(sms-mtrx,${EXTEN},1)&lt;br /&gt;
&lt;br /&gt;
[sms-mtrx]&lt;br /&gt;
exten =&amp;gt; _X.,n,SMS(${EXTEN},a)&lt;br /&gt;
exten =&amp;gt; _X.,n,System(/etc/asterisk/sms-mtrx.sh &amp;quot;${EXTEN}&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
[sms-morx]&lt;br /&gt;
exten =&amp;gt; _X.,n,SMS(${CALLERID(num)},sa)&lt;br /&gt;
exten =&amp;gt; _X.,n,System(/etc/asterisk/sms-morx.sh &amp;quot;${CALLERID(num)}&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;sms.conf&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
MTRX[&amp;quot;97886206&amp;quot;]=&amp;quot;100&amp;quot;&lt;br /&gt;
MORX[&amp;quot;100&amp;quot;]=&amp;quot;97886206&amp;quot;&lt;br /&gt;
MORX[&amp;quot;101&amp;quot;]=&amp;quot;97886206&amp;quot;&lt;br /&gt;
MORX[&amp;quot;102&amp;quot;]=&amp;quot;97886206&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;sms-mtrx.sh&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
QUEUE=&amp;quot;${1}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
source &amp;quot;/etc/asterisk/sms.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
SPOOL=&amp;#039;/var/spool/asterisk/sms/mtrx&amp;#039;&lt;br /&gt;
&lt;br /&gt;
for SMS in `ls -1 &amp;quot;$SPOOL/{$QUEUE}.*&amp;quot;`; do&lt;br /&gt;
  SRC=`grep -e &amp;#039;^oa=&amp;#039; &amp;quot;$SPOOL/$SMS&amp;quot; | sed &amp;#039;s/oa=//&amp;#039;`&lt;br /&gt;
  MSG=`grep -e &amp;#039;^ud=&amp;#039; &amp;quot;$SPOOL/$SMS&amp;quot; | sed &amp;#039;s/ud=//&amp;#039;`&lt;br /&gt;
  /etc/asterisk/sms-mttx.sh &amp;quot;${SRC}&amp;quot; &amp;quot;$MTRX{${QUEUE}}&amp;quot; &amp;quot;${MSG}&amp;quot;&lt;br /&gt;
  rm -f &amp;quot;$SPOOL/$SMS&amp;quot;&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;sms-morx.sh&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
QUEUE=&amp;quot;${1}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
source &amp;quot;/etc/asterisk/sms.conf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
SPOOL=&amp;#039;/var/spool/asterisk/sms/morx&amp;#039;&lt;br /&gt;
&lt;br /&gt;
for SMS in `ls -1 &amp;quot;$SPOOL&amp;quot;`; do&lt;br /&gt;
  DST=`grep -e &amp;#039;^da=&amp;#039; &amp;quot;$SPOOL/$SMS&amp;quot; | sed &amp;#039;s/da=//&amp;#039;`&lt;br /&gt;
  MSG=`grep -e &amp;#039;^ud=&amp;#039; &amp;quot;$SPOOL/$SMS&amp;quot; | sed &amp;#039;s/ud=//&amp;#039;`&lt;br /&gt;
  /etc/asterisk/sms-motx.sh &amp;quot;${MORX[${QUEUE}]}&amp;quot; &amp;quot;${DST}&amp;quot; &amp;quot;${MSG}&amp;quot;&lt;br /&gt;
  rm -f &amp;quot;$SPOOL/$SMS&amp;quot;&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;sms-motx.sh&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
SRC=&amp;quot;${1}&amp;quot;&lt;br /&gt;
DST=&amp;quot;${2}&amp;quot;&lt;br /&gt;
MSG=&amp;quot;${3}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
CALLERID=&amp;quot;${SRC}&amp;quot;&lt;br /&gt;
CHANNEL=&amp;quot;CAPI/contr1/${CALLERID}:0193010&amp;quot;&lt;br /&gt;
&lt;br /&gt;
smsq --mo --tx \&lt;br /&gt;
  --motx-callerid=&amp;quot;${CALLERID}&amp;quot; \&lt;br /&gt;
  --motx-channel=&amp;quot;${CHANNEL}&amp;quot; \&lt;br /&gt;
  --da=&amp;quot;${DST}&amp;quot; \&lt;br /&gt;
  --ud=&amp;quot;${MSG}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jan</name></author>
	</entry>
</feed>