diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-01-26 00:11:38 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-01-26 00:11:38 +0000 |
commit | 4090226619d03dd84f9fce0545ae4ca1f7784967 (patch) | |
tree | 1e5ae9a737f48cdcaabf31b65caea2ec8a0385e6 /channels | |
parent | 7af32f3a63989284fd9b681f86bde282f5e524a2 (diff) |
Make sure registration is taken care of if DNS fails (bug #3424)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@4891 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rwxr-xr-x | channels/chan_sip.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 41590e87e..db0652970 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -4204,7 +4204,14 @@ static int transmit_register(struct sip_registry *r, char *cmd, char *auth, char } /* Find address to hostname */ if (create_addr(p,r->hostname)) { + /* we have what we hope is a temporary network error, + * probably DNS. We need to reschedule a registration try */ sip_destroy(p); + if (r->timeout > -1) { + ast_log(LOG_WARNING, "Still have a registration timeout (create_addr() error), %d\n", r->timeout); + ast_sched_del(sched, r->timeout); + } + r->timeout = ast_sched_add(sched, global_reg_timeout*1000, sip_reg_timeout, r); return 0; } |