[asterisk-commits] simon.perreault: branch group/v6-new r269748 - /team/group/v6-new/channels/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Jun 10 10:03:01 CDT 2010
Author: simon.perreault
Date: Thu Jun 10 10:02:57 2010
New Revision: 269748
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=269748
Log:
Fixed get_our_media_address() definitively.
Modified:
team/group/v6-new/channels/chan_sip.c
Modified: team/group/v6-new/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/group/v6-new/channels/chan_sip.c?view=diff&rev=269748&r1=269747&r2=269748
==============================================================================
--- team/group/v6-new/channels/chan_sip.c (original)
+++ team/group/v6-new/channels/chan_sip.c Thu Jun 10 10:02:57 2010
@@ -9906,83 +9906,66 @@
/* Now, try to figure out where we want them to send data */
/* Is this a re-invite to move the media out, then use the original offer from caller */
- if (!ast_sockaddr_isnull(&p->redirip)) { /* If we have a redirection IP, use it */
- ast_sockaddr_copy(dest, &p->redirip);
- } else {
+
+ /*
+ * Audio Destination IP:
+ *
+ * 1. Redirection IP.
+ * 2. Specifically configured media address.
+ * 3. Local address as specified by the RTP engine.
+ * 4. The local IP as defined by chan_sip.
+ *
+ * Audio Destination Port:
+ *
+ * 1. Provided by the RTP engine.
+ */
+ ast_sockaddr_copy(dest,
+ !ast_sockaddr_isnull(&p->redirip) ? &p->redirip :
+ !ast_sockaddr_isnull(&media_address) ? &media_address :
+ !ast_sockaddr_is_any(addr) ? addr :
+ &p->ourip);
+ ast_sockaddr_set_port(dest, ast_sockaddr_port(addr));
+
+ if (needvideo) {
/*
- * Audio Destination IP:
+ * Video Destination IP:
*
- * 1. Specifically configured media address.
- * 2. Local address as specified by the RTP engine.
- * 3. The local IP as defined by chan_sip.
+ * 1. Redirection IP.
+ * 2. Specifically configured media address.
+ * 3. Local address as specified by the RTP engine.
+ * 4. The local IP as defined by chan_sip.
*
- * Audio Destination Port:
+ * Video Destination Port:
*
* 1. Provided by the RTP engine.
*/
- if(ast_sockaddr_isnull(&media_address)) {
- if(ast_sockaddr_is_any(addr))
- ast_sockaddr_copy(dest, &p->ourip);
- else
- ast_sockaddr_copy(dest, addr);
- } else {
- ast_sockaddr_copy(dest, &media_address);
- }
- ast_sockaddr_set_port(dest, ast_sockaddr_port(addr));
- }
- if (needvideo) {
- /* Determine video destination */
- if (!ast_sockaddr_isnull(&p->vredirip)) {
- ast_sockaddr_copy(vdest, &p->vredirip);
- } else {
- /*
- * Video Destination IP:
- *
- * 1. Specifically configured media address.
- * 2. Local address as specified by the RTP engine.
- * 3. The local IP as defined by chan_sip.
- *
- * Video Destination Port:
- *
- * 1. Provided by the RTP engine.
- */
- if(ast_sockaddr_isnull(&media_address)) {
- if(ast_sockaddr_is_any(vaddr))
- ast_sockaddr_copy(vdest, &p->ourip);
- else
- ast_sockaddr_copy(vdest, vaddr);
- } else {
- ast_sockaddr_copy(vdest, &media_address);
- }
- ast_sockaddr_set_port(vdest, ast_sockaddr_port(vaddr));
- }
- }
+ ast_sockaddr_copy(vdest,
+ !ast_sockaddr_isnull(&p->vredirip) ? &p->vredirip :
+ !ast_sockaddr_isnull(&media_address) ? &media_address :
+ !ast_sockaddr_is_any(vaddr) ? vaddr :
+ &p->ourip);
+ ast_sockaddr_set_port(vdest, ast_sockaddr_port(vaddr));
+ }
+
if (needtext) {
- /* Determine text destination */
- if (!ast_sockaddr_isnull(&p->tredirip)) {
- ast_sockaddr_copy(tdest, &p->tredirip);
- } else {
- /*
- * Text Destination IP:
- *
- * 1. Specifically configured media address.
- * 2. Local address as specified by the RTP engine.
- * 3. The local IP as defined by chan_sip.
- *
- * Text Destination Port:
- *
- * 1. Provided by the RTP engine.
- */
- if(ast_sockaddr_isnull(&media_address)) {
- if(ast_sockaddr_is_any(taddr))
- ast_sockaddr_copy(tdest, &p->ourip);
- else
- ast_sockaddr_copy(tdest, taddr);
- } else {
- ast_sockaddr_copy(tdest, &media_address);
- }
- ast_sockaddr_set_port(tdest, ast_sockaddr_port(taddr));
- }
+ /*
+ * Text Destination IP:
+ *
+ * 1. Redirection IP.
+ * 2. Specifically configured media address.
+ * 3. Local address as specified by the RTP engine.
+ * 4. The local IP as defined by chan_sip.
+ *
+ * Text Destination Port:
+ *
+ * 1. Provided by the RTP engine.
+ */
+ ast_sockaddr_copy(tdest,
+ !ast_sockaddr_isnull(&p->tredirip) ? &p->tredirip :
+ !ast_sockaddr_isnull(&media_address) ? &media_address :
+ !ast_sockaddr_is_any(taddr) ? taddr :
+ &p->ourip);
+ ast_sockaddr_set_port(tdest, ast_sockaddr_port(taddr));
}
}
More information about the asterisk-commits
mailing list