title: Error in sending sms to oversea mobile number by using Kannel gateway
body: <p>I'm in Cambodia, and I'm currently able to use kannel gateway to send sms to local mobile numbers. However, I run into an error why trying to send SMS to oversea mobile number (Singapore mobile number). If I take out my sim card and place into a phone, I'm able to send the SMS to oversea.</p>
  
  <p>The error is <strong>2011-01-11 10:58:04 [3960] [6] ERROR: AT2[abcd]: Generic error: ERROR</strong></p>
  
  <p>Has anyone ever encountered this issue? I really appreciate for your help. Thank you.</p>
  
  <p>I'm using Kannel 1.4.3 installed on Ubuntu 10.04 LTS. I use a wavecom modem whose model is WAVECOM FASTRACK type DUAL BRANCH MODEM connected to kannel via serial port.</p>
  
  <p>This is the command I use to send SMS from a web browser</p>
  
  <p><strong>http://localhost:13013/cgi-bin/sendsms?username=tester&amp;password=foobar&amp;from=+85516872490&amp;to=+6597379814&amp;text=TestSendingAnSMSFromTheSystem</strong></p>
  
  <p>Below are my config file and log files.</p>
  
  <p>Should you need further detail, please let me know.</p>
  
  <p><strong>Config file: kannel.conf</strong></p>
  
  <pre><code>group = core
  admin-port = 13000
  admin-password = bar
  smsbox-port = 13001
  smsbox-port-ssl = false
  log-file = "/home/sambath/Documents/softwares/kannel/kannel.log"
  log-level = 0
  access-log = "/home/sambath/Documents/softwares/kannel/access.log"
  access-log-clean = true
  sms-resend-retry = 0
  
  # SMSC GSM
  
  group = smsc
  smsc = at
  smsc-id = abcd
  modemtype = wavecom 
  device = /dev/ttyUSB0
  pin = 0000
  alt-charset = "ASCII" 
  
  group = modems
  id = wavecom
  name = "wavecom"
  detect-string = "wavecom"
  message-storage = sm
  speed = 115200    
  
  # SMSBOX SETUP
  
  group = smsbox
  bearerbox-host = localhost
  sendsms-port = 13013
  sendsms-chars = "0123456789 +-"
  log-file = "/home/sambath/Documents/softwares/kannel/smsbox.log"
  access-log = "/home/sambath/Documents/softwares/kannel/access.log"
  mo-recode = true
  
  # SEND-SMS USERS
  
  group = sendsms-user
  username = tester
  password = foobar    
  
  # SMS SERVICES
  
  group = sms-service
  keyword = default
  get-url = "http://localhost:8080/ReceiveSms.php?sender=%p&amp;text=%a"
  catch-all = true
  max-messages = 0
  </code></pre>
  
  <p><strong>Log file: kannel.log</strong></p>
  
  <pre><code>2011-01-11 10:57:44 [3960] [0] INFO: Added logfile `/home/sambath/Documents/softwares/kannel/kannel.log' with level `0'.
  2011-01-11 10:57:44 [3960] [0] INFO: Started access logfile `/home/sambath/Documents/softwares/kannel/access.log'.
  2011-01-11 10:57:44 [3960] [0] INFO: SSL not supported, no SSL initialization done.
  2011-01-11 10:57:44 [3960] [0] INFO: HTTP: Opening server at port 13000.
  2011-01-11 10:57:44 [3960] [0] DEBUG: Started thread 1 (gwlib/fdset.c:poller)
  2011-01-11 10:57:44 [3960] [1] DEBUG: Thread 1 (gwlib/fdset.c:poller) maps to pid 3960.
  2011-01-11 10:57:44 [3960] [0] DEBUG: Started thread 2 (gwlib/http.c:server_thread)
  2011-01-11 10:57:44 [3960] [0] DEBUG: Started thread 3 (gw/bb_http.c:httpadmin_run)
  2011-01-11 10:57:44 [3960] [3] DEBUG: Thread 3 (gw/bb_http.c:httpadmin_run) maps to pid 3960.
  2011-01-11 10:57:44 [3960] [0] DEBUG: starting smsbox connection module
  2011-01-11 10:57:44 [3960] [0] INFO: BOXC: 'smsbox-max-pending' not set, using default (100).
  2011-01-11 10:57:44 [3960] [0] DEBUG: Started thread 4 (gw/bb_boxc.c:sms_to_smsboxes)
  2011-01-11 10:57:44 [3960] [4] DEBUG: Thread 4 (gw/bb_boxc.c:sms_to_smsboxes) maps to pid 3960.
  2011-01-11 10:57:44 [3960] [0] DEBUG: Started thread 5 (gw/bb_boxc.c:smsboxc_run)
  2011-01-11 10:57:44 [3960] [5] DEBUG: Thread 5 (gw/bb_boxc.c:smsboxc_run) maps to pid 3960.
  2011-01-11 10:57:44 [3960] [0] INFO: Set SMS resend frequency to 60 seconds.
  2011-01-11 10:57:44 [3960] [0] INFO: SMS resend retry set to 0.
  2011-01-11 10:57:44 [3960] [0] DEBUG: smsbox MO concatenated message handling enabled
  2011-01-11 10:57:44 [3960] [0] INFO: DLR rerouting for smsc id &lt;abcd&gt; disabled.
  2011-01-11 10:57:44 [3960] [0] INFO: AT2[abcd]: configuration shows modemtype &lt;wavecom&gt;
  2011-01-11 10:57:44 [3960] [0] DEBUG: AT2[abcd]: Reading modem definitions from &lt;kannel.conf&gt;
  2011-01-11 10:57:44 [3960] [0] DEBUG: AT2[abcd]: Found &lt;1&gt; modems in config
  2011-01-11 10:57:44 [3960] [0] INFO: AT2[abcd]: read modem definition for &lt;wavecom&gt;
  2011-01-11 10:57:44 [3960] [0] DEBUG: Started thread 6 (gw/smsc/smsc_at.c:at2_device_thread)
  2011-01-11 10:57:44 [3960] [6] DEBUG: Thread 6 (gw/smsc/smsc_at.c:at2_device_thread) maps to pid 3960.
  2011-01-11 10:57:44 [3960] [0] DEBUG: Started thread 7 (gw/bb_smscconn.c:sms_router)
  2011-01-11 10:57:44 [3960] [7] DEBUG: Thread 7 (gw/bb_smscconn.c:sms_router) maps to pid 3960.
  2011-01-11 10:57:44 [3960] [6] INFO: AT2[abcd]: trying to use speed &lt;115200&gt; from modem definition
  2011-01-11 10:57:44 [3960] [6] INFO: AT2[abcd]: opening device
  2011-01-11 10:57:44 [3960] [0] INFO: ----------------------------------------
  2011-01-11 10:57:44 [3960] [0] INFO: Kannel bearerbox II version 1.4.3 starting
  2011-01-11 10:57:44 [3960] [0] INFO: MAIN: Start-up done, entering mainloop
  2011-01-11 10:57:44 [3960] [0] DEBUG: AT2[abcd]: start called
  2011-01-11 10:57:44 [3960] [2] DEBUG: Thread 2 (gwlib/http.c:server_thread) maps to pid 3960.
  2011-01-11 10:57:44 [3960] [6] DEBUG: AT2[abcd]: device opened. Telnet mode = 0
  2011-01-11 10:57:44 [3960] [6] DEBUG: AT2[abcd]: device opened
  2011-01-11 10:57:44 [3960] [6] INFO: AT2[abcd]: speed set to 115200
  2011-01-11 10:57:44 [3960] [6] DEBUG: AT2[abcd]: --&gt; ^M
  2011-01-11 10:57:46 [3960] [6] DEBUG: AT2[abcd]: --&gt; AT^M
  2011-01-11 10:57:46 [3960] [6] DEBUG: AT2[abcd]: &lt;-- AT
  2011-01-11 10:57:46 [3960] [6] DEBUG: AT2[abcd]: &lt;-- OK
  2011-01-11 10:57:46 [3960] [6] INFO: AT2[abcd]: Closing device
  2011-01-11 10:57:46 [3960] [6] INFO: AT2[abcd]: speed is 115200
  2011-01-11 10:57:46 [3960] [6] INFO: AT2[abcd]: opening device
  2011-01-11 10:57:46 [3960] [6] DEBUG: AT2[abcd]: device opened. Telnet mode = 0
  2011-01-11 10:57:46 [3960] [6] DEBUG: AT2[abcd]: device opened
  2011-01-11 10:57:46 [3960] [6] INFO: AT2[abcd]: Logging in
  2011-01-11 10:57:46 [3960] [6] INFO: AT2[abcd]: init device
  2011-01-11 10:57:46 [3960] [6] INFO: AT2[abcd]: speed set to 115200
  2011-01-11 10:57:46 [3960] [6] DEBUG: AT2[abcd]: --&gt; ATZ^M
  2011-01-11 10:57:46 [3960] [6] DEBUG: AT2[abcd]: &lt;-- ATZ
  2011-01-11 10:57:46 [3960] [6] DEBUG: AT2[abcd]: &lt;-- OK
  2011-01-11 10:57:46 [3960] [6] DEBUG: AT2[abcd]: --&gt; AT^M
  2011-01-11 10:57:47 [3960] [6] DEBUG: AT2[abcd]: &lt;-- AT
  2011-01-11 10:57:47 [3960] [6] DEBUG: AT2[abcd]: &lt;-- OK
  2011-01-11 10:57:47 [3960] [6] DEBUG: AT2[abcd]: --&gt; AT&amp;F^M
  2011-01-11 10:57:47 [3960] [6] DEBUG: AT2[abcd]: &lt;-- AT&amp;F
  2011-01-11 10:57:47 [3960] [6] DEBUG: AT2[abcd]: &lt;-- OK
  2011-01-11 10:57:47 [3960] [6] DEBUG: AT2[abcd]: --&gt; ATE0^M
  2011-01-11 10:57:47 [3960] [6] DEBUG: AT2[abcd]: &lt;-- ATE0
  2011-01-11 10:57:47 [3960] [6] DEBUG: AT2[abcd]: &lt;-- OK
  2011-01-11 10:57:47 [3960] [6] DEBUG: AT2[abcd]: --&gt; AT+IFC=2,2^M
  2011-01-11 10:57:47 [3960] [6] DEBUG: AT2[abcd]: &lt;-- OK
  2011-01-11 10:57:47 [3960] [6] DEBUG: AT2[abcd]: --&gt; AT+CPIN?^M
  2011-01-11 10:57:47 [3960] [6] DEBUG: AT2[abcd]: &lt;-- +CPIN: READY
  2011-01-11 10:57:48 [3960] [5] INFO: Client connected from &lt;127.0.0.1&gt; 
  2011-01-11 10:57:48 [3960] [5] DEBUG: Started thread 8 (gw/bb_boxc.c:function)
  2011-01-11 10:57:48 [3960] [8] DEBUG: Thread 8 (gw/bb_boxc.c:function) maps to pid 3960.
  2011-01-11 10:57:48 [3960] [8] DEBUG: Started thread 9 (gw/bb_boxc.c:boxc_sender)
  2011-01-11 10:57:48 [3960] [9] DEBUG: Thread 9 (gw/bb_boxc.c:boxc_sender) maps to pid 3960.
  2011-01-11 10:57:58 [3960] [6] DEBUG: AT2[abcd]: --&gt; AT+CMGF=0^M
  2011-01-11 10:57:58 [3960] [6] DEBUG: AT2[abcd]: &lt;-- OK
  2011-01-11 10:57:58 [3960] [6] DEBUG: AT2[abcd]: --&gt; AT+CSMS=?^M
  2011-01-11 10:57:58 [3960] [6] DEBUG: AT2[abcd]: &lt;-- +CSMS: (0,1)
  2011-01-11 10:57:58 [3960] [6] DEBUG: AT2[abcd]: &lt;-- OK
  2011-01-11 10:57:58 [3960] [6] INFO: AT2[abcd]: Phase 2+ is supported
  2011-01-11 10:57:58 [3960] [6] DEBUG: AT2[abcd]: --&gt; AT+CSMS=1^M
  2011-01-11 10:57:58 [3960] [6] DEBUG: AT2[abcd]: &lt;-- +CSMS: 1,1,1
  2011-01-11 10:57:58 [3960] [6] DEBUG: AT2[abcd]: &lt;-- OK
  2011-01-11 10:57:58 [3960] [6] DEBUG: AT2[abcd]: --&gt; AT+CNMI=1,2,0,1,0^M
  2011-01-11 10:57:58 [3960] [6] DEBUG: AT2[abcd]: &lt;-- OK
  2011-01-11 10:57:58 [3960] [6] INFO: AT2[abcd]: AT SMSC successfully opened.
  2011-01-11 10:58:00 [3960] [8] DEBUG: boxc_receiver: sms received
  2011-01-11 10:58:00 [3960] [8] DEBUG: send_msg: sending msg to box: &lt;127.0.0.1&gt;
  2011-01-11 10:58:02 [3960] [6] DEBUG: AT2[abcd]: TP-Validity-Period: 24.0 hours
  2011-01-11 10:58:02 [3960] [6] DEBUG: AT2[abcd]: --&gt; AT+CMGS=39^M
  2011-01-11 10:58:02 [3960] [6] DEBUG: AT2[abcd]: &lt;-- 
  2011-01-11 10:58:02 [3960] [6] DEBUG: AT2[abcd]: &lt;-- &gt;
  2011-01-11 10:58:02 [3960] [6] DEBUG: AT2[abcd]: send command status: 1
  2011-01-11 10:58:02 [3960] [6] DEBUG: AT2[abcd]: --&gt; 0011000A8156797377780000A71DD4F29C3E2DBBC969F739E89E36A746F9BB4D4597A7F939BDDC06
  2011-01-11 10:58:02 [3960] [6] DEBUG: AT2[abcd]: --&gt; ^Z
  2011-01-11 10:58:04 [3960] [6] DEBUG: AT2[abcd]: &lt;-- ERROR
  2011-01-11 10:58:04 [3960] [6] ERROR: AT2[abcd]: Generic error: ERROR
  2011-01-11 10:58:04 [3960] [6] DEBUG: AT2[abcd]: send command status: -1
  2011-01-11 10:58:04 [3960] [7] DEBUG: sms_router: handling message (0x9268090 vs 0x9268090)
  2011-01-11 10:58:04 [3960] [7] DEBUG: re-queing SMS not-yet-to-be resent
  </code></pre>
  
  <p><strong>Log file: smsbox.log</strong></p>
  
  <pre><code>2011-01-11 10:57:48 [3968] [0] INFO: Added logfile `/home/sambath/Documents/softwares/kannel/smsbox.log' with level `0'.
  2011-01-11 10:57:48 [3968] [0] INFO: Logging accesses to '/home/sambath/Documents/softwares/kannel/access.log'.
  2011-01-11 10:57:48 [3968] [0] INFO: Started access logfile `/home/sambath/Documents/softwares/kannel/access.log'.
  2011-01-11 10:57:48 [3968] [0] INFO: HTTP: Opening server at port 13013.
  2011-01-11 10:57:48 [3968] [0] DEBUG: Started thread 1 (gwlib/fdset.c:poller)
  2011-01-11 10:57:48 [3968] [1] DEBUG: Thread 1 (gwlib/fdset.c:poller) maps to pid 3968.
  2011-01-11 10:57:48 [3968] [0] DEBUG: Started thread 2 (gwlib/http.c:server_thread)
  2011-01-11 10:57:48 [3968] [2] DEBUG: Thread 2 (gwlib/http.c:server_thread) maps to pid 3968.
  2011-01-11 10:57:48 [3968] [0] INFO: Set up send sms service at port 13013
  2011-01-11 10:57:48 [3968] [0] DEBUG: Started thread 3 (gw/smsbox.c:sendsms_thread)
  2011-01-11 10:57:48 [3968] [3] DEBUG: Thread 3 (gw/smsbox.c:sendsms_thread) maps to pid 3968.
  2011-01-11 10:57:48 [3968] [0] DEBUG: ----------------------------------------------
  2011-01-11 10:57:48 [3968] [0] DEBUG: Kannel smsbox version 1.4.3 starting
  2011-01-11 10:57:48 [3968] [0] DEBUG:   dumping group (sendsms-user):
  2011-01-11 10:57:48 [3968] [0] DEBUG:     &lt;group&gt; = &lt;sendsms-user&gt;
  2011-01-11 10:57:48 [3968] [0] DEBUG:     &lt;username&gt; = &lt;tester&gt;
  2011-01-11 10:57:48 [3968] [0] DEBUG:     &lt;password&gt; = &lt;foobar&gt;
  2011-01-11 10:57:48 [3968] [0] DEBUG: Started thread 4 (gw/smsbox.c:obey_request_thread)
  2011-01-11 10:57:48 [3968] [4] DEBUG: Thread 4 (gw/smsbox.c:obey_request_thread) maps to pid 3968.
  2011-01-11 10:57:48 [3968] [0] DEBUG: Started thread 5 (gw/smsbox.c:url_result_thread)
  2011-01-11 10:57:48 [3968] [5] DEBUG: Thread 5 (gw/smsbox.c:url_result_thread) maps to pid 3968.
  2011-01-11 10:57:48 [3968] [0] DEBUG: Started thread 6 (gw/smsbox.c:http_queue_thread)
  2011-01-11 10:57:48 [3968] [6] DEBUG: Thread 6 (gw/smsbox.c:http_queue_thread) maps to pid 3968.
  2011-01-11 10:57:48 [3968] [0] INFO: Connected to bearerbox at localhost port 13001.
  2011-01-11 10:57:48 [3968] [0] DEBUG: Started thread 7 (gw/heartbeat.c:heartbeat_thread)
  2011-01-11 10:57:48 [3968] [7] DEBUG: Thread 7 (gw/heartbeat.c:heartbeat_thread) maps to pid 3968.
  2011-01-11 10:58:00 [3968] [2] DEBUG: HTTP: Creating HTTPClient for `127.0.0.1'.
  2011-01-11 10:58:00 [3968] [2] DEBUG: HTTP: Created HTTPClient area 0x84472b0.
  2011-01-11 10:58:00 [3968] [3] INFO: smsbox: Got HTTP request &lt;/cgi-bin/sendsms&gt; from &lt;127.0.0.1&gt;
  2011-01-11 10:58:00 [3968] [3] INFO: sendsms used by &lt;tester&gt;
  2011-01-11 10:58:00 [3968] [3] INFO: sendsms sender:&lt;tester: 85516872490&gt; (127.0.0.1) to:&lt; 6597379814&gt; msg:&lt;TestSendingAnSMSFromTheSystem&gt;
  2011-01-11 10:58:00 [3968] [3] DEBUG: Stored UUID 7b596f94-9784-456c-bd51-930b1f129df0
  2011-01-11 10:58:00 [3968] [3] DEBUG: message length 29, sending 1 messages
  2011-01-11 10:58:00 [3968] [3] DEBUG: Status: 202 Answer: &lt;Sent.&gt;
  2011-01-11 10:58:00 [3968] [3] DEBUG: Delayed reply - wait for bearerbox
  2011-01-11 10:58:00 [3968] [0] DEBUG: Got ACK (0) of 7b596f94-9784-456c-bd51-930b1f129df0
  2011-01-11 10:58:00 [3968] [0] DEBUG: HTTP: Resetting HTTPClient for `127.0.0.1'.
  </code></pre>