Guest User

Untitled

a guest
Mar 13th, 2013
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.62 KB | None | 0 0
  1. --- ../tmp/certified-asterisk-1.8.15-cert1/channels/chan_sip.c  2013-01-02 14:39:05.000000000 -0500
  2. +++ channels/chan_sip.c 2013-03-13 10:53:45.487036563 -0400
  3. @@ -27480,16 +27480,13 @@
  4.         }
  5.     } else if (!strcasecmp(v->name, "nat")) {
  6.         ast_set_flag(&mask[0], SIP_NAT_FORCE_RPORT);
  7. -       ast_set_flag(&flags[0], SIP_NAT_FORCE_RPORT); /* Default to "force_rport" */
  8. -       if (!strcasecmp(v->value, "no")) {
  9. -           ast_clear_flag(&flags[0], SIP_NAT_FORCE_RPORT);
  10. -       } else if (!strcasecmp(v->value, "yes")) {
  11. -           /* We've already defaulted to force_rport */
  12. -           ast_set_flag(&mask[1], SIP_PAGE2_SYMMETRICRTP);
  13. +       ast_set_flag(&mask[1], SIP_PAGE2_SYMMETRICRTP);
  14. +       if (!strcasecmp(v->value, "yes")) {
  15. +           ast_set_flag(&flags[0], SIP_NAT_FORCE_RPORT);
  16.             ast_set_flag(&flags[1], SIP_PAGE2_SYMMETRICRTP);
  17. +       } else if (!strcasecmp(v->value, "force_rport")) {
  18. +           ast_set_flag(&flags[0], SIP_NAT_FORCE_RPORT);
  19.         } else if (!strcasecmp(v->value, "comedia")) {
  20. -           ast_clear_flag(&flags[0], SIP_NAT_FORCE_RPORT);
  21. -           ast_set_flag(&mask[1], SIP_PAGE2_SYMMETRICRTP);
  22.             ast_set_flag(&flags[1], SIP_PAGE2_SYMMETRICRTP);
  23.         }
  24.     } else if (!strcasecmp(v->name, "directmedia") || !strcasecmp(v->name, "canreinvite")) {
  25. @@ -28643,7 +28640,8 @@
  26.     struct sip_peer *peer;
  27.     char *cat, *stringp, *context, *oldregcontext;
  28.     char newcontexts[AST_MAX_CONTEXT], oldcontexts[AST_MAX_CONTEXT];
  29. -   struct ast_flags dummy[2];
  30. +   struct ast_flags dummy[2] = {{0}};
  31. +   struct ast_flags setflags[2] = {{0}};
  32.     struct ast_flags config_flags = { reason == CHANNEL_MODULE_LOAD ? 0 : ast_test_flag(&global_flags[1], SIP_PAGE2_RTCACHEFRIENDS) ? 0 : CONFIG_FLAG_FILEUNCHANGED };
  33.     int auto_sip_domains = FALSE;
  34.     struct ast_sockaddr old_bindaddr = bindaddr;
  35. @@ -28881,10 +28879,10 @@
  36.  
  37.     /* Read the [general] config section of sip.conf (or from realtime config) */
  38.     for (v = ast_variable_browse(cfg, "general"); v; v = v->next) {
  39. -       if (handle_common_options(&global_flags[0], &dummy[0], v)) {
  40. +       if (handle_common_options(&setflags[0], &dummy[0], v)) {
  41.             continue;
  42.         }
  43. -       if (handle_t38_options(&global_flags[0], &dummy[0], v, &global_t38_maxdatagram)) {
  44. +       if (handle_t38_options(&setflags[0], &dummy[0], v, &global_t38_maxdatagram)) {
  45.             continue;
  46.         }
  47.         /* handle jb conf */
  48. @@ -29371,6 +29369,11 @@
  49.         }
  50.     }
  51.  
  52. +   /* Override global defaults if setting found in general section */
  53. +   ast_copy_flags(&global_flags[0], &setflags[0], dummy[0].flags);
  54. +   ast_copy_flags(&global_flags[1], &setflags[1], dummy[1].flags);
  55. +   ast_copy_flags(&global_flags[2], &setflags[2], dummy[2].flags);
  56. +
  57.     if (subscribe_network_change) {
  58.         network_change_event_subscribe();
  59.     } else {
Advertisement
Add Comment
Please, Sign In to add comment