Merged revisions 73679 via svnmerge from
[asterisk/asterisk.git] / channels / chan_sip.c
index ee68902..53e6379 100644 (file)
@@ -16002,8 +16002,12 @@ static void *do_monitor(void *data)
                        sip_do_reload(sip_reloadreason);
 
                        /* Change the I/O fd of our UDP socket */
-                       if (sipsock > -1)
-                               sipsock_read_id = ast_io_change(io, sipsock_read_id, sipsock, NULL, 0, NULL);
+                       if (sipsock > -1) {
+                               if (sipsock_read_id)
+                                       sipsock_read_id = ast_io_change(io, sipsock_read_id, sipsock, NULL, 0, NULL);
+                               else
+                                       sipsock_read_id = ast_io_add(io, sipsock, sipsock_read, AST_IO_IN, NULL);
+                       }
                }
 
                /* Check for dialogs needing to be killed */