Misc patches - message-ID format, resolver module fallbacks - thanks to Dziugas Baltrunas
This commit is contained in:
parent
ef53251db3
commit
ddcd63dfa2
|
@ -744,14 +744,17 @@ lists all the configuration directives. The column <b>Mode</b>
|
||||||
string
|
string
|
||||||
</td>
|
</td>
|
||||||
<td valign=top s>
|
<td valign=top s>
|
||||||
Short form of
|
Short MMC
|
||||||
hostname. This is used in generating message IDs. It is also used to
|
hostname. This is used in generating message IDs as well as the
|
||||||
generate the message retrieval URL (sent as part of the MMS
|
message retrieval URL (sent as part of the MMS
|
||||||
notification): For instance if you have this as <tt>mmsc</tt> then
|
notification): For instance if you have this as <tt>mmsc</tt> then
|
||||||
the retrieval URL will have the form
|
the retrieval URL will have the form
|
||||||
<tt>http://mmsc/<i>msgtoken</i></tt> (no port is added). Be sure to
|
<tt>http://mmsc/<i>msgtoken</i></tt> (no port is added). Be sure to
|
||||||
keep this value short as some handsets do not like long URLs in MMS
|
keep this value short (as some handsets do not like long URLs in MMS
|
||||||
notifications. If you do not supply a host alias, the gateway will create a long form URL (http://<i>hostname:port/msgtoken</i>) when it sends notifications
|
notifications), and it must not include non-alphanumeric characters
|
||||||
|
as this can screw up URL location parsing. If you do not supply a
|
||||||
|
host alias, the gateway will create a long form URL
|
||||||
|
(http://<i>hostname:port/msgtoken</i>) when it sends notifications
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr >
|
<tr >
|
||||||
|
|
|
@ -210,10 +210,8 @@ Octstr *mms_maketransid(char *qf, Octstr *mmscname)
|
||||||
time(NULL), (++ct % 10000), getpid()%1000, random()%1000);
|
time(NULL), (++ct % 10000), getpid()%1000, random()%1000);
|
||||||
else
|
else
|
||||||
x = octstr_create(qf);
|
x = octstr_create(qf);
|
||||||
|
|
||||||
y = md5digest(mmscname);
|
res = octstr_format("%S@%S", mmscname, x);
|
||||||
|
|
||||||
res = octstr_format("%S@%.5s", x, octstr_get_cstr(y));
|
|
||||||
|
|
||||||
octstr_destroy(x);
|
octstr_destroy(x);
|
||||||
octstr_destroy(y);
|
octstr_destroy(y);
|
||||||
|
@ -229,7 +227,7 @@ extern Octstr *mms_getqf_fromtransid(Octstr *transid)
|
||||||
return NULL;
|
return NULL;
|
||||||
i = octstr_search_char(transid, '@', 0);
|
i = octstr_search_char(transid, '@', 0);
|
||||||
|
|
||||||
return (i >= 0) ? octstr_copy(transid, 0, i) : octstr_duplicate(transid);
|
return (i >= 0) ? octstr_copy(transid, i+1, octstr_len(transid)) : octstr_duplicate(transid);
|
||||||
}
|
}
|
||||||
|
|
||||||
Octstr *mms_isodate(time_t t)
|
Octstr *mms_isodate(time_t t)
|
||||||
|
|
|
@ -46,6 +46,11 @@ static Octstr *mms_resolve(Octstr * phonenum, void *module_data, void *settings_
|
||||||
octstr_strip_crlfs(s);
|
octstr_strip_crlfs(s);
|
||||||
|
|
||||||
pclose(fp);
|
pclose(fp);
|
||||||
|
|
||||||
|
if (octstr_len(s) == 0) {
|
||||||
|
octstr_destroy(s);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
|
@ -236,6 +236,7 @@ static int sendMsg(MmsEnvelope *e)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
octstr_destroy(mmsc);
|
||||||
} else /* Search VASP list, see what you can find... */
|
} else /* Search VASP list, see what you can find... */
|
||||||
for (j = 0, m = list_len(settings->vasp_list); j < m; j++)
|
for (j = 0, m = list_len(settings->vasp_list); j < m; j++)
|
||||||
if ((vasp = list_get(settings->vasp_list, j)) != NULL &&
|
if ((vasp = list_get(settings->vasp_list, j)) != NULL &&
|
||||||
|
@ -259,7 +260,7 @@ static int sendMsg(MmsEnvelope *e)
|
||||||
if (res == MMS_SEND_OK)
|
if (res == MMS_SEND_OK)
|
||||||
to->process = 0;
|
to->process = 0;
|
||||||
else { /* If there was a report request, queue it. */
|
else { /* If there was a report request, queue it. */
|
||||||
|
|
||||||
if (e->dlr) {
|
if (e->dlr) {
|
||||||
Octstr *qfs;
|
Octstr *qfs;
|
||||||
MmsMsg *m = mms_deliveryreport(e->msgId, to->rcpt, tnow,
|
MmsMsg *m = mms_deliveryreport(e->msgId, to->rcpt, tnow,
|
||||||
|
|
|
@ -1591,7 +1591,7 @@ static void mm7soap_dispatch(MmsHTTPClientInfo *h)
|
||||||
switch (mm7_msgtype(mreq)) {
|
switch (mm7_msgtype(mreq)) {
|
||||||
case MM7_TAG_SubmitReq:
|
case MM7_TAG_SubmitReq:
|
||||||
mm7_get_envelope(mreq, &from, &to, &subject, &vasid, &expiryt, &delivert);
|
mm7_get_envelope(mreq, &from, &to, &subject, &vasid, &expiryt, &delivert);
|
||||||
m = mm7_soap_to_mmsmsg(mreq, sender);
|
m = mm7_soap_to_mmsmsg(mreq, from ? from : sender);
|
||||||
if (m) {
|
if (m) {
|
||||||
Octstr *value = NULL;
|
Octstr *value = NULL;
|
||||||
int dlr;
|
int dlr;
|
||||||
|
@ -1618,7 +1618,7 @@ static void mm7soap_dispatch(MmsHTTPClientInfo *h)
|
||||||
octstr_get_cstr(settings->global_queuedir),
|
octstr_get_cstr(settings->global_queuedir),
|
||||||
settings->host_alias);
|
settings->host_alias);
|
||||||
msgid = mms_maketransid(octstr_get_cstr(qf), settings->host_alias);
|
msgid = mms_maketransid(octstr_get_cstr(qf), settings->host_alias);
|
||||||
mms_log("Received", sender, to, -1, msgid, h->vasp->id, NULL, "MM7",
|
mms_log("Received", from ? from : sender, to, -1, msgid, h->vasp->id, NULL, "MM7",
|
||||||
h->ua, NULL);
|
h->ua, NULL);
|
||||||
if (value)
|
if (value)
|
||||||
octstr_destroy(value);
|
octstr_destroy(value);
|
||||||
|
|
Loading…
Reference in New Issue