diff options
author | snuffy <snuffy22@gmail.com> | 2016-05-10 12:40:08 +1000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2016-05-19 09:06:30 -0300 |
commit | 39fedfa4235da9f2d5de63bafae0521d7591ac8e (patch) | |
tree | 59ef667fc49e16d5e5d8a2d0515f24fcd3c85d59 /res/res_pjsip_dtmf_info.c | |
parent | 7d986ff3f6505c44f69940bb3dd3907bb63af4ba (diff) |
res_pjsip_empty_info: Respond to empty SIP INFO packets
Some SBCs require responses to empty SIP INFO packets
after establishing call via INVITE, if not responded to
they may drop your call after unspecified timeout of X minutes.
They are identified by having no Content-Type, check for this
and respond with 200 - OK message.
ASTERISK-24986 #close
Reported-by: Ilya Trikoz, Federico Santulli
Change-Id: Ib27e4f07151e5aef28fa587e4ead36c5b87c43e0
Diffstat (limited to 'res/res_pjsip_dtmf_info.c')
-rw-r--r-- | res/res_pjsip_dtmf_info.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/res/res_pjsip_dtmf_info.c b/res/res_pjsip_dtmf_info.c index ede515d1c..17297e117 100644 --- a/res/res_pjsip_dtmf_info.c +++ b/res/res_pjsip_dtmf_info.c @@ -103,13 +103,13 @@ static int dtmf_info_incoming_request(struct ast_sip_session *session, struct pj if (!body || !body->len) { /* need to return 200 OK on empty body */ send_response(session, rdata, 200); - return 0; + return 1; } res = body->print_body(body, buf, body->len); if (res < 0) { send_response(session, rdata, 500); - return 0; + return 1; } buf[res] = '\0'; @@ -150,11 +150,12 @@ static int dtmf_info_incoming_request(struct ast_sip_session *session, struct pj } send_response(session, rdata, event ? 200 : 500); - return event ? 0 : -1; + return 1; } static struct ast_sip_session_supplement dtmf_info_supplement = { .method = "INFO", + .priority = AST_SIP_SUPPLEMENT_PRIORITY_FIRST, .incoming_request = dtmf_info_incoming_request, }; |