Kannel: Open Source WAP and SMS gateway  svn-r5335
wap-error.h File Reference
#include "wap/wap.h"

Go to the source code of this file.

Functions

Octstrerror_requesting_back (Octstr *url, Octstr *referer)
 
Octstrerror_requesting (Octstr *url)
 
Octstrerror_converting (Octstr *url, Octstr *type)
 

Function Documentation

◆ error_converting()

Octstr* error_converting ( Octstr url,
Octstr type 
)

Definition at line 109 of file wap-error.c.

References gw_assert(), octstr_format(), octstr_get_cstr, type, and url.

Referenced by return_reply().

110 {
111  Octstr *wml;
112 
113  gw_assert(url != NULL && type != NULL);
114 
115  wml = octstr_format(
116  "<?xml version=\"1.0\"?>" \
117  "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD 1.1//EN\" " \
118  "\"http://www.wapforum.org/DTD/wml_1.1.xml\">" \
119  "<wml><card title=\"Error\">" \
120  "<p>Error: could not convert or compile content-type `%s' " \
121  "at URL `%s'.</p>" \
122  "<p>Either there was no supported converting routine " \
123  "or converter failed while processing.</p>" \
124  "<p>--<br/>" GW_NAME "/%s</p></card></wml>",
125  octstr_get_cstr(type), octstr_get_cstr(url), GW_VERSION
126  );
127 
128  return wml;
129 }
gw_assert(wtls_machine->packet_to_send !=NULL)
int type
Definition: smsc_cimd2.c:215
#define octstr_get_cstr(ostr)
Definition: octstr.h:233
Octstr * octstr_format(const char *fmt,...)
Definition: octstr.c:2464
Definition: octstr.c:118
static Octstr * url
Definition: test_xmlrpc.c:84

◆ error_requesting()

Octstr* error_requesting ( Octstr url)

Definition at line 89 of file wap-error.c.

References gw_assert(), octstr_format(), octstr_get_cstr, and url.

Referenced by return_reply().

90 {
91  Octstr *wml;
92 
93  gw_assert(url != NULL);
94 
95  wml = octstr_format(
96  "<?xml version=\"1.0\"?>" \
97  "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD 1.1//EN\" " \
98  "\"http://www.wapforum.org/DTD/wml_1.1.xml\">" \
99  "<wml><card title=\"Error\">" \
100  "<p>Error: could not request URL `%s'.</p>" \
101  "<p>Either the HTTP server is down or the request timed out.</p>" \
102  "<p>--<br/>" GW_NAME "/%s</p></card></wml>",
103  octstr_get_cstr(url), GW_VERSION
104  );
105 
106  return wml;
107 }
gw_assert(wtls_machine->packet_to_send !=NULL)
#define octstr_get_cstr(ostr)
Definition: octstr.h:233
Octstr * octstr_format(const char *fmt,...)
Definition: octstr.c:2464
Definition: octstr.c:118
static Octstr * url
Definition: test_xmlrpc.c:84

◆ error_requesting_back()

Octstr* error_requesting_back ( Octstr url,
Octstr referer 
)

Definition at line 67 of file wap-error.c.

References gw_assert(), octstr_format(), octstr_get_cstr, and url.

Referenced by return_reply().

68 {
69  Octstr *wml;
70 
71  gw_assert(url != NULL);
72  gw_assert(referer != NULL);
73 
74  wml = octstr_format(
75  "<?xml version=\"1.0\"?>" \
76  "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD 1.1//EN\" " \
77  "\"http://www.wapforum.org/DTD/wml_1.1.xml\">" \
78  "<wml><card title=\"Error\" ontimer=\"%s\">" \
79  "<timer value=\"20\"/><p>Error: could not request URL `%s'.</p>" \
80  "<p>Either the HTTP server is down or the request timed out. " \
81  "Returning to previous page</p> "\
82  "<p>--<br/>" GW_NAME "/%s</p></card></wml>",
83  octstr_get_cstr(referer), octstr_get_cstr(url), GW_VERSION
84  );
85 
86  return wml;
87 }
gw_assert(wtls_machine->packet_to_send !=NULL)
#define octstr_get_cstr(ostr)
Definition: octstr.h:233
Octstr * octstr_format(const char *fmt,...)
Definition: octstr.c:2464
Definition: octstr.c:118
static Octstr * url
Definition: test_xmlrpc.c:84
See file LICENSE for details about the license agreement for using, modifying, copying or deriving work from this software.