2016-05-26 3 views
0

rpmパッケージkannel-sw-1.4.3.3-6.rh5u3からkannelをインストールしました。 HTTP経由でsmsboxにスロットリングエラーを処理するために1つずつ5つのメッセージ( "1"、 "2"、 "3"、 "4"、 "5")を送信するような簡単なテストを行いました。 SMSC側からのスループットは1分間に2 SMSでした。私は、次の順序でSMSを取得することが期待: "1" "2" "3" "4" "5" kannelログとSMPPがダンプにしかし、私は持っている流れのように:チャネルキュータイプ

> "1" 
< ok 
> "2" 
< ok 
> "3" 
< throttling error 
#first timeout less than 1 minute according config 
> "4" 
< throttling error 
#second timeout less than 1 minute according config, but in sum with first more than 1 minute 
> "5" 
< ok 
> "3" 
< ok 
> "4" 
< throttling error 
and so on 

結果の順序は、 "1"、 "2"、 "3"、 "4"、 "5"の代わりに "1"、 "2"、 "5"、 "3" チェーンの次のメッセージではなく最後のエラーメッセージを送信しようとすると、オーダータイプを変更できますか? 文書では、sms-incoming-queue-limitオプションが見つかりました。しかし、 "値0は送信メッセージに厳密な優先順位を与える"という意味は何もわからず、残念ながらテストをすぐに実行することはできません。厳密な優先順位とは何ですか?また、queue \ orderタイプはどうですか?

多くのありがとうございます。

答えて

0

SMPP Throttling error processing

I did the following patch to smsc/smsc_smpp.c in "case submit_sm_resp:" 
section from line 1609: 
change 
*** 
if (pdu->u.submit_sm_resp.command_status == SMPP_ESME_RTHROTTLED) 
    time(&(smpp->throttling_err_time)); 
else 
    smpp->throttling_err_time = 0; 

bb_smscconn_send_failed(smpp->conn, msg, reason, octstr_format("0x%08lx/%s", 
pdu->u.submit_sm_resp.command_status, 

smpp_error_to_string(pdu->u.submit_sm_resp.command_status))); 
*** 
to 
*** 
if (pdu->u.submit_sm_resp.command_status == SMPP_ESME_RTHROTTLED) { 
    time(&(smpp->throttling_err_time)); 
    /* Put the message back into the SMPP queue */ 
    gw_prioqueue_produce(smpp->msgs_to_send, msg); 
} else { 
    smpp->throttling_err_time = 0; 
    bb_smscconn_send_failed(smpp->conn, msg, reason, 
octstr_format("0x%08lx/%s", pdu->u.submit_sm_resp.command_status, 
     smpp_error_to_string(pdu->u.submit_sm_resp.command_status))); 
} 
*** 

and in sms.c I have changed the function sms_priority_compare() to reverse 
time sorting order (for some reason it was LIFO): 
if (msg1->sms.time > msg2->sms.time) 
    ret = -1; 
else if (msg1->sms.time < msg2->sms.time) 
    ret = 1; 
-------------- next part -------------- 

複合SMS部品の注文は、そのsms.idの追加の比較に基づいています。

int sms_priority_compare(const void *a, const void *b) 
{ 
    int ret; 
    Msg *msg1 = (Msg*)a, *msg2 = (Msg*)b; 
    gw_assert(msg_type(msg1) == sms); 
    gw_assert(msg_type(msg2) == sms); 

    if (msg1->sms.priority > msg2->sms.priority) 
     ret = 1; 
    else if (msg1->sms.priority < msg2->sms.priority) 
     ret = -1; 
    else { 
     if (msg1->sms.time > msg2->sms.time) 
      ret = -1; 
     else if (msg1->sms.time < msg2->sms.time) 
      ret = 1; 
     else { 
      if (msg1->sms.id > msg2->sms.id) 
       ret = -1; 
      else if (msg1->sms.id < msg2->sms.id) 
       ret = 1; 
      else 
       ret = 0;   
     } 
    } 

    return ret; 
} 
0

私の前の答えが間違っていました。 Сorrectの答え:

  1. 変更機能sms_priority_comparesms.c中:

    if (msg1->sms.time > msg2->sms.time) 
         ret = 1; 
    else if (msg1->sms.time < msg2->sms.time) 
         ret = -1; 
    

    smsc/smsc_smpp.cの変更機能smpp_status_to_smscconn_failure_reason

    if (msg1->sms.time > msg2->sms.time) 
        ret = -1; 
    else if (msg1->sms.time < msg2->sms.time) 
        ret = 1; 
    else { 
        if (msg1->sms.id > msg2->sms.id) 
         ret = -1; 
        else if (msg1->sms.id < msg2->sms.id) 
         ret = 1; 
        else 
         ret = 0;   
    } 
    
  2. へ:

    static long smpp_status_to_smscconn_failure_reason(long status) 
    { 
        switch(status) { 
         case SMPP_ESME_RMSGQFUL: 
         case SMPP_ESME_RTHROTTLED: 
         case SMPP_ESME_RX_T_APPN: 
         case SMPP_ESME_RSYSERR: 
          return SMSCCONN_FAILED_TEMPORARILY; 
          break; 
    
         default: 
          return SMSCCONN_FAILED_REJECTED; 
        } 
    } 
    

  3. static long smpp_status_to_smscconn_failure_reason(long status) 
    { 
        switch(status) { 
         case SMPP_ESME_RMSGQFUL: 
         case SMPP_ESME_RX_T_APPN: 
         case SMPP_ESME_RSYSERR: 
          return SMSCCONN_FAILED_TEMPORARILY; 
          break; 
    
         case SMPP_ESME_RTHROTTLED: 
          return SMPP_ESME_RTHROTTLED; 
          break; 
    
         default: 
          return SMSCCONN_FAILED_REJECTED; 
        } 
    } 
    
  4. に変更機能 smsc/smsc_smpp.chandle_pducase submit_sm_resp:):

    if (pdu->u.submit_sm_resp.command_status == SMPP_ESME_RTHROTTLED) 
         time(&(smpp->throttling_err_time)); 
    else 
         smpp->throttling_err_time = 0;  
    
    bb_smscconn_send_failed(smpp->conn, msg, reason, octstr_format("0x%08lx/%s", pdu->u.submit_sm_resp.command_status, 
                smpp_error_to_string(pdu->u.submit_sm_resp.command_status))); 
    

  5. if (pdu->u.submit_sm_resp.command_status == SMPP_ESME_RTHROTTLED) 
         time(&(smpp->throttling_err_time)); 
    else 
         smpp->throttling_err_time = 0;  
    
    if (pdu->u.submit_sm_resp.command_status == SMPP_ESME_RMSGQFUL) 
         time(&msg->sms.time);  
    
    bb_smscconn_send_failed(smpp->conn, msg, reason, octstr_format("0x%08lx/%s", pdu->u.submit_sm_resp.command_status, 
                smpp_error_to_string(pdu->u.submit_sm_resp.command_status))); 
    
  6. に変更機能 bb_smscconn.cbb_smscconn_send_failed

     case SMSCCONN_FAILED_TEMPORARILY:  
         ... 
         gwlist_produce(outgoing_sms, sms); 
         break; 
    
    case SMSCCONN_FAILED_SHUTDOWN: 
         gwlist_produce(outgoing_sms, sms); 
         break; 
    

    handle_splitbb_smscconn.cの変更機能

    case SMSCCONN_FAILED_TEMPORARILY:  
         ... 
         gwlist_produce(outgoing_sms, sms); 
         break; 
    
    case SMPP_ESME_RTHROTTLED: 
         gwlist_insert(outgoing_sms, 0, sms); 
         break; 
    
    case SMSCCONN_FAILED_SHUTDOWN: 
         gwlist_produce(outgoing_sms, sms); 
         break; 
    
  7. へ:

    case SMSCCONN_FAILED_TEMPORARILY:  
         ... 
         gwlist_produce(outgoing_sms, msg); 
         break; 
    
    case SMSCCONN_FAILED_DISCARDED: 
    

    case SMSCCONN_FAILED_TEMPORARILY:  
         ... 
         gwlist_produce(outgoing_sms, msg); 
         break; 
    
    case SMPP_ESME_RTHROTTLED: 
         gwlist_insert(outgoing_sms, 0, msg); 
         break; 
    
    case SMSCCONN_FAILED_DISCARDED: