Hi Alex, One good reason to add a UUID to HTTP headers is to then have a method to be able to easily delete an SMS in Kannel's store before it's sent.
Currently Kannel internally creates a UUID for each SMS before sending it. This can be seen using lynx -dump "http://127.0.0.1:xxx/store-status.xml?password=xxxx". But how can we know which SMS message has which allocated UUID, without having to analyse all the SMSs in the store. If we can send an SMS to Kannel and also create the UUID that Kannel will use internally, then we can simply know which UUID to delete when we run the command http://127.0.0.1:13000/remove-message?id=UUID&password=xxxx If SMSs are going out slowly via one provider, it would be useful to be able delete those SMSs still in the queue and send them via another provider. By being able to set the internal Kannel UUID when sending the SMS this will be easy to implement. thanks Date: Tue, 9 Jun 2015 10:32:01 +0200 From: Alexander Malysh <amal...@kannel.org> To: Vladimir Laskov <samflan...@gmail.com> Cc: devel@kannel.org Subject: Re: [patch] add UUID to HTTP headers Message-ID: <bb7ac4ff-b351-4272-b98c-81bf7d400...@kannel.org> Content-Type: text/plain; charset="windows-1252" Hi Vladimir, thanks for the patch! But first thing would be to know, why it?s needed? For messages tracking purposes you can always use dlr-url with your params/id. Second thing: List *local_? is not a C-style and duplication of headers costs performance... Alex > Am 04.06.2015 um 10:36 schrieb Vladimir Laskov <samflan...@gmail.com>: > > > > Hello, guys > > please see and confirm patch > patch description: add UUID HTTP herader like here > > ========================================== > Server: Kannel/1.4.4 > Date: Thu, 04 Jun 2015 08:15:28 GMT > Content-Length: 24 > Content-type: text/html > Pragma: no-cache > Cache-Control: no-cache > X-Kannel-UUID: 4d069003-e43f-426e-8a95-ba21cb71dca5 > ========================================== > > > > diff --git a/gw/smsbox.c b/gw/smsbox.c index b62e62e..2e0faf4 100644 > --- a/gw/smsbox.c > +++ b/gw/smsbox.c > @@ -213,8 +213,12 @@ static void delayed_http_reply(Msg *msg) > break; > } > > - http_send_reply(client, status, sendsms_reply_hdrs, answer); > + List *local_sendsms_reply_hdrs = http_header_duplicate(sendsms_reply_hdrs); > + http_header_add(local_sendsms_reply_hdrs, "X-Kannel-UUID", > + octstr_get_cstr(os)); > + > + http_send_reply(client, status, local_sendsms_reply_hdrs, > + answer); > > + http_destroy_headers(local_sendsms_reply_hdrs); > octstr_destroy(answer); > octstr_destroy(os); > } > > > > THX > -- > Vladimir Laskov > samflan...@gmail.com <mailto:samflan...@gmail.com> > +79266285176 >