Académique Documents
Professionnel Documents
Culture Documents
WITH RUBY
Vaggelis Typaldos - @vtypal
ASYNCHRONOUS
OVERVIEW
SMS
Short Message Service
SMS PROS
Sms is easy Sms is available to everybody Sms is a high revenue communication channel
SMS CONS
Sms is short (plain text of 160 chars max.) Send sms is not cost free Sms black hours Legal conditions
SMSC
Short Message Service Center
Send and receive SMS & DLRs Check msisdn to HLR database Assign a short code (4-digit) number to our bind Set throughput (sms rate) SMSC talks to (ESME) clients via SMPP protocol
Peer to peer over tcp protocol between ESME (external short messaging entities) clients and SMSC for sending/receiving SMS messages. Each tcp packet is called PDU (Protocol Data Unit) bind_sm/bind_sm_resp enquire_link/enquire_link_resp submit_sm/submit_sm_resp deliver_sm/deliver_sm_resp
KANNEL.CONF (BEARERBOX)
gop=cr ru oe amnpr =100 di-ot 30 sso-ot=101 mbxpr 30 amnpswr =br di-asod a soelcto ="apgtwy150lg/anlsoe tr-oain /p/aea-../oskne.tr" #SS SP MC MP gop=ss ru mc ss =sp mc mp ss-d="mc mci ss" hs =1.01.0 ot 01.01 pr =90 ot 00 sse-ye=EM ytmtp SE ss-srae="22 mcuenm 22" ss-asod="22as mcpswr 22ps" tasevrmd =tu rncie-oe re suc-drtn=0 oread-o suc-drni=1 oread-p itraevrin=3 nefc-eso 4 ds-drtn=1 etad-o ds-drni=5 etad-p mxpnigsbis=5 a-edn-umt 0 truhu =5 hogpt 0 #odrtu n-l=re
KANNEL.CONF (SMSBOX)
gop=sso ru mbx baebxhs =lclot erro-ot oahs snsspr =106 edm-ot 30 m-eoe=tu orcd re ht-eus-er =3 tprqetrty #SN-M UES EDSS SR gop=snssue ru edm-sr uenm =tse srae etr pswr =foa asod obr #SRIE EVCS gop=sssrie ru m-evc #a-esgs=1 mxmsae 0 gtul= ht:/psre:00mapm?rm%&o%&et%&cd% e-r tp/apevr80/yp/ofo=pt=Ptx=ako=c &ca=Css=itm=t khr%&mc%&ie% acpe-mc=ss cetdss mc
RECEIVING MO
Mobile Originated
casMAp ls yp dfm e o i rqetgt f eus.e? @aasrqetprm prm=eus.aas rtr % eun | ====== M rcie a # @aas'ie]}====== ====== O eevd t { prm[tm' ====== Fo: # @aas'rm]} rm { prm[fo' T; o # @aas'o]} { prm[t' Ss:# @aas'mc]} mc { prm[ss' Msae # @aas'et]} esg: { prm[tx' ================= ================= | ed n ed n ed n
SENDING MT
Mobile Terminated
Try it using your browser (will work) In your ruby code you must url encode the text
URI.ENCODE_WWW_FORM_COMPONENT(TEXT)
Ahn+uyMeu+2Ahn.b2+sagopo+2ntjs%9ges tesRb+etp%8tesr%9i++ru+f%8o+ut2+ek+ wolv+uy%8mn+te+hns2%An+ h+oeRb+2aogohrtig%90ad me+eual+nAhn+nodrt+ics+ etrglryi+tesi+re+odsus adpeeto+l+hnsRb..adhv+ n+rsn+naltig+uy.+n+ae bes2oz%C0tior+swl+sohr er%Cuo2%Aspuoa+ela+te+ achlc%8n+oeie+o-looi%9bvrgs looi+2adsmtmsnnachlc2+eeae.
MT example
rqie'r' eur ui rqie'e/tp eur ntht' ui=UIpre'tp/ssaea:30/g-i/edm', r R.as(ht:/mgtwy106cibnsnss) prm ={:o= "091357,:rm= "24, aas t > 364246" fo > 13" :srae>tse" :asod>foa" uenm="etr, pswr="obr, :et>Ahn Rb Meu (tesr)i agopo tx="tes uy etp Ahn.b s ru f (o js)geswolv Rb (mn ohrtig)ad nt ut ek h oe uy aog te hns n me rglryi Ahn i odrt dsusadpeet et eual n tes n re o ics n rsn o altig Rb.. adhv besoz, n l hns uy.. n ae er,uo tior a wl a ohrachlc(n smtms spuo s el s te looi ad oeie nnachlc bvrgs" ec} o-looi) eeae., t #Adprm t UI d aas o R uiqey=UIecd_w_om prm ) r.ur R.noewwfr( aas pt Nt:TPgtui us e:HT.e(r)
ht:/mgtwy106cibnsnsst=0091357fo=24uenm= tp/ssaea:30/g-i/edm?o3364246&rm13&sraet etrpswr=obr se&asodfoa &etAhn+uyMeu+2Ahn.b2+sagopo+2ntjs%9ges tx=tesRb+etp%8tesr%9i++ru+f%8o+ut2+ek+ wolv+uy%8mn+te+hns2%An+ h+oeRb+2aogohrtig%90ad me+eual+nAhn+nodrt+ics+ etrglryi+tesi+re+odsus adpeeto+l+hnsRb..adhv+ n+rsn+naltig+uy.+n+ae bes2oz%C0tior+swl+sohr er%Cuo2%Aspuoa+ela+te+ achlc%8n+oeie+o-looi%9bvrgs looi+2adsmtmsnnachlc2+eeae. &mcss&oig0castUF8atds0 ss=mccdn=&hre=T-&l-c=& drulht%A2%Fmgtwy380%Fyp%Fl%FsI%D28212tp l-r=tp3%F2ssaea%A002map2dr3mgd32163%6ye %D2&l-ak3 3%5drms=
RECEIVING DLR
casMAp ls yp .. . dfdr e l i rqetgt f eus.e? @aasrqetprm prm=eus.aas rtr % eun | ====== DRrcie ====== ====== L eevd ====== MsaeI: # @aas'sI' } esg d: { prm[mgd] Dlvr tp: eiey ye # @aas'ye]} { prm[tp' ================= ================= | ed n ed n ed n
MESSAGE BROKER
provides clients with connectivity, and message storage/delivery functions Queue: Destination that contains messages sent from a producer that await delivery to one consumer Destination: queues or topics
CLIENT TYPES
Producers (create messages and send or publish them to the broker for delivery to a specified destination) Consumers (retrieve messages from a destination)
STOMP
Streaming Text Oriented Messaging Protocol (STOMP)
In activemq.xml configuration file replace the default wire protocol used by native Java Message Broker clients with stomp transport connector that supports clients written in languages such as Ruby, Perl, Python, and PHP.
tasotonco nm=oewr"ui"c:/oahs rnprCnetr ae"pnie r=tp/lclo t666 :11" tasotonco nm=sop ui"tm:/oahs rnprCnetr ae"tm" r=sop/lclot :11" 666
PRODUCER-PUBLISHER
#raeteqee(fde nteit Cet h uu i os o xs) #adpplt teqeewt msae n ouae h uu ih esgs rqie'tm' eur sop cin =Sop:letoe "tm:/oahs:11" let tm:Cin.pn sop/lclot666 1ut(0 d .po5) o cin.uls(/uu/b" Tm.o.tfie"H%-s) {:esset= letpbih"qeerq, ienwsrtm(%-M%", pritn >tu } re ) #cin.uls(/oi/ht,"el Rbse!,{:esset= tu } letpbih"tpcca" Hlo uyts" pritn > re ) sep2 le ed n cin.ls letcoe
CONSUMER-SUBSCRIBER
rqie'tm' eur sop cin =Sop:letoe "tm:/oahs:11" let tm:Cin.pn sop/lclot666 cin.usrb "qeerq d |esg| letsbcie /uu/b" o msae pt "eevd #msaebd}o #msaehaes'etnto'} us rcie: {esg.oy n {esg.edr[dsiain]" ed n cin.on letji cin.ls letcoe
ACTIMEMQ ADMIN UI
THE END
BY VTYPAL