laforge
/
openbts-osmo
Archived
1
0
Fork 0

Use decoded text from original message in bounce and e-mail messages.

This commit is contained in:
Alexander Chemeris 2010-11-05 20:57:49 +03:00 committed by Thomas Tsou
parent ff7b341dae
commit a55a85eeba
1 changed files with 4 additions and 14 deletions

View File

@ -1149,19 +1149,12 @@ enum sm_state
SMq::bounce_message(short_msg_pending *sent_msg, const char *errstr) SMq::bounce_message(short_msg_pending *sent_msg, const char *errstr)
{ {
ostringstream errmsg; ostringstream errmsg;
osip_body_t *bod1;
char *username; char *username;
char *thetext; std::string thetext;
int status; int status;
username = sent_msg->parsed->to->url->username; username = sent_msg->parsed->to->url->username;
if (sent_msg->parsed->bodies.nb_elt > 0) { thetext = sent_msg->get_text();
// bod1->body is the original SMS text
bod1 = (osip_body_t *)sent_msg->parsed->bodies.node->element;
thetext = bod1->body;
} else {
thetext = "";
}
LOG(NOTICE) << "Bouncing " << sent_msg->qtag << " from " LOG(NOTICE) << "Bouncing " << sent_msg->qtag << " from "
<< sent_msg->parsed->from->url->username // his phonenum << sent_msg->parsed->from->url->username // his phonenum
@ -1430,18 +1423,15 @@ SMq::lookup_from_address (short_msg_pending *qmsg)
// into the message text, followed by a space... GSM 03.40 sec 3.8 // into the message text, followed by a space... GSM 03.40 sec 3.8
ostringstream newtext; ostringstream newtext;
osip_body_t *bod1; osip_body_t *bod1;
char *bods;
bods = (char *)"";
if (qmsg->parsed->bodies.nb_elt == 1) { if (qmsg->parsed->bodies.nb_elt == 1) {
bod1 = (osip_body_t *)qmsg->parsed->bodies.node->element; bod1 = (osip_body_t *)qmsg->parsed->bodies.node->element;
bods = bod1->body;
} else { } else {
return NO_STATE; // Punt on msg w/no text return NO_STATE; // Punt on msg w/no text
} }
newtext << qmsg->parsed->from->url->username << "@" newtext << qmsg->parsed->from->url->username << "@"
<< host << " " << bods; << host << " " << qmsg->get_text();
osip_free(bods); osip_free(bod1->body);
bod1->body = osip_strdup(newtext.str().c_str()); bod1->body = osip_strdup(newtext.str().c_str());
bod1->length = strlen(bod1->body); bod1->length = strlen(bod1->body);