Dear Jovan, Thanks for your reply, I used rawurl encode in the following
way, I get the same error again.
$URL = "/cgi-bin/sendota?username=OTA_sender"
. "&password=ota_foobar"
. "&from=".GLOBAL_SENDER
.
"&to=".urlencode($in_phoneNumber)."&text=".rawurlencode("/path/to/xml/ota.xml")."&type=settings";
$results = file('http://'
.BEARERBOX_HOST.':'
.SENDSMS_PORT . $URL);
Similarly I did the following as well:
rawurlencode("http://x.x.x.x/path/to/xml/ota.xml")
but I get the same following error:
2010-01-15 21:24:49 [18727] [6] DEBUG: match found: ^[ ]*(ota)[ ]*
2010-01-15 21:24:49 [18727] [6] INFO: Starting to service <Ota> from
<+923225046338> to <00923225046352>
2010-01-15 21:24:49 [18727] [2] DEBUG: Queue contains 0 pending requests.
2010-01-15 21:24:49 [18727] [2] DEBUG: HTTPS URL; Using SSL for the
connection
2010-01-15 21:24:49 [18727] [2] DEBUG: Parsing URL `
https://10.3.20.136/interface/kannel_setup/ota_settings.php?sender=%2B923225046338
':
2010-01-15 21:24:49 [18727] [2] DEBUG: Scheme: https://
2010-01-15 21:24:49 [18727] [2] DEBUG: Host: 10.3.20.136
2010-01-15 21:24:49 [18727] [2] DEBUG: Port: 443
2010-01-15 21:24:49 [18727] [2] DEBUG: Username: (null)
2010-01-15 21:24:49 [18727] [2] DEBUG: Password: (null)
2010-01-15 21:24:49 [18727] [2] DEBUG: Path:
/interface/kannel_setup/ota_settings.php
2010-01-15 21:24:49 [18727] [2] DEBUG: Query: sender=%2B923225046338
2010-01-15 21:24:49 [18727] [2] DEBUG: Fragment: (null)
2010-01-15 21:24:49 [18727] [2] DEBUG: HTTP: Opening connection to `
10.3.20.136:443' (fd=28).
2010-01-15 21:24:49 [18727] [2] DEBUG: Socket connecting
2010-01-15 21:24:49 [18727] [1] DEBUG: Get info about connecting socket
2010-01-15 21:24:49 [18727] [1] DEBUG: HTTP: Sending request:
2010-01-15 21:24:49 [18727] [1] DEBUG: Octet string at 0x8158578:
2010-01-15 21:24:49 [18727] [1] DEBUG: len: 153
2010-01-15 21:24:49 [18727] [1] DEBUG: size: 1024
2010-01-15 21:24:49 [18727] [1] DEBUG: immutable: 0
2010-01-15 21:24:49 [18727] [1] DEBUG: data: 47 45 54 20 2f 69 6e 74 65 72
66 61 63 65 2f 6b GET /interface/k
2010-01-15 21:24:49 [18727] [1] DEBUG: data: 61 6e 6e 65 6c 5f 73 65 74 75
70 2f 6f 74 61 5f annel_setup/ota_
2010-01-15 21:24:49 [18727] [1] DEBUG: data: 73 65 74 74 69 6e 67 73 2e 70
68 70 3f 73 65 6e settings.php?sen
2010-01-15 21:24:49 [18727] [1] DEBUG: data: 64 65 72 3d 25 32 42 39 32 33
32 32 35 30 34 36 der=%2B923225046
2010-01-15 21:24:49 [18727] [1] DEBUG: data: 33 33 38 20 48 54 54 50 2f 31
2e 31 0d 0a 48 6f 338 HTTP/1.1..Ho
2010-01-15 21:24:49 [18727] [1] DEBUG: data: 73 74 3a 20 31 30 2e 33 2e 32
30 2e 31 33 36 3a st: 10.3.20.136:
2010-01-15 21:24:49 [18727] [1] DEBUG: data: 34 34 33 0d 0a 43 6f 6e 6e 65
63 74 69 6f 6e 3a 443..Connection:
2010-01-15 21:24:49 [18727] [1] DEBUG: data: 20 6b 65 65 70 2d 61 6c 69 76
65 0d 0a 55 73 65 keep-alive..Use
2010-01-15 21:24:49 [18727] [1] DEBUG: data: 72 2d 41 67 65 6e 74 3a 20 4b
61 6e 6e 65 6c 2f r-Agent: Kannel/
2010-01-15 21:24:49 [18727] [1] DEBUG: data: 31 2e 34 2e 33 0d 0a 0d
0a 1.4.3....
2010-01-15 21:24:49 [18727] [1] DEBUG: Octet string dump ends.
2010-01-15 21:24:49 [18727] [4] DEBUG: HTTP: Creating HTTPClient for
`10.3.20.136'.
2010-01-15 21:24:49 [18727] [4] DEBUG: HTTP: Created HTTPClient area
0x81617c8.
2010-01-15 21:24:49 [18727] [5] INFO: smsbox: Got HTTP request
</cgi-bin/sendota> from <10.3.20.136>
2010-01-15 21:24:49 [18727] [5] INFO: sendsms used by <OTA_sender>
2010-01-15 21:24:49 [18727] [5] DEBUG: OTA service with XML document
2010-01-15 21:24:49 [18727] [5] ERROR: OTA: No document to parse. Probably
an error in OTA source
2010-01-15 21:24:49 [18727] [5] DEBUG: Status: 400 Answer: <Erroneous ota
source, cannot compile
>
2010-01-15 21:24:49 [18727] [5] DEBUG: HTTP: Destroying HTTPClient area
0x81617c8.
2010-01-15 21:24:49 [18727] [5] DEBUG: HTTP: Destroying HTTPClient for
`10.3.20.136'.
2010-01-15 21:24:49 [18727] [1] DEBUG: HTTP: Status line: <HTTP/1.1 200 OK>
2010-01-15 21:24:49 [18727] [1] DEBUG: HTTP: Received response:
2010-01-15 21:24:49 [18727] [1] DEBUG: Octet string at 0x8174960:
2010-01-15 21:24:49 [18727] [1] DEBUG: len: 201
2010-01-15 21:24:49 [18727] [1] DEBUG: size: 1024
2010-01-15 21:24:49 [18727] [1] DEBUG: immutable: 0
2010-01-15 21:24:49 [18727] [1] DEBUG: data: 44 61 74 65 3a 20 46 72 69 2c
20 31 35 20 4a 61 Date: Fri, 15 Ja
2010-01-15 21:24:49 [18727] [1] DEBUG: data: 6e 20 32 30 31 30 20 31 35 3a
31 35 3a 33 30 20 n 2010 15:15:30
2010-01-15 21:24:49 [18727] [1] DEBUG: data: 47 4d 54 0d 0a 53 65 72 76 65
72 3a 20 41 70 61 GMT..Server: Apa
2010-01-15 21:24:49 [18727] [1] DEBUG: data: 63 68 65 2f 32 2e 32 2e 31 30
20 28 4c 69 6e 75 che/2.2.10 (Linu
2010-01-15 21:24:49 [18727] [1] DEBUG: data: 78 2f 53 55 53 45 29 0d 0a 58
2d 50 6f 77 65 72 x/SUSE)..X-Power
2010-01-15 21:24:49 [18727] [1] DEBUG: data: 65 64 2d 42 79 3a 20 50 48 50
2f 35 2e 32 2e 39 ed-By: PHP/5.2.9
2010-01-15 21:24:49 [18727] [1] DEBUG: data: 0d 0a 43 6f 6e 74 65 6e 74 2d
4c 65 6e 67 74 68 ..Content-Length
2010-01-15 21:24:49 [18727] [1] DEBUG: data: 3a 20 30 0d 0a 4b 65 65 70 2d
41 6c 69 76 65 3a : 0..Keep-Alive:
2010-01-15 21:24:49 [18727] [1] DEBUG: data: 20 74 69 6d 65 6f 75 74 3d 31
35 2c 20 6d 61 78 timeout=15, max
2010-01-15 21:24:49 [18727] [1] DEBUG: data: 3d 31 30 30 0d 0a 43 6f 6e 6e
65 63 74 69 6f 6e =100..Connection
2010-01-15 21:24:49 [18727] [1] DEBUG: data: 3a 20 4b 65 65 70 2d 41 6c 69
76 65 0d 0a 43 6f : Keep-Alive..Co
2010-01-15 21:24:49 [18727] [1] DEBUG: data: 6e 74 65 6e 74 2d 54 79 70 65
3a 20 74 65 78 74 ntent-Type: text
2010-01-15 21:24:49 [18727] [1] DEBUG: data: 2f 68 74 6d 6c 0d 0a 0d
0a /html....
2010-01-15 21:24:49 [18727] [1] DEBUG: Octet string dump ends.
I dont know what am I doing wrong. Can any one please point this out.
Best Regards,
Aftab Hussain
On Fri, Jan 15, 2010 at 4:48 AM, Jovan Kostovski <[email protected]> wrote:
> On Fri, Jan 15, 2010 at 12:55 PM, aftab hussain
> <[email protected]> wrote:
> >
> > Dear All,
> > According to the userguide OTA can be sent as an XML
> document
> > to the sendota utility.
> >
> >
> >
> http://smsbox.host.name:13013/cgi-bin/sendota?username=foo&password=bar&to=0123456&text=MyURLEncodedXMLdocument&type=settings
> >
> > But how do I specify MyURLEncodedXMLdocument in PHP. Does any one have
> done
> > similar bit, I will highly appreciate any help.
>
> You can use the rawurlencode php function
> (http://php.net/manual/en/function.rawurlencode.php).
> You should encode the url of the XML file, not the file content.
>
> BR, Jovan
>