Double hostname in DLR URL
Andreas Fink <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[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 iQIcBAEBAgAGBQJT1WjVAAoJEOtfx+3l1p1nYCQP+QEKzrrM5YU/t4o9WYjrh1fS q8F9dJ5WB/gUF53hj+VnH9iYWVS+BWPykI7x5b7wnmFq+dn/6JJoLNjEBAMWaFF8 KmWEvdsOdyypVVBWH9uZy7ApMDe5JVdz0xXiScmky5bDgEMy2QbsiCzHJK2eyRv/ J9BmfDhdVjmxj+J498Snb93uj54CMPKPdmYtugw082N6nRsRxDEJZeykMgjlDEpm ACeUwRVKZMUHhgyRVUwe347x7/MqJlJMM9/PrhZpGuu0SVu+AUHBYAZzbM2F0nRP oXaSmiyiV9usTRcv6+0v+IF8/qQX7Ht1l5rpP99p3D1deRuif6Um9/LVaOdsl9QL CXfWULBXSDPGflDqdS64maNdJAHpujfbqZBfHH+CYLKEHmhjsf4q/rAmCUvMF/sL tJVArZ8IAEoXoYNbMr/TjeKoI+7/VrbRkFzPCJkhawlXJvuYho4EKM96f6aeF82t dTpvSdHoACPxkJdVpJo1/3x1/1pci6SZ64yhCEZ5aJVmc6AqLfL2SK/s6CDsw76/ E1rmgxp8Z1ishvBX4TX8jp2WF7+MQb2hZU95Ilu9rrnKpmgKIm34SYfrLnbh7bKb gXxKM30P1iOoxrD1S+YLt9bSjy+9IzkhjlRK8U3drzsfVybySCMvaD3An0EjK+Yl lPwJ+ghIFpMzD7sSaYOO =50id -----END PGP SIGNATURE-----