Hello Siek,

On trying to compile I get this error,

sqlbox.c:93:2: error: #error MYSQL or Postgres SQL support needed for SQLBOX


What could be the problem???

Regards
Peter

-----Original Message-----
From: seik [mailto:[EMAIL PROTECTED] 
Sent: Monday, November 26, 2007 5:34 PM
To: Otandeka Simon Peter
Cc: [email protected]
Subject: Re: External dlr storage

use sqlbox and postgresql
and foreach SMS set unique smsID in a view to track it

the DLR table will be of no use for MT billing
instead, use table like this one
the bellow table is filled out by unique dlr-url you have to set for each MT
sms

CREATE TABLE delivery_status
(
  delivery_status_sid bigserial NOT NULL,
  msisdn bigint NOT NULL,
  shortcode character varying NOT NULL DEFAULT 255,
  answer text,
  out_ext_sid character varying(60) NOT NULL,
  status smallint NOT NULL,
  status_date timestamp without time zone NOT NULL,
  intime timestamp without time zone NOT NULL DEFAULT now(),
  kannel_id text,
  CONSTRAINT delivery_status_sid_pkey PRIMARY KEY (delivery_status_sid)
)
WITHOUT OIDS;
ALTER TABLE delivery_status OWNER TO seik;


out_ext_sid here is the unique smsID you should set to each MT SMS

the RULE:

CREATE OR REPLACE RULE update_paid_status AS
    ON INSERT TO delivery_status
   WHERE new.status = 1 DO  UPDATE sms_in SET paid = true, payment_time =
now()
  WHERE true AND sms_in.ext_id::text = new.out_ext_sid::text;

the sms_in table i use for clients, aside the sent_sms and send_sms

CREATE TABLE sms_in
(
  sql_id serial NOT NULL,
  msisdn bigint NOT NULL,
  shortcode bigint NOT NULL DEFAULT 0,
  sms text,
  dcs smallint,
  udhdata bytea,
  coding smallint,
  mwi smallint,
  charset character varying(255),
  otime timestamp without time zone,
  intime timestamp without time zone DEFAULT now(),
  sms1251 text,
  operator_id smallint NOT NULL DEFAULT 0,
  smsc_id character varying(255),
  kannel_id character varying(255),
  ext_id character varying(255),
  binsms bytea,
  processed smallint NOT NULL DEFAULT 0,
  ptime timestamp without time zone,
  retry bigint DEFAULT 0,
  backresponce character varying(160),
  receivedby character varying(100) DEFAULT 'voicecom'::character varying,
  paid boolean DEFAULT false,
  payment_time timestamp without time zone,
  CONSTRAINT sql_id PRIMARY KEY (sql_id)
)
WITHOUT OIDS;
ALTER TABLE sms_in OWNER TO seik;
  
hope you will deal easily with the above scenario, even i provided short
explanation.
sorry have some issues to deal with

cheers



-----Original Message-----
From: Otandeka Simon Peter [EMAIL PROTECTED]
Sent: 26 Ноември 2007 г.
To: seik
Subject:External dlr storage 

>  
> Hello guys,
>  
> Has anyone used a Postgres dlr storage and it has worked for him?
> I need especially to separate failed SMSs from successful SMSs with MT
billing.
>  
> Anyone will experience can post here some info and configuration.
>  
> Thanks in advance.
>  
> Regards
> Peter




Reply via email to