[asterisk-commits] mjordan: branch mjordan/udptl r350310 - in /team/mjordan/udptl: ./ apps/ chan...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Jan 10 15:36:21 CST 2012
Author: mjordan
Date: Tue Jan 10 15:36:17 2012
New Revision: 350310
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=350310
Log:
Branching out a test to remove udptl creation from some portions
Added:
team/mjordan/udptl/
- copied from r350022, branches/1.8/
team/mjordan/udptl/apps/app_meetme.c
- copied unchanged from r350128, branches/1.8/apps/app_meetme.c
team/mjordan/udptl/contrib/scripts/
- copied from r350128, branches/1.8/contrib/scripts/
team/mjordan/udptl/main/asterisk.c
- copied unchanged from r350128, branches/1.8/main/asterisk.c
Modified:
team/mjordan/udptl/channels/chan_sip.c
Modified: team/mjordan/udptl/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/mjordan/udptl/channels/chan_sip.c?view=diff&rev=350310&r1=350022&r2=350310
==============================================================================
--- team/mjordan/udptl/channels/chan_sip.c (original)
+++ team/mjordan/udptl/channels/chan_sip.c Tue Jan 10 15:36:17 2012
@@ -5217,20 +5217,6 @@
ast_copy_flags(&dialog->flags[2], &peer->flags[2], SIP_PAGE3_FLAGS_TO_COPY);
dialog->capability = peer->capability;
dialog->prefs = peer->prefs;
- if (ast_test_flag(&dialog->flags[1], SIP_PAGE2_T38SUPPORT)) {
- /* 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)))) {
- 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);
- }
- } else if (dialog->udptl) {
- ast_udptl_destroy(dialog->udptl);
- dialog->udptl = NULL;
- }
ast_string_field_set(dialog, engine, peer->engine);
@@ -7637,16 +7623,6 @@
p->allowed_methods = UINT_MAX;
if (sip_methods[intended_method].need_rtp) {
- if (ast_test_flag(&p->flags[1], SIP_PAGE2_T38SUPPORT)) {
- if ((p->udptl = ast_udptl_new_with_bindaddr(sched, io, 0, &bindaddr))) {
- 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;
}
@@ -7674,11 +7650,8 @@
p->capability = sip_cfg.capability;
p->allowtransfer = sip_cfg.allowtransfer;
if ((ast_test_flag(&p->flags[0], SIP_DTMF) == SIP_DTMF_RFC2833) ||
- (ast_test_flag(&p->flags[0], SIP_DTMF) == SIP_DTMF_AUTO))
+ (ast_test_flag(&p->flags[0], SIP_DTMF) == SIP_DTMF_AUTO)) {
p->noncodeccapability |= AST_RTP_DTMF;
- if (p->udptl) {
- p->t38_maxdatagram = global_t38_maxdatagram;
- set_t38_capabilities(p);
}
ast_string_field_set(p, context, sip_cfg.default_context);
ast_string_field_set(p, parkinglot, default_parkinglot);
@@ -17270,6 +17243,12 @@
ast_cli(fd, " Force rport : %s\n", AST_CLI_YESNO(ast_test_flag(&peer->flags[0], SIP_NAT_FORCE_RPORT)));
ast_cli(fd, " ACL : %s\n", AST_CLI_YESNO(peer->ha != NULL));
ast_cli(fd, " DirectMedACL : %s\n", AST_CLI_YESNO(peer->directmediaha != NULL));
+ /* TEST */
+ ast_copy_flags(&peer->flags[1], &global_flags[1], SIP_PAGE2_FLAGS_TO_COPY);
+ ast_cli(fd, " Fax Detect : %s\n", (ast_test_flag(&peer->flags[1], SIP_PAGE2_FAX_DETECT) ?
+ (ast_test_flag(&peer->flags[1], SIP_PAGE2_FAX_DETECT_BOTH) ? "Both" :
+ (ast_test_flag(&peer->flags[1], SIP_PAGE2_FAX_DETECT_CNG) ? "CNG" : "T38"))
+ : "No"));
ast_cli(fd, " T.38 support : %s\n", AST_CLI_YESNO(ast_test_flag(&peer->flags[1], SIP_PAGE2_T38SUPPORT)));
ast_cli(fd, " T.38 EC mode : %s\n", faxec2str(ast_test_flag(&peer->flags[1], SIP_PAGE2_T38SUPPORT)));
ast_cli(fd, " T.38 MaxDtgrm: %d\n", peer->t38_maxdatagram);
@@ -22401,14 +22380,18 @@
if (authpeer) {
p->relatedpeer = ref_peer(authpeer, "setting dialog's relatedpeer pointer");
}
- /* If T38 is needed but not present, then make it magically appear */
+ /* If T38 could be supported by this dialog, create it now */
if (ast_test_flag(&p->flags[1], SIP_PAGE2_T38SUPPORT) && !p->udptl) {
if ((p->udptl = ast_udptl_new_with_bindaddr(sched, io, 0, &bindaddr))) {
- p->t38_maxdatagram = global_t38_maxdatagram;
+ ast_udptl_setqos(p->udptl, global_tos_audio, global_cos_audio);
+ /* Since the udptl session probably didn't exist when check_user_full was called,
+ * apply the peer's T38 information here if one exists
+ */
+ p->t38_maxdatagram = authpeer ? authpeer->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_log(AST_LOG_WARNING, "UDPTL creation failed - disabling T38 for this dialog\n");
ast_clear_flag(&p->flags[1], SIP_PAGE2_T38SUPPORT);
}
}
More information about the asterisk-commits
mailing list