(closes issue #17264)
Reported by: falves11
Patches:
issue_17264_reviewboard_fix.diff uploaded by dvossel (license 671)
issue_17264_1.6.2_reviewboard_fix.diff uploaded by dvossel (license 671)
Tested by: falves11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@266292
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
dialog->capability = peer->capability;
dialog->prefs = peer->prefs;
if (ast_test_flag(&dialog->flags[1], SIP_PAGE2_T38SUPPORT)) {
dialog->capability = peer->capability;
dialog->prefs = peer->prefs;
if (ast_test_flag(&dialog->flags[1], SIP_PAGE2_T38SUPPORT)) {
- if (!dialog->udptl) {
- /* t38pt_udptl was enabled in the peer and not in [general] */
- dialog->udptl = ast_udptl_new_with_bindaddr(sched, io, 0, bindaddr.sin_addr);
+ /* t38pt_udptl was enabled in the peer and not in [general] */
+ if (dialog->udptl || (!dialog->udptl && (dialog->udptl = ast_udptl_new_with_bindaddr(sched, io, 0, bindaddr.sin_addr)))) {
+ dialog->t38_maxdatagram = peer->t38_maxdatagram;
+ set_t38_capabilities(dialog);
+ } else {
+ /* It is impossible to support T38 without udptl */
+ ast_debug(1, "UDPTL creation failed on dialog.\n");
+ ast_clear_flag(&dialog->flags[1], SIP_PAGE2_T38SUPPORT);
- dialog->t38_maxdatagram = peer->t38_maxdatagram;
- set_t38_capabilities(dialog);
} else if (dialog->udptl) {
ast_udptl_destroy(dialog->udptl);
dialog->udptl = NULL;
} else if (dialog->udptl) {
ast_udptl_destroy(dialog->udptl);
dialog->udptl = NULL;
- if (!ast_test_flag(&p->flags[1], SIP_PAGE2_T38SUPPORT)) {
+ if (!ast_test_flag(&p->flags[1], SIP_PAGE2_T38SUPPORT) || !p->udptl) {
return -1;
}
switch (parameters->request_response) {
return -1;
}
switch (parameters->request_response) {
p->allowed_methods = UINT_MAX;
if (sip_methods[intended_method].need_rtp) {
p->allowed_methods = UINT_MAX;
if (sip_methods[intended_method].need_rtp) {
- if (ast_test_flag(&p->flags[1], SIP_PAGE2_T38SUPPORT) && (p->udptl = ast_udptl_new_with_bindaddr(sched, io, 0, bindaddr.sin_addr))) {
- ast_udptl_setqos(p->udptl, global_tos_audio, global_cos_audio);
- p->t38_maxdatagram = global_t38_maxdatagram;
+ if (ast_test_flag(&p->flags[1], SIP_PAGE2_T38SUPPORT)) {
+ if ((p->udptl = ast_udptl_new_with_bindaddr(sched, io, 0, bindaddr.sin_addr))) {
+ ast_udptl_setqos(p->udptl, global_tos_audio, global_cos_audio);
+ p->t38_maxdatagram = global_t38_maxdatagram;
+ } else {
+ /* udptl creation failed, T38 can not be supported on this dialog */
+ ast_log(LOG_ERROR, "UDPTL creation failed\n");
+ ast_clear_flag(&p->flags[1], SIP_PAGE2_T38SUPPORT);
+ }
}
p->maxcallbitrate = default_maxcallbitrate;
p->autoframing = global_autoframing;
}
p->maxcallbitrate = default_maxcallbitrate;
p->autoframing = global_autoframing;
}
/* If T38 is needed but not present, then make it magically appear */
}
/* If T38 is needed but not present, then make it magically appear */
- if (ast_test_flag(&p->flags[1], SIP_PAGE2_T38SUPPORT) && !p->udptl && (p->udptl = ast_udptl_new_with_bindaddr(sched, io, 0, bindaddr.sin_addr))) {
- p->t38_maxdatagram = global_t38_maxdatagram;
- set_t38_capabilities(p);
+ if (ast_test_flag(&p->flags[1], SIP_PAGE2_T38SUPPORT) && !p->udptl) {
+ if ((p->udptl = ast_udptl_new_with_bindaddr(sched, io, 0, bindaddr.sin_addr))) {
+ p->t38_maxdatagram = global_t38_maxdatagram;
+ set_t38_capabilities(p);
+ } else {
+ /* udptl creation failed, T38 can not be supported on this dialog */
+ ast_debug(1, "UDPTL creation failed on dialog.\n");
+ ast_clear_flag(&p->flags[1], SIP_PAGE2_T38SUPPORT);
+ }
}
/* We have a succesful authentication, process the SDP portion if there is one */
}
/* We have a succesful authentication, process the SDP portion if there is one */