Re: smpp esm_class config, go to config file
Alvaro Talavera <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
Here the diff.. (thanks Mathieu), this changes works perfect for me, i have connections with two operators smsc, one with esm_class = 0 and the other with esm_class = 3 The config group for smsc looks like this: group = smsc smsc = smpp host = "xxxxxx" port = "xxxx" smsc-id = "xxxxx" throughput = 40 denied-smsc-id = "*" allowed-smsc-id = "xxxxx" smsc-username = "xxxxxx" smsc-password = "xxxxxxx" system-type = "xxxxxxx" connect-allow-ip = "*.*.*.*" transceiver-mode = true reconnect-delay = 10 max-pending-submits=5 # validityperiod=720 validityperiod=60 # connection-timeout = 0 esm_class=3 # default 0 On Mar 18, 2009, at 5:01 PM, Alejandro Guerrieri wrote: > Hmm, maybe it's reversed? > -- > Alejandro Guerrieri > [email protected] > > > > On 18/03/2009, at 21:48, Mathieu Bruneau wrote: > >> Hi, >> Since this is kind of linked to the issue I had a few days ago. >> (Which i'll probably try your patch) I did a more convenient patch >> (easier for people to apply) >> >> @Alvaro: To provide patch in this format you can use the following >> command on most Unix/Linux style :) >> diff -ruh gateway-1.4.3/ gateway-1.4.3-esm_patch/ > esm_patch >> >> Mathieu Bruneau >> >> Alvaro Talavera a écrit : >>> >>> In response to this problem http://www.mail-archive.com/[email protected]/msg03528.html >>> , i write a patch to make the esm_class configurable from the smpp >>> group config. >>> >>> i think than this changes must appear in next versions of kannel: >>> >>> CHANGES: >>> ADD THIS LINES. >>> >>> + gwlib/cfg.def >>> line 345 - ADD OCTSTR(esm_class) >>> >>> + gw/smsc/smsc_smpp.c >>> - line 168, ADD >>> int esm_class_default; >>> >>> - line 221, CHANGE >>> long wait_ack, int wait_ack_action) >>> TO >>> long wait_ack, int wait_ack_action, int esm_class_default) >>> >>> - line 262, ADD >>> smpp->esm_class_default = esm_class_default; >>> >>> - line 853, CHANGE >>> pdu->u.submit_sm.esm_class = >>> ESM_CLASS_SUBMIT_STORE_AND_FORWARD_MODE; >>> TO >>> pdu->u.submit_sm.esm_class = smpp->esm_class_default; >>> >>> - line 2009, ADD >>> int esm_class_default; >>> >>> - line 2138, ADD (add a blank line "press enter" paste this, >>> and other line "press enter") >>> >>> if (cfg_get_integer(&esm_class_default, grp, >>> octstr_imm("esm_class")) == -1) >>> esm_class_default = ESM_CLASS_SUBMIT_DEFAULT_SMSC_MODE; >>> >>> - line 2151, CHANGE >>> service_type, connection_timeout, wait_ack, wait_ack_action); >>> TO >>> service_type, connection_timeout, wait_ack, wait_ack_action, >>> esm_class_default); >>> >>> >>> >>> In the attachments is the modified files.. >>> >>> >>> >> diff -ruh gateway-1.4.3/gw/smsc/smsc_smpp.c gateway-1.4.3-esm_patch/ >> gw/smsc/smsc_smpp.c >> --- gateway-1.4.3/gw/smsc/smsc_smpp.c 2009-03-18 20:38:50.000000000 >> +0000 >> +++ gateway-1.4.3-esm_patch/gw/smsc/smsc_smpp.c 2009-03-18 >> 20:41:14.000000000 +0000 >> @@ -165,7 +165,6 @@ >> long connection_timeout; >> long wait_ack; >> int wait_ack_action; >> - int esm_class_default; >> SMSCConn *conn; >> } SMPP; >> >> @@ -218,7 +217,7 @@ >> Octstr *my_number, int smpp_msg_id_type, >> int autodetect_addr, Octstr *alt_charset, >> Octstr *alt_addr_charset, >> Octstr *service_type, long >> connection_timeout, >> - long wait_ack, int wait_ack_action, int >> esm_class_default) >> + long wait_ack, int wait_ack_action) >> { >> SMPP *smpp; >> >> @@ -259,7 +258,6 @@ >> smpp->connection_timeout = connection_timeout; >> smpp->wait_ack = wait_ack; >> smpp->wait_ack_action = wait_ack_action; >> - smpp->esm_class_default = esm_class_default; >> smpp->bind_addr_ton = 0; >> smpp->bind_addr_npi = 0; >> >> @@ -848,13 +846,9 @@ >> >> /* >> * set the esm_class field >> - * Alvaro Talavera - [email protected] >> - * (original) >> - * pdu->u.submit_sm.esm_class = >> ESM_CLASS_SUBMIT_STORE_AND_FORWARD_MODE; >> - */ >> - >> - debug("bb.sms.smpp",0,"esm_class set in: %i", smpp- >> >esm_class_default); >> - pdu->u.submit_sm.esm_class = smpp->esm_class_default; >> + * default is store and forward, plus udh and rpi if requested >> + */ >> + pdu->u.submit_sm.esm_class = >> ESM_CLASS_SUBMIT_STORE_AND_FORWARD_MODE; >> if (octstr_len(msg->sms.udhdata)) >> pdu->u.submit_sm.esm_class = pdu->u.submit_sm.esm_class | >> ESM_CLASS_SUBMIT_UDH_INDICATOR; >> @@ -2013,7 +2007,6 @@ >> Octstr *alt_charset; >> Octstr *alt_addr_charset; >> long connection_timeout, wait_ack, wait_ack_action; >> - int esm_class_default; >> >> my_number = alt_addr_charset = alt_charset = NULL; >> transceiver_mode = 0; >> @@ -2145,10 +2138,6 @@ >> >> if (wait_ack_action > 0x03 || wait_ack_action < 0) >> panic(0, "SMPP: Invalid wait-ack-expire directive in >> configuration."); >> - >> - /* check for esm_class */ >> - if (cfg_get_integer(&esm_class_default, grp, >> octstr_imm("esm_class")) == -1) >> - esm_class_default = ESM_CLASS_SUBMIT_DEFAULT_SMSC_MODE; >> >> smpp = smpp_create(conn, host, port, receive_port, system_type, >> username, password, address_range, >> @@ -2156,7 +2145,7 @@ >> dest_addr_npi, enquire_link_interval, >> max_pending_submits, version, priority, >> validity, my_number, >> smpp_msg_id_type, autodetect_addr, >> alt_charset, alt_addr_charset, >> - service_type, connection_timeout, wait_ack, >> wait_ack_action, esm_class_default); >> + service_type, connection_timeout, wait_ack, >> wait_ack_action); >> >> cfg_get_integer(&smpp->bind_addr_ton, grp, octstr_imm("bind- >> addr-ton")); >> cfg_get_integer(&smpp->bind_addr_npi, grp, octstr_imm("bind- >> addr-npi")); >> diff -ruh gateway-1.4.3/gwlib/cfg.def gateway-1.4.3-esm_patch/gwlib/ >> cfg.def >> --- gateway-1.4.3/gwlib/cfg.def 2009-03-18 20:38:50.000000000 +0000 >> +++ gateway-1.4.3-esm_patch/gwlib/cfg.def 2009-03-18 >> 20:41:14.000000000 +0000 >> @@ -342,7 +342,6 @@ >> OCTSTR(flow-control) >> OCTSTR(wait-ack) >> OCTSTR(wait-ack-expire) >> - OCTSTR(esm_class) >> OCTSTR(no-sender) >> OCTSTR(no-coding) >> OCTSTR(window) >