Re: GSM_SMS

From: Date: Wed, 08 Aug 2001 21:45:01 +0000
Subject: Re: GSM_SMS
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-1324@lists.php.net to get a copy of this message
[Mika Tuupola <tuupola@appelsiini.net>] > > Earlier I mentioned about pearifying some PHP classes I have made > for converting and sending operator logos, ringintones, textmessages > etc. via kannel. > > I think the code for converting and sending the messages should be > separated and atleast the latter abstracted for different > bearers. The bearer code should allways have just one send() method > which works with both binary and ascii messages without giving any > other parameters than the message itself. The send method is > different with every bearer because atleast binary messages are > handled very different ways between the bearers. This might cause > some bloating in the bearer code since it has to figure out what it > is sending, but it will result as a simpler API. > > Below is some thoughs about the structure and usage (the original > code was written before I found PEAR so it must be > restructured). Comments and ideas are welcome. > > > SmartMessaging/ > > or > > GSM_SMS/ > > or > > GSM/ > SMS.php > SMS/ > OTA.php > OTA/ > Bitmap.php > Icon.php > OperatorLogo.php > RingingTone.php > ... > Bearer.php > Bearer/ > Kannel.php > SoneraCGW.php > ... It seems you have enough stuff here to make a pretty complete GSM package, so I think "GSM" is a better package name than "GSM_SMS". I'm not up to date on the GSM terminology; OTA, is that only for WAP configuration through SMS, or is that the entire standard for sending special messages through "ports"? What did you intend to put into each of those Bearer/xxx.php files? Just a configuration for each provider? When sending operator logos, you need to embed the country and operator number, would these be defined here? > Usage would be something like (dsn would be nice way to pass > parameters to constructor even though it isn't a "data" source): > > $sms = new GSM_SMS("kannel://foo:bar@sms.example.com:1313/cgi-bin/sendsms"); > > $message = new GSM_SMS_OTA_OperatorLogo("/tmp/file.gif"); > $message2 = "This is a test message." > $number = "+358501234567"; > > if PEAR::isError($sms->send($message,$number)) { > print "ERROR!"; > } > if PEAR::isError($sms->send($message2,$number)) { > print "ERROR!"; > } Good stuff, I look forward to seeing it. - Stig -- Stig Sæther Bakken <ssb@alltheweb.com> Fast Search & Transfer ASA, Trondheim, Norway

« previous php.pear.dev (#1324) next »