diff options
author | Mark Michelson <mmichelson@digium.com> | 2015-04-07 15:34:53 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2015-04-07 15:34:53 +0000 |
commit | 1eba6abae58cce851bce7f1f4a0d5f78865e4064 (patch) | |
tree | 629bb1668837f18f4c3bf69dd81bb6652cf2c676 /res/res_pjsip_messaging.c | |
parent | c2f50ba6f47e04c0457baa0bb5bf84b22a26d20b (diff) |
Do not queue message requests that we do not respond to.
If we receive a MESSAGE request that we cannot send a response
to, we should not send the incoming MESSAGE to the dialplan.
This commit should help the bouncing message_retrans test to
pass consistently.
........
Merged revisions 434218 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434219 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip_messaging.c')
-rw-r--r-- | res/res_pjsip_messaging.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/res/res_pjsip_messaging.c b/res/res_pjsip_messaging.c index daa043c73..dab70ca96 100644 --- a/res/res_pjsip_messaging.c +++ b/res/res_pjsip_messaging.c @@ -673,9 +673,16 @@ static pj_bool_t module_on_rx_request(pjsip_rx_data *rdata) return PJ_TRUE; } - /* send it to the messaging core */ - ast_msg_queue(msg); - send_response(rdata, PJSIP_SC_ACCEPTED, NULL, NULL); + /* Send it to the messaging core. + * + * If we are unable to send a response, the most likely reason is that we + * are handling a retransmission of an incoming MESSAGE and were unable to + * create a transaction due to a duplicate key. If we are unable to send + * a response, we should not queue the message to the dialplan + */ + if (!send_response(rdata, PJSIP_SC_ACCEPTED, NULL, NULL)) { + ast_msg_queue(msg); + } return PJ_TRUE; } |