--- gateway/gw/smsc/smsc_at2.c	2002-09-04 20:42:56.000000000 +0300
+++ gateway/gw/smsc/smsc_at2.c	2002-09-05 11:08:51.000000000 +0300
@@ -51,7 +51,7 @@
 }
 
 
-int	at2_open_device(PrivAT2data *privdata)
+int at2_open_device(PrivAT2data *privdata)
 {
     struct termios tios;
     int ret;
@@ -77,7 +77,7 @@
 
     /*
     if ( ModemTypes[privdata->modemid].enable_parity )
-    	tios.c_cflag ^= PARODD;
+        tios.c_cflag ^= PARODD;
     */
 
     ret = tcsetattr(privdata->fd, TCSANOW, &tios); /* apply changes now */
@@ -243,13 +243,13 @@
 
     count = octstr_len(linestr);
     while (1) {
-	errno = 0;
-	s = write(privdata->fd, octstr_get_cstr(linestr), count);
-	if (s < 0 && errno == EAGAIN && write_count < RETRY_SEND) {
-	    gwthread_sleep(1);
-	    ++write_count;
-	} else
-	    break;
+        errno = 0;
+        s = write(privdata->fd, octstr_get_cstr(linestr), count);
+        if (s < 0 && errno == EAGAIN && write_count < RETRY_SEND) {
+            gwthread_sleep(1);
+            ++write_count;
+        } else
+            break;
     };
     O_DESTROY(linestr);
     if (s < 0) {
@@ -272,13 +272,13 @@
     
     debug("bb.smsc.at2", 0, "AT2[%s]: --> ^Z", octstr_get_cstr(privdata->name));
     while (1) {
-	errno = 0;
-	s = write(privdata->fd, ctrlz, 1);
-	if (s < 0 && errno == EAGAIN && write_count < RETRY_SEND) {
-	    gwthread_sleep(1);
-	    ++write_count;
-	} else
-	    break;
+        errno = 0;
+        s = write(privdata->fd, ctrlz, 1);
+        if (s < 0 && errno == EAGAIN && write_count < RETRY_SEND) {
+            gwthread_sleep(1);
+            ++write_count;
+        } else
+            break;
     };
     if (s < 0) {
         debug("bb.smsc.at2", 0, "AT2[%s]: write failed with errno %d", 
@@ -572,12 +572,12 @@
                 continue;
             }
             if ((octstr_search(line, octstr_imm("+CMGS:"),0) != -1) && (output)) {
-		/* found response to a +CMGS command, read the message id and return it in output */
-		long temp;
-		if (octstr_parse_long(&temp, line, octstr_search(line, octstr_imm("+CMGS:"),0)+6,10) == -1)
-		    error(0,"AT2[%s]: got +CMGS but failed to read message id", octstr_get_cstr(privdata->name));
-		else
-		    *output = temp;
+                /* found response to a +CMGS command, read the message id and return it in output */
+                long temp;
+                if (octstr_parse_long(&temp, line, octstr_search(line, octstr_imm("+CMGS:"),0)+6,10) == -1)
+                    error(0,"AT2[%s]: got +CMGS but failed to read message id", octstr_get_cstr(privdata->name));
+                else
+                    *output = temp;
             }
 
             if ( -1 != octstr_search(line, octstr_imm("ERROR"), 0)) {
@@ -800,6 +800,11 @@
         speed = B57600;
         break;
 #endif
+#ifdef B115200
+    case 115200:
+        speed = B115200;
+        break;
+#endif
     default:
         speed = B9600;
     }
@@ -846,26 +851,26 @@
 
         /* If modems->speed is defined, try to use it, else autodetect */
         if (privdata->speed == 0 && privdata->modem != NULL && 
-	    privdata->modem->speed != 0) {
+            privdata->modem->speed != 0) {
 
-	    info(0, "AT2[%s]: trying to use speed <%ld> from modem definition", 
-	         octstr_get_cstr(privdata->name), privdata->modem->speed);
-	    if(0 == at2_test_speed(privdata, privdata->modem->speed)) { 
-		privdata->speed = privdata->modem->speed;
-		info(0, "AT2[%s]: speed is %ld", 
-		     octstr_get_cstr(privdata->name), privdata->speed);
-	    } else {
-		info(0, "AT2[%s]: speed in modem definition don't work, will autodetect", 
-		     octstr_get_cstr(privdata->name));
-	    }
-	}
+            info(0, "AT2[%s]: trying to use speed <%ld> from modem definition", 
+                 octstr_get_cstr(privdata->name), privdata->modem->speed);
+            if(0 == at2_test_speed(privdata, privdata->modem->speed)) { 
+                privdata->speed = privdata->modem->speed;
+                info(0, "AT2[%s]: speed is %ld", 
+                     octstr_get_cstr(privdata->name), privdata->speed);
+            } else {
+                info(0, "AT2[%s]: speed in modem definition don't work, will autodetect", 
+                     octstr_get_cstr(privdata->name));
+            }
+        }
 
         if (privdata->speed == 0) {
-	    if (at2_detect_speed(privdata) == -1) {
-		if (!privdata->retry)
-		    return;
-		else
-		    continue;
+            if (at2_detect_speed(privdata) == -1) {
+                if (!privdata->retry)
+                    return;
+                else
+                    continue;
             }
         }
 
@@ -1146,25 +1151,25 @@
     /* find the beginning of a message from the modem*/
 
     if ((pos = octstr_search(buffer, octstr_imm("+CDS:"), 0)) != -1) 
-	pos += 5;
+        pos += 5;
     else {
-	if ((pos = octstr_search(buffer, octstr_imm("+CMT:"), 0)) != -1)
-	    pos += 5;
-	else if ((pos = octstr_search(buffer, octstr_imm("+CMGR:"), 0)) != -1) {
-	    /* skip status field in +CMGR response */
-	    if ((pos = octstr_search(buffer, octstr_imm(","), pos + 6)) != -1) 
-		pos++;
-	    else
-		goto nomsg;
-	} else
-	    goto nomsg;
-
-	/* skip the next comma in CMGR and CMT responses */
-	tmp = octstr_search(buffer, octstr_imm(","), pos);
-	if (! privdata->modem->broken && tmp == -1)
-	    goto nomsg;
-	if (tmp != -1)
-	    pos = tmp + 1;
+        if ((pos = octstr_search(buffer, octstr_imm("+CMT:"), 0)) != -1)
+            pos += 5;
+        else if ((pos = octstr_search(buffer, octstr_imm("+CMGR:"), 0)) != -1) {
+            /* skip status field in +CMGR response */
+            if ((pos = octstr_search(buffer, octstr_imm(","), pos + 6)) != -1) 
+                pos++;
+            else
+                goto nomsg;
+        } else
+            goto nomsg;
+
+        /* skip the next comma in CMGR and CMT responses */
+        tmp = octstr_search(buffer, octstr_imm(","), pos);
+        if (! privdata->modem->broken && tmp == -1)
+            goto nomsg;
+        if (tmp != -1)
+            pos = tmp + 1;
     }
 
     /* read the message length */
@@ -1226,8 +1231,8 @@
             msg = at2_pdu_decode_deliver_sm(data, privdata);
             break;
         case AT_STATUS_REPORT_SM:
-	    msg = at2_pdu_decode_report_sm(data, privdata);
-	    break;
+            msg = at2_pdu_decode_report_sm(data, privdata);
+            break;
 
             /* Add other message types here: */
 
@@ -1432,7 +1437,7 @@
               octstr_get_cstr(privdata->name), octstr_get_cstr(receiver));
         pos += (len + 1) / 2;
     } else {
-	int i;
+        int i;
         receiver = octstr_create("");
         if ((ntype & 0x90) == 0x90) {
             /* International number */
@@ -1451,54 +1456,54 @@
     pos += 14; /* skip time stamps for now */
 
     if ((type = octstr_get_char(pdu, pos)) == -1 ) {
-	error(1,"AT2[%s]: STATUS-REPORT pdu too short to have TP-Status field !",
-	    octstr_get_cstr(privdata->name));
-	goto error;
+        error(1,"AT2[%s]: STATUS-REPORT pdu too short to have TP-Status field !",
+            octstr_get_cstr(privdata->name));
+        goto error;
     }
 
-	/* check DLR type:
-	 * 3GPP TS 23.040 defines this a bit mapped field with lots of options
-	 * most of which are not really intersting to us, as we are only interested
-	 * in one of three conditions : failed, held in SC for delivery later, or delivered successfuly
-	 * and here's how I suggest to test it (read the 3GPP reference for further detailes) -
-	 * we'll test the 6th and 5th bits (7th bit when set making all other values 'reseved' so I want to test it).
-	 */
+        /* check DLR type:
+         * 3GPP TS 23.040 defines this a bit mapped field with lots of options
+         * most of which are not really intersting to us, as we are only interested
+         * in one of three conditions : failed, held in SC for delivery later, or delivered successfuly
+         * and here's how I suggest to test it (read the 3GPP reference for further detailes) -
+         * we'll test the 6th and 5th bits (7th bit when set making all other values 'reseved' so I want to test it).
+         */
     type = type & 0xE0; /* filter out everything but the 7th, 6th and 5th bits */
     switch (type) {
-	case 0x00:
-	    /* 0 0 : success class */
-	    type = DLR_SUCCESS;
-	    tmpstr = octstr_create("Success/");
-	    break;
-	case 0x20:
-	    /* 0 1 : buffered class (temporary error) */
-	    type = DLR_BUFFERED;
-	    tmpstr = octstr_create("Buffered/");
-	    break;
-	case 0x40:
-	case 0x60:
-	default:
-	    /* 1 0 : failed class */
-	    /* 1 1 : failed class (actually, temporary error but timed out) */
-	    /* and any other value (can't think of any) is considered failure */
-	    type = DLR_FAIL;
-	    tmpstr = octstr_create("Failed/");
-	    break;
+        case 0x00:
+            /* 0 0 : success class */
+            type = DLR_SUCCESS;
+            tmpstr = octstr_create("Success");
+            break;
+        case 0x20:
+            /* 0 1 : buffered class (temporary error) */
+            type = DLR_BUFFERED;
+            tmpstr = octstr_create("Buffered");
+            break;
+        case 0x40:
+        case 0x60:
+        default:
+            /* 1 0 : failed class */
+            /* 1 1 : failed class (actually, temporary error but timed out) */
+            /* and any other value (can't think of any) is considered failure */
+            type = DLR_FAIL;
+            tmpstr = octstr_create("Failed");
+            break;
     }
     /* Actually, the above implementation is not correct, as the reference says that implementations should consider
      * any "reserved" values to be "failure", but most reserved values fall into one of the three categories. it will catch
      * "reserved" values where the first 3 MSBits are not set as "Success" which may not be correct. */
 
     if ((dlrmsg = dlr_find(octstr_get_cstr(privdata->conn->id),
-	    octstr_get_cstr(msg_id), octstr_get_cstr(receiver), type)) == NULL) {
-	debug("bb.smsc.at2",1,"AT2[%s]: Received delivery notification but can't find that ID in the DLR storage",
-	    octstr_get_cstr(privdata->name));
-	    goto error;
+            octstr_get_cstr(msg_id), octstr_get_cstr(receiver), type)) == NULL) {
+        debug("bb.smsc.at2",1,"AT2[%s]: Received delivery notification but can't find that ID in the DLR storage",
+            octstr_get_cstr(privdata->name));
+            goto error;
     }
 
     /* Beware DLR URL is now in msg->sms.dlr_url given by dlr_find() */
     dlrmsg->sms.msgdata = octstr_duplicate(tmpstr);
-	
+
 error:
     O_DESTROY(tmpstr);
     O_DESTROY(pdu);
@@ -1575,7 +1580,7 @@
 
     do {
         if (privdata->modem->enable_mms && 
-			list_len(privdata->outgoing_queue) > 1)
+                list_len(privdata->outgoing_queue) > 1)
             at2_send_modem_command(privdata, "AT+CMMS=2", 0, 0);
 
         if ((msg = list_extract_first(privdata->outgoing_queue)))
@@ -1608,17 +1613,17 @@
         strcpy(sc, "00");
 
     if (msg_type(msg) == sms) {
-	Octstr* pdu;
+        Octstr* pdu;
 
-	if ((pdu = at2_pdu_encode(msg, privdata)) == NULL) {
-	    error(2, "AT2[%s]: Error encoding PDU!",octstr_get_cstr(privdata->name));
-	    return;
-	}	
+        if ((pdu = at2_pdu_encode(msg, privdata)) == NULL) {
+            error(2, "AT2[%s]: Error encoding PDU!",octstr_get_cstr(privdata->name));
+            return;
+        }
 
         ret = -99;
         retries = RETRY_SEND;
         while ((ret != 0) && (retries-- > 0)) {
-	    int msg_id = -1;
+            int msg_id = -1;
             /* 
              * send the initial command and then wait for > 
              */
@@ -1646,13 +1651,13 @@
             if (ret != 0) /* OK only */
                 continue;
 
-	    /* gen DLR_SMSC_SUCCESS */
-	    if (msg->sms.dlr_mask & DLR_SMSC_SUCCESS)
-	    {
-		Msg* dlrmsg;
+            /* gen DLR_SMSC_SUCCESS */
+            if (msg->sms.dlr_mask & DLR_SMSC_SUCCESS)
+            {
+                Msg* dlrmsg;
 
-		dlrmsg = msg_create(sms);
-		dlrmsg->sms.id = msg->sms.id;
+                dlrmsg = msg_create(sms);
+                dlrmsg->sms.id = msg->sms.id;
                 dlrmsg->sms.service = octstr_duplicate(msg->sms.service);
                 dlrmsg->sms.dlr_mask = DLR_SMSC_SUCCESS;
                 dlrmsg->sms.sms_type = report;
@@ -1663,41 +1668,41 @@
                 octstr_append(dlrmsg->sms.msgdata,msg->sms.dlr_url);
                 time(&dlrmsg->sms.time);
 
-		debug("bb.smsc.at2",0,"AT2[%s]: sending DLR type ACK", octstr_get_cstr(privdata->name));
-		bb_smscconn_receive(privdata->conn, dlrmsg);
+                debug("bb.smsc.at2",0,"AT2[%s]: sending DLR type ACK", octstr_get_cstr(privdata->name));
+                bb_smscconn_receive(privdata->conn, dlrmsg);
 
-	    }
+            }
 
-	    /* store DLR message if needed for SMSC generated delivery reports */
-	    if (msg->sms.dlr_mask & (DLR_SUCCESS | DLR_FAIL | DLR_BUFFERED)) {
-		if (msg_id == -1)
-		    error(0,"AT2[%s]: delivery notification requested, but I have no message ID!",
-			octstr_get_cstr(privdata->name));
-		 else {
+            /* store DLR message if needed for SMSC generated delivery reports */
+            if (msg->sms.dlr_mask & (DLR_SUCCESS | DLR_FAIL | DLR_BUFFERED)) {
+                if (msg_id == -1)
+                    error(0,"AT2[%s]: delivery notification requested, but I have no message ID!",
+                        octstr_get_cstr(privdata->name));
+                 else {
             Octstr *dlrmsgid = octstr_format("%d", msg_id);
 
             dlr_add(octstr_get_cstr(privdata->conn->id),
                     octstr_get_cstr(dlrmsgid),
-			        octstr_get_cstr(msg->sms.sender),
-			        octstr_get_cstr(msg->sms.receiver),
-			        octstr_get_cstr(msg->sms.service),
-			        octstr_get_cstr(msg->sms.dlr_url),
-			        msg->sms.dlr_mask);
-				
-		    O_DESTROY(dlrmsgid);
-		}
-	    }
+                                octstr_get_cstr(msg->sms.sender),
+                                octstr_get_cstr(msg->sms.receiver),
+                                octstr_get_cstr(msg->sms.service),
+                                octstr_get_cstr(msg->sms.dlr_url),
+                                msg->sms.dlr_mask);
+
+                    O_DESTROY(dlrmsgid);
+                }
+            }
 
             counter_increase(privdata->conn->sent);
             bb_smscconn_sent(privdata->conn, msg);
         }
 
         if (ret != 0) {
-	    /* gen DLR_SMSC_FAIL */
-	    if (msg->sms.dlr_mask & DLR_SMSC_FAIL) {
-		Msg* dlrmsg;
+            /* gen DLR_SMSC_FAIL */
+            if (msg->sms.dlr_mask & DLR_SMSC_FAIL) {
+                Msg* dlrmsg;
 
-		dlrmsg = msg_create(sms);
+                dlrmsg = msg_create(sms);
                 dlrmsg->sms.service = octstr_duplicate(msg->sms.service);
                 dlrmsg->sms.dlr_mask = DLR_SMSC_FAIL;
                 dlrmsg->sms.sms_type = report;
@@ -1708,9 +1713,9 @@
                 octstr_append(dlrmsg->sms.msgdata,msg->sms.dlr_url);
                 time(&dlrmsg->sms.time);
 
-		debug("bb.smsc.at2",0,"AT2[%s]: sending DLR type NACK", octstr_get_cstr(privdata->name));
-		bb_smscconn_receive(privdata->conn, dlrmsg);
-	    }
+                debug("bb.smsc.at2",0,"AT2[%s]: sending DLR type NACK", octstr_get_cstr(privdata->name));
+                bb_smscconn_receive(privdata->conn, dlrmsg);
+            }
 
             /*
              * no need to do counter_increase(privdata->conn->failed) here, 
@@ -1741,25 +1746,25 @@
      * TP-RP , TP-UDHI, TP-SRR, TP-VPF(4), TP-VPF(3), TP-RD, TP-MTI(1), TP-MTI(0)
      */
     octstr_append_char(buffer,
-	((msg->sms.rpi ? 1 : 0) << 7) /* TP-RP */
-	| ((octstr_len(msg->sms.udhdata)  ? 1 : 0) << 6) /* TP-UDHI */
-	| (((msg->sms.dlr_mask & (DLR_SUCCESS | DLR_FAIL | DLR_BUFFERED)) ? 1 : 0) << 5) /* TP-SRR */
-	| 16 /* TP-VP(Rel)*/
-	| 1 /* TP-MTI: SUBMIT_SM */
-	);
+        ((msg->sms.rpi ? 1 : 0) << 7) /* TP-RP */
+        | ((octstr_len(msg->sms.udhdata)  ? 1 : 0) << 6) /* TP-UDHI */
+        | (((msg->sms.dlr_mask & (DLR_SUCCESS | DLR_FAIL | DLR_BUFFERED)) ? 1 : 0) << 5) /* TP-SRR */
+        | 16 /* TP-VP(Rel)*/
+        | 1 /* TP-MTI: SUBMIT_SM */
+        );
 
     /* message reference (0 for now) */
     octstr_append_char(buffer, 0);
 
     /* destination address */
     if ((temp = at2_format_address_field(msg->sms.receiver)) == NULL)
-	goto error;
+        goto error;
     octstr_append(buffer, temp);
     O_DESTROY(temp);
 
     octstr_append_char(buffer, msg->sms.pid); /* protocol identifier */
     octstr_append_char(buffer, fields_to_dcs(msg, /* data coding scheme */
-	(msg->sms.alt_dcs ? 2 - msg->sms.alt_dcs : privdata->alt_dcs)));
+        (msg->sms.alt_dcs ? 2 - msg->sms.alt_dcs : privdata->alt_dcs)));
 
     /* 
      * Validity-Period (TP-VP)
@@ -1832,7 +1837,7 @@
     octstr_append_char(buffer,len);
 
     if (octstr_len(msg->sms.udhdata)) /* udh */
-	octstr_append(buffer, msg->sms.udhdata);
+        octstr_append(buffer, msg->sms.udhdata);
 
     /* user data */
     if (msg->sms.coding == DC_8BIT || msg->sms.coding == DC_UCS2) {
@@ -1852,7 +1857,7 @@
         charset_latin1_to_gsm(msg->sms.msgdata);
         
         if ((temp = at2_encode7bituncompressed(msg->sms.msgdata, offset)) != NULL)
-	    octstr_append(buffer, temp);
+            octstr_append(buffer, temp);
         O_DESTROY(temp);
     }
 
@@ -1880,24 +1885,24 @@
 
     /* start packing the septet stream into an octet stream */
     for (posS = 0, posT = 0; (source_chr = octstr_get_char(source, posS++)) != -1;) {
-	/* grab least significant bits from current septet and store them packed to the right */
-	target_chr |= (source_chr & LSBmask[i]) << iStore;
-	/* store current byte if last command filled it */
-	if (iStore != 0) {
-	    octstr_append_char(target, target_chr);
-	    target_chr = 0;
-	}
-	/* grab most significant bits from current septet and store them packed to the left */
-	target_chr |= (source_chr & MSBmask[7 - i]) >> (8 - iStore) % 8;
-	/* advance target bit index by 7 ( modulo 8 addition ) */
-	iStore = (--iStore < 0 ? 7 : iStore);
-	if (iStore != 0) /* if just finished packing 8 septets (into 7 octets) don't advance mask index */
-	    i = (++i > 7 ? 1 : i); 
+        /* grab least significant bits from current septet and store them packed to the right */
+        target_chr |= (source_chr & LSBmask[i]) << iStore;
+        /* store current byte if last command filled it */
+        if (iStore != 0) {
+            octstr_append_char(target, target_chr);
+            target_chr = 0;
+        }
+        /* grab most significant bits from current septet and store them packed to the left */
+        target_chr |= (source_chr & MSBmask[7 - i]) >> (8 - iStore) % 8;
+        /* advance target bit index by 7 ( modulo 8 addition ) */
+        iStore = (--iStore < 0 ? 7 : iStore);
+        if (iStore != 0) /* if just finished packing 8 septets (into 7 octets) don't advance mask index */
+            i = (++i > 7 ? 1 : i); 
     }
 
     /* don't forget to pack the leftovers ;-) */
     if (target_chr)
-	octstr_append_char(target, target_chr);
+        octstr_append_char(target, target_chr);
 
     return target;
 }
@@ -1938,10 +1943,10 @@
           octstr_get_cstr(privdata->name));
 
     for (i = 0; i < (sizeof(autospeeds) / sizeof(int)); i++) {
-	if(at2_test_speed(privdata, autospeeds[i]) == 0) {
-	    privdata->speed = autospeeds[i];
-	    break;
-	}
+        if(at2_test_speed(privdata, autospeeds[i]) == 0) {
+            privdata->speed = autospeeds[i];
+            break;
+        }
     }
     if (privdata->speed == 0) {
         info(0, "AT2[%s]: cannot detect speed", octstr_get_cstr(privdata->name));
@@ -1956,7 +1961,7 @@
     int res;
 
     if (at2_open_device1(privdata) == -1)
-	return -1;
+        return -1;
 
     at2_set_speed(privdata, speed);
     /* send a return so the modem can detect the speed */
@@ -1964,9 +1969,9 @@
     res = at2_send_modem_command(privdata, "AT", 0, 0);
 
     if (res != 0)
-	res = at2_send_modem_command(privdata, "AT", 0, 0);
+        res = at2_send_modem_command(privdata, "AT", 0, 0);
     if (res != 0)
-	res = at2_send_modem_command(privdata, "AT", 0, 0);
+        res = at2_send_modem_command(privdata, "AT", 0, 0);
     at2_close_device(privdata);
 
     return res;
@@ -2228,7 +2233,7 @@
      * others are national.
      */
     if (strncmp(octstr_get_cstr(msisdn), "+", 1) == 0) {
-	octstr_delete(temp, 0, 1);
+        octstr_delete(temp, 0, 1);
         ntype = PNT_INTER; /* international */
     } else if (strncmp(octstr_get_cstr(msisdn), "00", 2) == 0) {
         octstr_delete(temp, 0, 2);
@@ -2240,19 +2245,19 @@
 
     /* Type of address : bit mapped values */
     octstr_append_char(out, 0x80 /* Type-of-address prefix */ |
-			    0x01 /* Numbering-plan: MSISDN */ |
-			    (ntype == PNT_INTER ? 0x10 : 0x00) /* Type-of-number: International or National */
-			    );
+                            0x01 /* Numbering-plan: MSISDN */ |
+                            (ntype == PNT_INTER ? 0x10 : 0x00) /* Type-of-number: International or National */
+                            );
 
     /* grab the digits from the MSISDN and encode as swapped semi-octets */
     while (octstr_len(temp)) {
-	int digit1, digit2;
-	/* get the first two digit */
-	digit1 = octstr_get_char(temp,0) - 48;
-	if ((digit2 = octstr_get_char(temp,1) - 48) < 0)
-	    digit2 = 0x0F;
-	octstr_append_char(out, (digit2 << 4) | digit1);
-	octstr_delete(temp, 0, 2);
+        int digit1, digit2;
+        /* get the first two digit */
+        digit1 = octstr_get_char(temp,0) - 48;
+        if ((digit2 = octstr_get_char(temp,1) - 48) < 0)
+            digit2 = 0x0F;
+        octstr_append_char(out, (digit2 << 4) | digit1);
+        octstr_delete(temp, 0, 2);
     }
 
     O_DESTROY(temp);
