Re: How to override GSM encoding ? (Kannel 1.4.1-2 / Debian)
Hi Stipe, Thank you for your answer. Ok, i'll try to test gw/sms.c:fields_to_dcs(). So, is there a temporaly hack to force dcs to 0 ? Regards, Olivier PELLEGRINO MIL'NR3 Le jeudi 07 février 2008 à 15:42 +0100, Stipe Tolj a écrit : Olivier PELLEGRINO schrieb: Output: 2008-02-05 15:42:28 [20444] [14] DEBUG: [debug perso #1] msg-sms.alt_dcs: -1, smpp-conn-alt_dcs: 0, pdu-u.submit_sm.data_coding: 0, SMPP_DEFAULT_CHARSET: UTF-8, smpp-alt_charset: ISO-8859-1 2008-02-05 15:42:28 [20444] [14] DEBUG: [debug perso #2] if condition 2008-02-05 15:42:28 [20444] [14] DEBUG: [debug perso #3] msg-sms.alt_dcs: -1, smpp-conn-alt_dcs: 0, pdu-u.submit_sm.data_coding: 241, SMPP_DEFAULT_CHARSET: UTF-8, smpp-alt_charset: ISO-8859-1 ok, which proves that the submit_sm.data_coding = 241 is set within the if condition branch, hence via fields_to_dcs(msg, 1); Please check within gw/sms.c:fields_to_dcs() which if branch set the dcs value accordingly. Stipe --- Kölner Landstrasse 419 40589 Düsseldorf, NRW, Germany tolj.org system architecture Kannel Software Foundation (KSF) http://www.tolj.org/ http://www.kannel.org/ mailto:st_{at}_tolj.org mailto:stolj_{at}_kannel.org ---
Re: How to override GSM encoding ? (Kannel 1.4.1-2 / Debian)
Hi, The wrong dcs value is fixed in this part (gw/sms.c) : /* mode 1 */ else { debug(bb.sms.smpp, 0, [debug perso #1] dcs: %d, dcs); dcs |= 0xF0; /* sets bits 7-3 */ debug(bb.sms.smpp, 0, [debug perso #2] dcs: %d, dcs); if(msg-sms.coding != DC_UNDEF){ dcs |= (msg-sms.coding 2); /* only DC_7BIT or DC_8BIT, sets bit 2*/ debug(bb.sms.smpp, 0, [debug perso #3] dcs: %d, dcs); } if (msg-sms.mclass == MC_UNDEF){ dcs |= 1; /* default meaning: ME specific */ debug(bb.sms.smpp, 0, [debug perso #4] dcs: %d, dcs); }else{ dcs |= msg-sms.mclass; /* sets bit 1,0 */ debug(bb.sms.smpp, 0, [debug perso #5] dcs: %d, dcs); } debug(bb.sms.smpp, 0, [debug perso #6] dcs: %d, dcs); } Logs : 2008-02-07 17:37:18 [11772] [14] DEBUG: [debug perso #1] dcs: 0 2008-02-07 17:37:18 [11772] [14] DEBUG: [debug perso #2] dcs: 240 2008-02-07 17:37:18 [11772] [14] DEBUG: [debug perso #3] dcs: 240 2008-02-07 17:37:18 [11772] [14] DEBUG: [debug perso #5] dcs: 241 2008-02-07 17:37:18 [11772] [14] DEBUG: [debug perso #6] dcs: 241 Regards, Olivier PELLEGRINO MIL'NR3 Le jeudi 07 février 2008 à 15:42 +0100, Stipe Tolj a écrit : Olivier PELLEGRINO schrieb: Output: 2008-02-05 15:42:28 [20444] [14] DEBUG: [debug perso #1] msg-sms.alt_dcs: -1, smpp-conn-alt_dcs: 0, pdu-u.submit_sm.data_coding: 0, SMPP_DEFAULT_CHARSET: UTF-8, smpp-alt_charset: ISO-8859-1 2008-02-05 15:42:28 [20444] [14] DEBUG: [debug perso #2] if condition 2008-02-05 15:42:28 [20444] [14] DEBUG: [debug perso #3] msg-sms.alt_dcs: -1, smpp-conn-alt_dcs: 0, pdu-u.submit_sm.data_coding: 241, SMPP_DEFAULT_CHARSET: UTF-8, smpp-alt_charset: ISO-8859-1 ok, which proves that the submit_sm.data_coding = 241 is set within the if condition branch, hence via fields_to_dcs(msg, 1); Please check within gw/sms.c:fields_to_dcs() which if branch set the dcs value accordingly. Stipe --- Kölner Landstrasse 419 40589 Düsseldorf, NRW, Germany tolj.org system architecture Kannel Software Foundation (KSF) http://www.tolj.org/ http://www.kannel.org/ mailto:st_{at}_tolj.org mailto:stolj_{at}_kannel.org ---
Re: How to override GSM encoding ? (Kannel 1.4.1-2 / Debian)
Hi Stipe, Ok, i understand. So, it's possible to have a dcs value of 0 ONLY when we send flash sms (directly displayed) ?! I need dcs=0 also with normal sms (sms to mobile) ... Is it possible ? Thanks. Regards, Olivier PELLEGRINO MIL'NR3 Le jeudi 07 février 2008 à 18:54 +0100, Stipe Tolj a écrit : Olivier PELLEGRINO schrieb: Hi, The wrong dcs value is fixed in this part (gw/sms.c) : /* mode 1 */ else { debug(bb.sms.smpp, 0, [debug perso #1] dcs: %d, dcs); dcs |= 0xF0; /* sets bits 7-3 */ debug(bb.sms.smpp, 0, [debug perso #2] dcs: %d, dcs); if(msg-sms.coding != DC_UNDEF){ dcs |= (msg-sms.coding 2); /* only DC_7BIT or DC_8BIT, sets bit 2*/ debug(bb.sms.smpp, 0, [debug perso #3] dcs: %d, dcs); } if (msg-sms.mclass == MC_UNDEF){ dcs |= 1; /* default meaning: ME specific */ debug(bb.sms.smpp, 0, [debug perso #4] dcs: %d, dcs); }else{ dcs |= msg-sms.mclass; /* sets bit 1,0 */ debug(bb.sms.smpp, 0, [debug perso #5] dcs: %d, dcs); } debug(bb.sms.smpp, 0, [debug perso #6] dcs: %d, dcs); } Logs : 2008-02-07 17:37:18 [11772] [14] DEBUG: [debug perso #1] dcs: 0 2008-02-07 17:37:18 [11772] [14] DEBUG: [debug perso #2] dcs: 240 ok, this means we have this within gw/smsc/smsc_smpp.c: /* * set the data coding scheme (DCS) field * check if we have a forced value for this from the smsc-group. * Note: if message class is set, then we _must_ force alt_dcs otherwise * dcs has reserved values (e.g. mclass=2, dcs=0x11). We check MWI flag * first here, because MWI and MCLASS can not be set at the same time and * function fields_to_dcs check MWI first, so we have no need to force alt_dcs * if MWI is set. */ if (msg-sms.mwi == MWI_UNDEF msg-sms.mclass != MC_UNDEF) pdu-u.submit_sm.data_coding = fields_to_dcs(msg, 1); /* force alt_dcs */ else hence mclass IS SET, correct? checking your mail resolved that you DID send: X-Kannel-Mclass: 1 Bingo, that's the reason we are forced to set the dcs value. If you need dcs=0, ensure you don't send mclass towards smsbox. Stipe --- Kölner Landstrasse 419 40589 Düsseldorf, NRW, Germany tolj.org system architecture Kannel Software Foundation (KSF) http://www.tolj.org/ http://www.kannel.org/ mailto:st_{at}_tolj.org mailto:stolj_{at}_kannel.org ---
Re: How to override GSM encoding ? (Kannel 1.4.1-2 / Debian)
Olivier PELLEGRINO schrieb: Hi, The wrong dcs value is fixed in this part (gw/sms.c) : /* mode 1 */ else { debug(bb.sms.smpp, 0, [debug perso #1] dcs: %d, dcs); dcs |= 0xF0; /* sets bits 7-3 */ debug(bb.sms.smpp, 0, [debug perso #2] dcs: %d, dcs); if(msg-sms.coding != DC_UNDEF){ dcs |= (msg-sms.coding 2); /* only DC_7BIT or DC_8BIT, sets bit 2*/ debug(bb.sms.smpp, 0, [debug perso #3] dcs: %d, dcs); } if (msg-sms.mclass == MC_UNDEF){ dcs |= 1; /* default meaning: ME specific */ debug(bb.sms.smpp, 0, [debug perso #4] dcs: %d, dcs); }else{ dcs |= msg-sms.mclass; /* sets bit 1,0 */ debug(bb.sms.smpp, 0, [debug perso #5] dcs: %d, dcs); } debug(bb.sms.smpp, 0, [debug perso #6] dcs: %d, dcs); } Logs : 2008-02-07 17:37:18 [11772] [14] DEBUG: [debug perso #1] dcs: 0 2008-02-07 17:37:18 [11772] [14] DEBUG: [debug perso #2] dcs: 240 ok, this means we have this within gw/smsc/smsc_smpp.c: /* * set the data coding scheme (DCS) field * check if we have a forced value for this from the smsc-group. * Note: if message class is set, then we _must_ force alt_dcs otherwise * dcs has reserved values (e.g. mclass=2, dcs=0x11). We check MWI flag * first here, because MWI and MCLASS can not be set at the same time and * function fields_to_dcs check MWI first, so we have no need to force alt_dcs * if MWI is set. */ if (msg-sms.mwi == MWI_UNDEF msg-sms.mclass != MC_UNDEF) pdu-u.submit_sm.data_coding = fields_to_dcs(msg, 1); /* force alt_dcs */ else hence mclass IS SET, correct? checking your mail resolved that you DID send: X-Kannel-Mclass: 1 Bingo, that's the reason we are forced to set the dcs value. If you need dcs=0, ensure you don't send mclass towards smsbox. Stipe --- Kölner Landstrasse 419 40589 Düsseldorf, NRW, Germany tolj.org system architecture Kannel Software Foundation (KSF) http://www.tolj.org/ http://www.kannel.org/ mailto:st_{at}_tolj.org mailto:stolj_{at}_kannel.org ---
Re: How to override GSM encoding ? (Kannel 1.4.1-2 / Debian)
Olivier PELLEGRINO schrieb: Output: 2008-02-05 15:42:28 [20444] [14] DEBUG: [debug perso #1] msg-sms.alt_dcs: -1, smpp-conn-alt_dcs: 0, pdu-u.submit_sm.data_coding: 0, SMPP_DEFAULT_CHARSET: UTF-8, smpp-alt_charset: ISO-8859-1 2008-02-05 15:42:28 [20444] [14] DEBUG: [debug perso #2] if condition 2008-02-05 15:42:28 [20444] [14] DEBUG: [debug perso #3] msg-sms.alt_dcs: -1, smpp-conn-alt_dcs: 0, pdu-u.submit_sm.data_coding: 241, SMPP_DEFAULT_CHARSET: UTF-8, smpp-alt_charset: ISO-8859-1 ok, which proves that the submit_sm.data_coding = 241 is set within the if condition branch, hence via fields_to_dcs(msg, 1); Please check within gw/sms.c:fields_to_dcs() which if branch set the dcs value accordingly. Stipe --- Kölner Landstrasse 419 40589 Düsseldorf, NRW, Germany tolj.org system architecture Kannel Software Foundation (KSF) http://www.tolj.org/ http://www.kannel.org/ mailto:st_{at}_tolj.org mailto:stolj_{at}_kannel.org ---
Re: How to override GSM encoding ? (Kannel 1.4.1-2 / Debian)
Hi Stipe, Thank you for your answer. 1/ This was done : Kannel bearerbox version `cvs-20080202'. Build `Feb 5 2008 13:58:17', compiler `3.3.5 (Debian 1:3.3.5-13)'. 2/ How i proceed to debug : debug(bb.sms.smpp, 0, [debug perso #1] msg-sms.alt_dcs: %d, smpp-conn-alt_dcs: %d, pdu-u.submit_sm.data_coding: %d, SMPP_DEFAULT_CHARSET: %s, smpp-alt_charset: %s, msg-sms.alt_dcs, smpp-conn-alt_dcs, pdu-u.submit_sm.data_coding, SMPP_DEFAULT_CHARSET, octstr_get_cstr(smpp-alt_charset)); if (msg-sms.mwi == MWI_UNDEF msg-sms.mclass != MC_UNDEF){ pdu-u.submit_sm.data_coding = fields_to_dcs(msg, 1); /* force alt_dcs */ debug(bb.sms.smpp, 0, [debug perso #2] if condition); }else{ pdu-u.submit_sm.data_coding = fields_to_dcs(msg, (msg-sms.alt_dcs != SMS_PARAM_UNDEFINED ? msg-sms.alt_dcs : smpp-conn-alt_dcs)); debug(bb.sms.smpp, 0, [debug perso #2] else condition, arg value: %d, (msg-sms.alt_dcs != SMS_PARAM_UNDEFINED ? msg-sms.alt_dcs : smpp-conn-alt_dcs)); } debug(bb.sms.smpp, 0, [debug perso #3] msg-sms.alt_dcs: %d, smpp-conn-alt_dcs: %d, pdu-u.submit_sm.data_coding: %d, SMPP_DEFAULT_CHARSET: %s, smpp-alt_charset: %s, msg-sms.alt_dcs, smpp-conn-alt_dcs, pdu-u.submit_sm.data_coding, SMPP_DEFAULT_CHARSET, octstr_get_cstr(smpp-alt_charset)); Output: 2008-02-05 15:42:28 [20444] [14] DEBUG: [debug perso #1] msg-sms.alt_dcs: -1, smpp-conn-alt_dcs: 0, pdu-u.submit_sm.data_coding: 0, SMPP_DEFAULT_CHARSET: UTF-8, smpp-alt_charset: ISO-8859-1 2008-02-05 15:42:28 [20444] [14] DEBUG: [debug perso #2] if condition 2008-02-05 15:42:28 [20444] [14] DEBUG: [debug perso #3] msg-sms.alt_dcs: -1, smpp-conn-alt_dcs: 0, pdu-u.submit_sm.data_coding: 241, SMPP_DEFAULT_CHARSET: UTF-8, smpp-alt_charset: ISO-8859-1 [...] 2008-02-05 15:42:28 [20444] [14] DEBUG: data_coding: 241 = 0x00f1 [...] 3/ Yes, sorry! Thanks. Regards, Olivier PELLEGRINO MIL'NR3 Le mardi 05 février 2008 à 12:27 +0100, Stipe Tolj a écrit : Olivier PELLEGRINO schrieb: Hi Stipe, I compiled kannel from sources (from http://www.kannel.org/download/1.4.1/deb/kannel_1.4.1.orig.tar.gz) and added this ligne beside the ifelse conditions : debug(bb.sms.smpp, 0, [debug perso] msg-sms.alt_dcs: %d, smpp-conn-alt_dcs: %d, pdu-u.submit_sm.data_coding: %d, SMPP_DEFAULT_CHARSET: %s, smpp-alt_charset: %s, msg-sms.alt_dcs, smpp-conn-alt_dcs, pdu-u.submit_sm.data_coding, SMPP_DEFAULT_CHARSET, octstr_get_cstr(smpp-alt_charset)); I have this logs in my smppXX.log : 2008-02-05 09:37:18 [10861] [14] DEBUG: [debug perso] msg-sms.alt_dcs: -1, smpp-conn-alt_dcs: 0, pdu-u.submit_sm.data_coding: 241, SMPP_DEFAULT_CHARSET: windows-1252, smpp-alt_charset: ISO-8859-1 [...] 2008-02-05 09:37:18 [10861] [14] DEBUG: data_coding: 241 = 0x00f1 [...] Is it what you expected from me ? I'm not a confirmed user.. thanks for engaging, we need to guide you some more ;) 1. please use CVS HEAD version from your CVS repository. You downloaded the stable 1.4.1 source tree, which is almost 1,5 years old. The CVS HEAD branch is a 1.4.2RC. See the download web site page for instructions on how to pull the CVS HEAD tree. 2. most interesting is the 'pdu-u.submit_sm.data_coding' value here. Please add debug() output before the fields_to_dcs() calls and after to identify which element really sets the 241 value. 3. Please keep the discussion on the mailing list, at least as CC, so others benefit or can help out in a discussion way. Thanks, Stipe --- Kölner Landstrasse 419 40589 Düsseldorf, NRW, Germany tolj.org system architecture Kannel Software Foundation (KSF) http://www.tolj.org/ http://www.kannel.org/ mailto:st_{at}_tolj.org mailto:stolj_{at}_kannel.org ---
Re: How to override GSM encoding ? (Kannel 1.4.1-2 / Debian)
aspect schrieb: Hi, I am using Kannel 1.4.1-2 under Debian. Here is my problem : I can't override data_coding in my SMPP output from 241 to 0. I always have DEBUG: data_coding: 241 = 0x00f1 but i want data_coding=0 ... Does anybody know a solution, please? Parts of my kannel.conf : # User group = sendsms-user username = smsbox-df password = xxx forced-smsc = smppf #default-smsc = smppf name = userfra user-deny-ip = *.*.*.* user-allow-ip = 127.0.0.*;xxx.xxx.xxx.xxx max-messages = 1 concatenation = 1 omit-empty = 1 white-list-regex = ^(00|\+)?336 #a smsc group = smsc smsc = smpp smsc-id = smppf throughput = 15 host = xxx port = xxx receive-port = xxx smsc-username = xxx smsc-password = xxx system-type = xxx log-file = /var/log/kannel/smpp6f.log log-level = 3 service-type = 12904 allowed-smsc-id = smppf msg-id-type=0x01 interface-version = 34 alt-charset = ISO-8859-1 HTTP request to kannel : SENT 21/01/2008 15:14:43 : POST /cgi-bin/sendsms HTTP/1.1 Host: xxx X-Kannel-Username: smsbox-df X-Kannel-Password: xxx X-Kannel-Smsbox-Id: smsbox1 X-Kannel-SMSC: smpp X-Kannel-UDH: X-Kannel-Coding: 0 X-Kannel-DLR-Mask: 31 X-Kannel-DLR-URL: xxx X-Kannel-Mclass: 1 X-Kannel-From: X-Kannel-To: 336 Content-Length: 29 Content-Type: text/plain; charset=ISO-8859-1 Content-Encoding: ISO-8859-1 Connection: Close Ceci est un test [EMAIL PROTECTED]# RECEIVED 21/01/2008 15:14:43 : HTTP/1.1 202 Accepted Server: Kannel/1.4.1 Content-Length: 24 Connection: close Content-type: text/html Pragma: no-cache Cache-Control: no-cache 0: Accepted for delivery My debug logs : 2008-01-21 15:14:28 [21723] [6] DEBUG: SMPP[smppf]: Sending PDU: 2008-01-21 15:14:28 [21723] [6] DEBUG: SMPP PDU 0x81d0398 dump: 2008-01-21 15:14:28 [21723] [6] DEBUG: type_name: submit_sm 2008-01-21 15:14:28 [21723] [6] DEBUG: command_id: 4 = 0x0004 2008-01-21 15:14:28 [21723] [6] DEBUG: command_status: 0 = 0x 2008-01-21 15:14:28 [21723] [6] DEBUG: sequence_number: 7 = 0x0007 2008-01-21 15:14:28 [21723] [6] DEBUG: service_type: 12904 2008-01-21 15:14:28 [21723] [6] DEBUG: source_addr_ton: 2 = 0x0002 2008-01-21 15:14:28 [21723] [6] DEBUG: source_addr_npi: 1 = 0x0001 2008-01-21 15:14:28 [21723] [6] DEBUG: source_addr: 9056 2008-01-21 15:14:28 [21723] [6] DEBUG: dest_addr_ton: 2 = 0x0002 2008-01-21 15:14:28 [21723] [6] DEBUG: dest_addr_npi: 1 = 0x0001 2008-01-21 15:14:28 [21723] [6] DEBUG: destination_addr: 33620927062 2008-01-21 15:14:28 [21723] [6] DEBUG: esm_class: 3 = 0x0003 2008-01-21 15:14:28 [21723] [6] DEBUG: protocol_id: 0 = 0x 2008-01-21 15:14:28 [21723] [6] DEBUG: priority_flag: 0 = 0x 2008-01-21 15:14:28 [21723] [6] DEBUG: schedule_delivery_time: NULL 2008-01-21 15:14:28 [21723] [6] DEBUG: validity_period: NULL 2008-01-21 15:14:28 [21723] [6] DEBUG: registered_delivery: 1 = 0x0001 2008-01-21 15:14:28 [21723] [6] DEBUG: replace_if_present_flag: 0 = 0x 2008-01-21 15:14:28 [21723] [6] DEBUG: data_coding: 241 = 0x00f1 2008-01-21 15:14:28 [21723] [6] DEBUG: sm_default_msg_id: 0 = 0x 2008-01-21 15:14:28 [21723] [6] DEBUG: sm_length: 29 = 0x001d 2008-01-21 15:14:28 [21723] [6] DEBUG: short_message: 2008-01-21 15:14:28 [21723] [6] DEBUG:Octet string at 0x81da0d0: 2008-01-21 15:14:28 [21723] [6] DEBUG: len: 29 2008-01-21 15:14:28 [21723] [6] DEBUG: size: 30 2008-01-21 15:14:28 [21723] [6] DEBUG: immutable: 0 2008-01-21 15:14:28 [21723] [6] DEBUG: data: 43 65 63 69 20 65 73 74 20 75 6e 20 74 65 73 74 Ceci est un test 2008-01-21 15:14:28 [21723] [6] DEBUG: data: 20 05 04 65 65 7f 06 00 02 25 22 23 26 ..ee%# 2008-01-21 15:14:28 [21723] [6] DEBUG:Octet string dump ends. 2008-01-21 15:14:28 [21723] [6] DEBUG: SMPP PDU dump ends. Thank you in advance! this is indeed strange, I don't see a reason for the dcs=0xf1 here, as you don't use 'alt-dcs' in the smpp smsc group. can you please patch your local gw/smsc/smsc_smpp.c:msg_to_pdu():847 where the pdu-u.submit_sm.data_coding = fields_to_dcs(msg, xx); calls happen to see which dcs value you get after this if statement? Stipe --- Kölner Landstrasse 419 40589 Düsseldorf, NRW, Germany tolj.org system architecture Kannel Software Foundation (KSF) http://www.tolj.org/ http://www.kannel.org/ mailto:st_{at}_tolj.org mailto:stolj_{at}_kannel.org ---
Re: How to override GSM encoding ? (Kannel 1.4.1-2 / Debian)
Olivier PELLEGRINO schrieb: Hi Stipe, Thank you for your answer. I'm sorry but i was using .deb package (apt-get) to install Kannel. So, i don't have any *.c related to kannel on my server. I also have installed kannel-dev but there are only .h files. Should i compile Kannel from sources to proceed to your instructions and try to fix this issue ? yes, please checkout from CVS HEAD and compile on your own, including my suggested debug patching to see why you are getting that dcs values. Stipe --- Kölner Landstrasse 419 40589 Düsseldorf, NRW, Germany tolj.org system architecture Kannel Software Foundation (KSF) http://www.tolj.org/ http://www.kannel.org/ mailto:st_{at}_tolj.org mailto:stolj_{at}_kannel.org ---