[svn-commits] mjordan: branch mjordan/udptl r350785 - /team/mjordan/udptl/channels/chan_sip.c
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Fri Jan 13 17:19:26 CST 2012
Author: mjordan
Date: Fri Jan 13 17:19:21 2012
New Revision: 350785
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=350785
Log:
Updated initialize_udptl with setting the channel's fd
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=350785&r1=350784&r2=350785
==============================================================================
--- team/mjordan/udptl/channels/chan_sip.c (original)
+++ team/mjordan/udptl/channels/chan_sip.c Fri Jan 13 17:19:21 2012
@@ -6728,6 +6728,8 @@
static int initialize_udptl(struct sip_pvt *p)
{
+ int natflags = ast_test_flag(&p->flags[1], SIP_PAGE2_SYMMETRICRTP);
+
if (!ast_test_flag(&p->flags[1], SIP_PAGE2_T38SUPPORT)) {
return 1;
}
@@ -6745,6 +6747,15 @@
*/
p->t38_maxdatagram = p->relatedpeer ? p->relatedpeer->t38_maxdatagram : global_t38_maxdatagram;
set_t38_capabilities(p);
+
+ ast_debug(1, "Setting NAT on UDPTL to %s\n", natflags ? "On" : "Off");
+ ast_udptl_setnat(p->udptl, natflags);
+
+ if (p->owner) {
+ ast_channel_set_fd(p->owner, 5, ast_udptl_fd(p->udptl));
+ } else {
+ ast_log(AST_LOG_WARNING, "UDPTL session %p created for dialog %p with no channel owner\n", p->udptl, p);
+ }
} else {
/* udptl creation failed, T38 can not be supported on this dialog */
ast_log(AST_LOG_WARNING, "UDPTL creation failed - disabling T38 for this dialog\n");
@@ -7057,10 +7068,12 @@
ast_channel_set_fd(tmp, 2, ast_rtp_instance_fd(i->vrtp, 0));
ast_channel_set_fd(tmp, 3, ast_rtp_instance_fd(i->vrtp, 1));
}
- if (needtext && i->trtp)
+ if (needtext && i->trtp) {
ast_channel_set_fd(tmp, 4, ast_rtp_instance_fd(i->trtp, 0));
- if (i->udptl)
+ }
+ if (i->udptl) {
ast_channel_set_fd(tmp, 5, ast_udptl_fd(i->udptl));
+ }
if (state == AST_STATE_RING)
tmp->rings = 1;
@@ -17282,12 +17295,6 @@
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);
More information about the svn-commits
mailing list