From a55a85eebad4b7219e8eea529ab36d0d3095f9c2 Mon Sep 17 00:00:00 2001 From: Alexander Chemeris Date: Fri, 5 Nov 2010 20:57:49 +0300 Subject: [PATCH] Use decoded text from original message in bounce and e-mail messages. --- public-trunk/smqueue/smqueue.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/public-trunk/smqueue/smqueue.cpp b/public-trunk/smqueue/smqueue.cpp index 82f0c7f..2834763 100644 --- a/public-trunk/smqueue/smqueue.cpp +++ b/public-trunk/smqueue/smqueue.cpp @@ -1149,19 +1149,12 @@ enum sm_state SMq::bounce_message(short_msg_pending *sent_msg, const char *errstr) { ostringstream errmsg; - osip_body_t *bod1; char *username; - char *thetext; + std::string thetext; int status; username = sent_msg->parsed->to->url->username; - if (sent_msg->parsed->bodies.nb_elt > 0) { - // bod1->body is the original SMS text - bod1 = (osip_body_t *)sent_msg->parsed->bodies.node->element; - thetext = bod1->body; - } else { - thetext = ""; - } + thetext = sent_msg->get_text(); LOG(NOTICE) << "Bouncing " << sent_msg->qtag << " from " << 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 ostringstream newtext; osip_body_t *bod1; - char *bods; - bods = (char *)""; if (qmsg->parsed->bodies.nb_elt == 1) { bod1 = (osip_body_t *)qmsg->parsed->bodies.node->element; - bods = bod1->body; } else { return NO_STATE; // Punt on msg w/no text } newtext << qmsg->parsed->from->url->username << "@" - << host << " " << bods; - osip_free(bods); + << host << " " << qmsg->get_text(); + osip_free(bod1->body); bod1->body = osip_strdup(newtext.str().c_str()); bod1->length = strlen(bod1->body);