Re: Double hostname in DLR URL

Andreas Fink <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
No. but the problem is gone after a clean rebuild somehow.
very strange...

On 18 Aug 2014, at 13:58, Alexander Malysh <[email protected]> wrote:

> Hi Andreas,
> 
> did you find anything? I never saw this on our side.
> 
> Alex
> 
> Am 27.07.2014 um 23:02 schrieb Andreas Fink <[email protected]>:
> 
>> Hi folks,
>> 
>> I run into a very puzzling issue with the delivery of DLRs from Kannel.
>> 
>> I have a script which submits SMS to kannel. This script constructs a DLR URL like this:
>> 
>>             callback_url = octstr_format("http://%s:%d/sms/response.php?priority=%d",
>>                                                  octstr_get_cstr(callback_host),
>>                                                  (int)callback_port,ilm_prio);
>> 		further parameters added...
>> 
>> callback_host and callback_port are Octstr read from the config file and are always constant. They do not contain spaces or any trailing tabs or the like
>> Then this URL is urlencoded and passed on to the URL which is sent to kannel.
>> Kannel is processing the request and comes back with a delivery report.
>> The hostname passed is a straight IP address not a DNS name.
>> 
>> 
>> This is the SMSBox Log on a DLR being sent back
>> 
>> 2014-07-27 20:27:06 [16079] [10] DEBUG:   Scheme: http://
>> 2014-07-27 20:27:06 [16079] [10] DEBUG:   Host: 10.195.198.70
>> 2014-07-27 20:27:06 [16079] [10] DEBUG:   Port: 80
>> 2014-07-27 20:27:06 [16079] [10] DEBUG:   Username: (null)
>> 2014-07-27 20:27:06 [16079] [10] DEBUG:   Password: (null)
>> 2014-07-27 20:27:06 [16079] [10] DEBUG:   Path: /sms/response.php
>> 2014-07-27 20:27:06 [16079] [10] DEBUG:   Query: {some parameters...}
>> 2014-07-27 20:27:06 [16079] [10] DEBUG:   Fragment: (null)
>> 2014-07-27 20:27:06 [16079] [10] DEBUG: HTTP: Reusing connection to `10.195.198.70:80' (fd=31).
>> 2014-07-27 20:27:06 [16079] [10] DEBUG: Socket connected at once
>> 2014-07-27 20:27:06 [16079] [10] DEBUG: HTTP: Sending request:
>> 2014-07-27 20:27:06 [16079] [10] DEBUG: Octet string at 0x7f9dd3b00050:
>> 2014-07-27 20:27:06 [16079] [10] DEBUG:   len:  563
>> 2014-07-27 20:27:06 [16079] [10] DEBUG:   size: 1024
>> 2014-07-27 20:27:06 [16079] [10] DEBUG:   immutable: 0
>> 
>> 
>> this is all correct so far and my script answers with a "OK" and everything's fine.
>> 
>> 
>> but then further down in the log I suddenly see this:
>> 
>> 
>> 2014-07-27 20:32:30 [16079] [10] DEBUG: Parsing URL `http://10.195.198.70, 10.195.198.70/sms/response.php?....
>> 2014-07-27 20:31:03 [16079] [10] DEBUG:   Scheme: http://
>> 2014-07-27 20:31:03 [16079] [10] DEBUG:   Host: 85.195.198.70, 85.195.198.70
>> 2014-07-27 20:31:03 [16079] [10] DEBUG:   Port: 80
>> 2014-07-27 20:31:03 [16079] [10] DEBUG:   Username: (null)
>> 2014-07-27 20:31:03 [16079] [10] DEBUG:   Password: (null)
>> 2014-07-27 20:31:03 [16079] [10] DEBUG:   Path: /sms/response.php
>> 2014-07-27 20:31:03 [16079] [10] DEBUG:   Query: ...
>> 2014-07-27 20:31:03 [16079] [10] DEBUG:   Fragment: (null)
>> 2014-07-27 20:31:03 [16079] [10] ERROR: gethostbyname failed
>> 
>> As you can see here, the IP address of the host is now twice in the hostname and of course this is not resolvable.
>> I verified and I am 100% sure that I pass it only once, not twice.
>> And nothing changed between the first request and the second one.
>> Its still the same running instance of my code calling kannel. Its still passing the same DLR URL being passed.
>> Its still the same smsbox running.
>> 
>> Has anyone seen such issues before?
>> Has there been any change in gwlib in regards to handling URL's?
>> 
>> The version used is a SVN checkout from 24th of June.
>> 
>> 
>> 
>> 
>
signature.asc (application/pgp-signature, 841 B)
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org

iQIcBAEBAgAGBQJT8eqqAAoJEOtfx+3l1p1nIQMP/RZLsDLCVRZnnlpiHITPrt7B
K5Pv8wPl2J9HXGRqJ0IoXRxHOu3i5dlGCe8i1fSUspINrwtjceK50MomEmuZ4CtW
opdlmARj7vnvk71abp35U+Z2mKawIZ3PoKJi5N3B2iVwjGW7VwwU2BRqiDNPC9+1
scgPqb/aKLuLmdwxczLJs6AaYUkxg34QSSwJMcy8gK8oZLxL/xQKsFN+TgB0V2fl
7muIY+cnSYxXEctNpnlgSz1TWrdJKnLRvYwGtFY8/T4oaw5wC3CndgDMamcghu5u
odQ3V40UZGo1/RTREAV7IvhcFKgZZq5RNVVGbpSSpimo3veoE4qoJ6ULHTDnmBBY
t2raaiKel57Sdcz1249c5ByzGU0nhs+r+ZcnYLC+WFHk8jLSxRTEVCEsr0FFN7Ly
MRtECLM0gCXG8Vlx48fkJZ9QQDeLNkdZhcqtS20BFVObCUzFMp09MdZM9CeiBpmW
misz91AVFnc11Dv1yzjA10PtZF6xWfR4U1o9ECumzBVaTBRSvekMrXE7PxzqpIFB
MDizRfLWKdBruhXnyUuaFyslIsoNJirSCwgVEBeczjfCFnWxINiMCMrXvsD1djIx
9YHJu6vzaJzWOaLnVXfILcYR3IoAvg2oOewg/9/1vGUYqlhX1cRSjm/qhvnSmQ32
k0GUu9T7ILl0/cozvF94
=EOnT
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.