1
0
Fork 0

Time stamp updates on configure files, removing old mmbox stuff from mmsmobilesender

This commit is contained in:
bagyenda 2005-03-31 08:43:04 +00:00
parent b3a218b42f
commit da666bfcd3
6 changed files with 26 additions and 68 deletions

View File

@ -11,7 +11,7 @@
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. # PARTICULAR PURPOSE.
#
@SET_MAKE@ @SET_MAKE@
srcdir = @srcdir@ srcdir = @srcdir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@

View File

@ -11,7 +11,7 @@
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. # PARTICULAR PURPOSE.
#
@SET_MAKE@ @SET_MAKE@

View File

@ -162,7 +162,7 @@ MmsBoxSettings *mms_load_mmsbox_settings(Cfg *cfg)
m->prov_getstatus = cfg_getx(grp,octstr_imm("prov-server-sub-status-script")); m->prov_getstatus = cfg_getx(grp,octstr_imm("prov-server-sub-status-script"));
m->mms_notify_txt = cfg_getx(grp, octstr_imm("mms-notify-text")); m->mms_notify_txt = cfg_getx(grp, octstr_imm("mms-notify-text"));
m->mms_notify_unprov_txt = cfg_getx(grp, octstr_imm("mms-notify-unprovisioned-text")); m->mms_notify_unprov_txt = cfg_getx(grp, octstr_imm("mms-notify-unprovisioned-text"));
m->mmbox_host = cfg_getx(grp, octstr_imm("mm-box-host"));
m->mms_email_txt = cfg_getx(grp, octstr_imm("mms-to-email-txt")); m->mms_email_txt = cfg_getx(grp, octstr_imm("mms-to-email-txt"));
m->mms_email_html = cfg_getx(grp, octstr_imm("mms-to-email-html")); m->mms_email_html = cfg_getx(grp, octstr_imm("mms-to-email-html"));

View File

@ -93,7 +93,6 @@ typedef struct MmsBoxSettings {
Octstr *mms_notify_txt; Octstr *mms_notify_txt;
Octstr *mms_notify_unprov_txt; Octstr *mms_notify_unprov_txt;
Octstr *mms_toolarge; Octstr *mms_toolarge;
Octstr *mmbox_host; /* XXX need to remove this. */
Octstr *mms_email_txt; Octstr *mms_email_txt;
Octstr *mms_email_html; Octstr *mms_email_html;

View File

@ -11,7 +11,7 @@
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. # PARTICULAR PURPOSE.
#
@SET_MAKE@ @SET_MAKE@
SOURCES = mmsfromemail.c mmsglobalsender.c mmsmobilesender.c mmsproxy.c mmssend.c SOURCES = mmsfromemail.c mmsglobalsender.c mmsmobilesender.c mmsproxy.c mmssend.c

View File

@ -292,7 +292,6 @@ static int sendNotify(MmsEnvelope *e)
/* For phone, getting here means the message can be delivered. So: /* For phone, getting here means the message can be delivered. So:
* - Check whether the recipient is provisioned, if not, wait (script called will queue creation req) * - Check whether the recipient is provisioned, if not, wait (script called will queue creation req)
* - Send to MMBox if not yet done.
* - If the recipient can't take MMS, then send SMS. * - If the recipient can't take MMS, then send SMS.
*/ */
@ -322,70 +321,29 @@ static int sendNotify(MmsEnvelope *e)
mms_queue_free_env(e); mms_queue_free_env(e);
goto done; goto done;
} else if (e->mdata == NULL) { /* Not yet sent to MMBox etc, but provisioned. */ } else if (send_ind == 0) { /* provisioned but does not support */
Octstr *s = octstr_format(octstr_get_cstr(settings->mms_notify_txt),
from);
List *pheaders;
Octstr *sto = octstr_duplicate(phonenum);
int x; octstr_url_encode(s);
if (settings->mmbox_host && octstr_url_encode(sto);
octstr_len(settings->mmbox_host) > 0) { /* Only if mmbox is configured. */
Octstr *mto = octstr_format("%S@%S", phonenum, settings->mmbox_host);
x = mms_sendtoemail(from, mto, e->subject, e->msgId, msg, 0, &err,
octstr_get_cstr(settings->sendmail), settings->hostname, 1,
1, octstr_get_cstr(settings->mms_email_txt),
octstr_get_cstr(settings->mms_email_html), 1);
octstr_destroy(mto);
} else
x = 0;
if (x != 0) { /* Failed to send to MMBox...*/ url = octstr_format("%S&text=%S&to=%S",settings->sendsms_url,s, sto);
res = MMS_SEND_ERROR_TRANSIENT; pheaders = http_create_empty_headers();
err = octstr_format("Failed to send to MMBox %d", x); http_header_add(pheaders, "Connection", "close");
e->attempts++; http_header_add(pheaders, "User-Agent", MM_NAME "/" GW_VERSION);
e->lasttry = tnow;
e->sendt = e->lasttry + settings->send_back_off * e->attempts; http_start_request(httpcaller, HTTP_METHOD_GET, url,
pheaders, NULL, 0, &edummy, NULL);
if (mms_queue_update(e) == 1)
e = NULL; /* Queue entry gone. */
else http_destroy_headers(pheaders);
mms_queue_free_env(e); octstr_destroy(url);
goto done; octstr_destroy(s);
} octstr_destroy(sto);
/* else Send to MMBox succeeded or non-provisioned.
* But if phone cannot handle MMS-Ind, then send it sms.
*/
if (send_ind == 0) {
Octstr *s = octstr_format(octstr_get_cstr(settings->mms_notify_txt),
from);
List *pheaders;
Octstr *xto = octstr_duplicate(phonenum);
octstr_url_encode(s);
octstr_url_encode(xto);
url = octstr_format("%S&text=%S&to=%S",settings->sendsms_url,s, xto);
pheaders = http_create_empty_headers();
http_header_add(pheaders, "Connection", "close");
http_header_add(pheaders, "User-Agent", MM_NAME "/" GW_VERSION);
http_start_request(httpcaller, HTTP_METHOD_GET, url,
pheaders, NULL, 0, &edummy, NULL);
http_destroy_headers(pheaders);
octstr_destroy(url);
octstr_destroy(s);
octstr_destroy(xto);
}
e->mdata = octstr_imm("MMSent"); /* Mark as sent to MMBox. */
if (mms_queue_update(e) == 1) {
e = NULL;
goto done;
}
}
if (send_ind == 0) { /* No MMS Ind, go away but first update queue entry. */
res = MMS_SEND_OK; res = MMS_SEND_OK;
err = octstr_imm("No MMS Ind support, sent SMS instead"); err = octstr_imm("No MMS Ind support, sent SMS instead");
@ -395,7 +353,8 @@ static int sendNotify(MmsEnvelope *e)
else else
mms_queue_free_env(e); mms_queue_free_env(e);
goto done; goto done;
}
}
} }
/* To get here means we can send Ind. */ /* To get here means we can send Ind. */