Home > Uncategorized > kannel bSMS postgresql

kannel bSMS postgresql

select
r.msisdn,
t.mesg,
t.processed_time as ptime,
md5(‘[‘ || t.id || ‘][‘|| set_smsc_id(r.msisdn) ||’] : [+’ || r.msisdn || ‘]:[‘ || t.mesg || ‘]’) as ext_id,
case
when d.status is null then ‘Not delivered’
else ‘Delivered at ‘ || d.status_date
end as status_s
from
tasks t left join recipients r on
r.msisdn = any (t.task_msisdnss)
left outer join delivery_status d on
(d.status=1 and d.out_ext_sid=md5(‘[‘ || t.id || ‘][‘|| set_smsc_id(r.msisdn) ||’] : [+’ || r.msisdn || ‘]:[‘ || t.mesg || ‘]’))
where true
and t.id={$GLOBALS[_POST][id]}
;

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: