Hi Kyriacos,

Taking this a step further as I was wondering if this was actually
possible. Caveat: I'm thinking out loud in pgsql (more user than
admin/guru) and not mysql ..

An insert/update/delete trigger to strip out the  prefix (eg 01//)
wouldn't be a problem assuming you could identify the smsc id, etc (so
can avoid impacting those that are behaving). The issue as I see is with
the select when you finally get your DLR .. If the 04/ was consistent
you would just add it as part of the insert trigger which would work
fine. But I'm guessing the '04/' is just an example and is varying so
you need would need a view (pref materialized) do strip it out so your
select matches. But .. you can't insert / update, etc on a view (in
postgres .. as far as I know) so as it stands with the existing kannel
config I can't see a way of doing this if this is what you are seeing.

However, it might be do-able with a combination of views, triggers,
schemas (so you can have a table and a view of the same name but in
different schema) and/or different read/write user (associated with
different schema). But some code change to support schemas / users would
be required in kannel. You would need to check out what mysql can do
here .. might not be impossible  .. for example, from what I can see
online (no personal experience) Oracle seems to support an "Instead Of"
trigger so you could use / handle inserts/etc on a view.

Maybe someone with a bit more experience with DB wrangling might be able
to help you further with mysql.

As Alex notes I suspect a simpler solution might be to support a regexp
on DLR details in kannel ;)

Cheers,
Alan


On 18/02/11 22:35, Kyriacos Sakkas wrote:
> So yep if someone things that this can be done with pure MYSQL triggers
> or something like that, which does not need heavy kannel changes, please
> let me know.

Reply via email to