1
0
Fork 0

misc fixes

This commit is contained in:
bagyenda 2008-05-30 13:56:14 +00:00
parent 6eb3e6629c
commit 4658ce6b10
8 changed files with 34 additions and 7 deletions

View File

@ -1,3 +1,6 @@
2008-05-30 P. A. Bagyenda <bagyenda@dsmagic.com>
* Added send-mail-prog config param on per-MM4 connection basis
* MM1 fix: If device does not provide a valid WAP Profile URL, allow MMS through anyway.
2008-05-13 P. A. Bagyenda <bagyenda@dsmagic.com>
* Minor fixups on MM4 interface message coding
2008-05-13 P. A. Bagyenda <bagyenda@dsmagic.com>

View File

@ -800,7 +800,7 @@ lists all the configuration directives. The column <b>Mode</b>
</tr>
<tr >
<td valign=top >
<tt>send-mail-prog</tt>
<a name="send-mail-prog"/><tt>send-mail-prog</tt>
&nbsp; &nbsp;</td>
<td valign=top >
@ -2071,6 +2071,23 @@ denied-prefix
</tr>
<tr >
<td valign=top >
<tt>send-mail-prog</tt>
&nbsp; &nbsp;</td>
<td valign=top >
String
&nbsp; &nbsp;</td>
<td valign=top >
Command to use for sending messages (via email)
to foreign MMS gateways. This command over-rides, for this proxy,
the <a href="#send-mail-prog">global</a> <tt>send-mail-prog</tt> setting, and provides the same variable
substitutions.
&nbsp; &nbsp;</td>
</tr>
<tr>
<td valign=top >
<tt>strip-prefixes

View File

@ -97,6 +97,7 @@ MULTI_GROUP(mmsproxy,
OCTSTR(host)
OCTSTR(allowed-prefix)
OCTSTR(denied-prefix)
OCTSTR(send-mail-prog)
OCTSTR(confirmed-delivery)
OCTSTR(unified-prefix)
OCTSTR(strip-prefixes)

View File

@ -622,8 +622,8 @@ static int decode_msgheaders(ParseContext *context, List *hdrs, Octstr *from,
int val = 0;
if (byte >= 0x80)
val = mms_unpack_well_known_field(hdrs, byte&0x7f, context, from, msgtype,
unified_prefixes, strip_prefixes);
val = mms_unpack_well_known_field(hdrs, byte&0x7f, context, from, msgtype,
unified_prefixes, strip_prefixes);
else {
parse_skip(context, -1); /* Go back a bit. */
wsp_unpack_app_header(hdrs, context);

View File

@ -365,6 +365,7 @@ List *mms_proxy_relays(mCfg *cfg, Octstr *myhostname)
if (mms_cfg_get_bool(grp, octstr_imm("confirmed-delivery"), &m->confirmed_mm4) < 0)
m->confirmed_mm4 = 1;
m->sendmail = mms_cfg_get(grp, octstr_imm("send-mail-prog"));
m->unified_prefix = mms_cfg_get(grp, octstr_imm("unified-prefix"));
if ((s = mms_cfg_get(grp, octstr_imm("strip-prefixes"))) != NULL) {
m->strip_prefixes = octstr_split(s, octstr_imm(";"));

View File

@ -28,6 +28,7 @@ typedef struct MmsProxyRelay {
List *strip_prefixes;
int confirmed_mm4;
Octstr *sendmail;
} MmsProxyRelay;
typedef struct MmsVasp {

View File

@ -46,7 +46,7 @@ static int mms_sendtoproxy(Octstr *from, Octstr *to,
Octstr *subject, Octstr *proxy,
char *transid,
Octstr *msgid, time_t expires, MmsMsg *msg,
int dlr, Octstr **error);
int dlr, Octstr *proxy_sendmail_cmd, Octstr **error);
static int mms_sendtovasp(MmsVasp *vasp, Octstr *from, Octstr *to, Octstr *msgId,
List *qh,
@ -306,7 +306,7 @@ static int sendMsg(MmsEnvelope *e)
e->subject, mp->host,
octstr_get_cstr(xtransid),
e->msgId, e->expiryt, msg,
mp->confirmed_mm4, &err);
mp->confirmed_mm4, mp->sendmail, &err);
sent = 1;
octstr_destroy(xtransid);
octstr_destroy(xfrom);
@ -529,7 +529,7 @@ static int mms_sendtoproxy(Octstr *from, Octstr *to,
Octstr *subject, Octstr *proxy,
char *transid,
Octstr *msgid, time_t expires, MmsMsg *msg,
int dlr, Octstr **error)
int dlr, Octstr *proxy_sendmail_cmd, Octstr **error)
{
Octstr *pto, *pfrom;
@ -557,7 +557,7 @@ static int mms_sendtoproxy(Octstr *from, Octstr *to,
x = mms_sendtoemail(from, pto,
subject ? subject : settings->mms_email_subject,
msgid, msg, dlr,
error, sendmail_cmd,
error, proxy_sendmail_cmd ? octstr_get_cstr(proxy_sendmail_cmd) : sendmail_cmd,
settings->hostname, 0, 0,NULL,NULL,1, octstr_get_cstr(xtransid));
octstr_destroy(xtransid);

View File

@ -323,6 +323,7 @@ void fetchmms_proxy(MmsHTTPClientInfo *h)
s = mms_tobinary(mr);
goto failed;
} else if (x < 0) { /* Doesn't support MMS */
#if 0
mr = mms_retrieveconf(NULL, transid,
"Error-permanent-content-unsupported",
"No MMS Support",
@ -331,6 +332,9 @@ void fetchmms_proxy(MmsHTTPClientInfo *h)
notify_cmd = "fetchfailed";
notify_arg = "device-does-not-support-mms";
goto failed;
#else
/* Just accept the message. */
#endif
} else if (x == 0) {
if (outmsg == NULL) { /* Too large so truncated. */
Octstr *xx = octstr_format(octstr_get_cstr(settings->mms_toolarge),