aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-06 15:55:41 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-06 15:55:41 +0000
commit7b022d61ea366608129d069655e9c4feb9331b7b (patch)
tree35affc992d7a4d5f4b6cde1da05841e8996880fe /channels
parent5946c7091c63043ff0c42062c97331df8a3aaaef (diff)
(closes issue #10125)
Reported by: makoto Patches submitted by: makoto This fixes a crash in chan_sip that happens when the bindaddr setting is not valid on Asterisk startup, gets fixed, and then a reload gets issued. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@73678 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index e8ca9dd0c..e01fbf9e3 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -11672,8 +11672,12 @@ static void *do_monitor(void *data)
sip_do_reload();
/* 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 interfaces needing to be killed */
ast_mutex_lock(&iflock);