Erick Perez
2009-Feb-12 21:34 UTC
[CentOS] OT: Suggestions for connecting a postfix to an sms box
Hi there, I would like to hear some hardware recomendations to connect our smtp server (postfix) to an external SMS box. Basically I am looking for a SMS box that takes messages via smtp and sends them via the SMS part. Has anyone here implemented a solution like this? I must use an in house sms box (GSM), I cannot use a service provider (such as internet smtp to sms providers). thanks, -- ------------------------------------------------------------ Erick Perez Cel +(507) 6675-5083 ------------------------------------------------------------
Rainer Duffner
2009-Feb-12 22:52 UTC
[CentOS] OT: Suggestions for connecting a postfix to an sms box
Am 12.02.2009 um 22:34 schrieb Erick Perez:> Hi there, > I would like to hear some hardware recomendations to connect our smtp > server (postfix) to an external SMS box. > Basically I am looking for a SMS box that takes messages via smtp and > sends them via the SMS part. > Has anyone here implemented a solution like this? > I must use an in house sms box (GSM), I cannot use a service provider > (such as internet smtp to sms providers). >I think we (well, my co-worker) built such a thing here (with kannel). It will directly talk to the SMS-center at the carrier. If you can buy them, I suspect that they are very pricey. ;-) Also, you will of course also need a large-account at your carrier, which will also cost a certain fee. Rainer
Lanny Marcus
2009-Feb-12 23:11 UTC
[CentOS] OT: Suggestions for connecting a postfix to an sms box
On Thu, Feb 12, 2009 at 4:34 PM, Erick Perez <eaperezh at gmail.com> wrote:> I would like to hear some hardware recomendations to connect our smtp > server (postfix) to an external SMS box. > Basically I am looking for a SMS box that takes messages via smtp and > sends them via the SMS part. > Has anyone here implemented a solution like this? > I must use an in house sms box (GSM), I cannot use a service provider > (such as internet smtp to sms providers).One of our neighbors down the street is an Electronic Engineer for one of the Colombian cell phone operators. They began converting from CDMA to GSM several years ago. If you end up needing a Consultant, for any GSM stuff you are involved with, contact me off list and I will put you in touch with him. Cali is one hour from Panama City, on COPA, etc.
>> # Put Perl in "paragraph mode" > $/ = ''''; > > # For each record ...I love this list! Paragraph mode REALLY cleans things up. Although it worked, this makes my first attempt look really amateurish. Be sure to put the definition of $/ inside a code block { } if you are using it inside a program or it will cause difficulties in other areas since it is defined in main and therefore used everywhere. #! /usr/bin/perl -w use strict; # use this like ./p2 < in.txt > out.txt # or cat file | ./p2 > out.txt { local $/ = ''''; # turn on paragraph mode while (<>) { if (/localhost/) { $_ =~ s/\/\*//; $_ =~ s/\*\///; } print "$_\n"; } } __________________________________________________ Correo Yahoo! Espacio para todos tus mensajes, antivirus y antispam ?gratis! Reg?strate ya - http://correo.yahoo.com.mx/
Dave, Thanks a lot. --Robinson --- On Fri, 2/13/09, Dave Cross <davorg at gmail.com> wrote:> From: Dave Cross <davorg at gmail.com> > Subject: Re: [CentOS] text processing problem with bash/perl > To: "CentOS mailing list" <centos at centos.org> > Date: Friday, February 13, 2009, 5:50 AM > 2009/2/13 Robinson Tiemuqinke <hahaha_30k at yahoo.com>: > > Hi, > > > > Anyone has some ways for the following text processing > problem? I have a text file > > containing two stanzas attached below. I want to > uncomment the stanza with > > ''host=localhost'' line, while left the other > stanza unchanged. > > > > ... > > > > /* udp_send_channel { > > host=localhost > > port = 10017 > > ttl = 1 > > } */ > > > > /* udp_send_channel { > > host=ganglia100.ec2.example.com > > port = 10017 > > ttl = 1 > > } */ > > It''s pretty simple in Perl. Something like this will > work. > > #!/usr/bin/perl > use strict; > use warnings; > > # Put Perl in "paragraph mode" > $/ = ''''; > > # For each record ... > while (<>) { > # ... if the record is for localhost ... > if (/host=localhost/) { > # ... remove the opening comment ... > s|/\*\s*||; > # ... remove the closing comment ... > s|\s*\*/||; > } > > # ... and print the record. > print; > } > > It''s written as a Unix filter, so it reads from STDIN > and writes to > STDOUT. Call it like this: > > $ my_filter < input.txt > output.txt > > > hth, > > Dave... > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos
Dennis Kaptain <dkaptain at yahoo.com.mx> wrote:>> > >> > Hi, >> > >> > Anyone has some ways for the following text processing problem? I have a text >> > file containing two stanzas attached below. I want to uncomment the stanza with >> > ''host=localhost'' line, while left the other stanza unchanged. >> > >> > ... >> > >> > /* udp_send_channel { >> > host=localhost >> > port = 10017 >> > ttl = 1 >> > } */ >> > >> > /* udp_send_channel { >> > host=ganglia100.ec2.example.com >> > port = 10017 >> > ttl = 1 >> > } */ >> > >> > ... >> > >> > If I use command below then both stanza will be altered... Please help. >> > >> > sed -i -e ''/^\/\* udp_send_channel/, /} \*\// {s/^\/\* >> > udp_send_channel/udp_send_channel/g; s/\} \*\//}/g; }'' >> > >> > --David >> > >> > > this is probably WAY more than you wanted<SNIP> A tad simpler: #! /usr/bin/perl -w use strict; my $file; open FILE, "stuff.txt" or die; # Undefine the input record separator. undef $/; # Slurp the whole file in $file = <FILE>; close FILE; # Pattern match on the stanza we want to uncomment and uncomment it. You may need to play with # the white space in the output to get the formatting you want. $file =~ s?/*\s*udp_send_channel {\n\s*host=localhost\n\s*port = 10017\n\s*ttl = 1\n\s*} */\n?udp_send_channel {\n host=localhost\n port = 10017\n ttl = 1\n}?; # Write the result. print $file; #~~~~~~~~~~~~~~~~~End of Script~~~~~~~~~~~~~~ Cheers, Dave -- Politics, n. Strife of interests masquerading as a contest of principles. -- Ambrose Bierce