summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
Diffstat (limited to 'channels')
-rwxr-xr-xchannels/chan_sip.c3
-rwxr-xr-xchannels/chan_zap.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index b4602275a..fd5971e0f 100755
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -2833,6 +2833,9 @@ static int transmit_register(struct sip_registry *r, char *cmd, char *auth)
strncpy(p->peername, r->username, sizeof(p->peername)-1);
strncpy(p->username, r->username, sizeof(p->username)-1);
strncpy(p->exten, r->contact, sizeof(p->exten) - 1);
+ /* Always bind to our IP if specified */
+ if (bindaddr.sin_addr.s_addr)
+ memcpy(&p->ourip, &bindaddr.sin_addr, sizeof(p->ourip));
build_contact(p);
}
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index fe490c5d7..25b25f2af 100755
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -4348,7 +4348,7 @@ static int handle_init_event(struct zt_pvt *i, int event)
}
} else {
/* Check for callerid, digits, etc */
- chan = zt_new(i, AST_STATE_DOWN, 0, SUB_REAL, 0);
+ chan = zt_new(i, AST_STATE_RESERVED, 0, SUB_REAL, 0);
if (chan) {
if (has_voicemail(i))
#ifdef ZT_TONE_STUTTER
@@ -4560,7 +4560,7 @@ static void *do_monitor(void *data)
if (last->msgstate != res) {
int x;
ast_log(LOG_DEBUG, "Message status for %s changed from %d to %d on %d\n", last->mailbox, last->msgstate, res, last->channel);
- x = ZT_FLUSH_WRITE;
+ x = ZT_FLUSH_BOTH;
res2 = ioctl(last->subs[SUB_REAL].zfd, ZT_FLUSH, &x);
if (res2)
ast_log(LOG_WARNING, "Unable to flush input on channel %d\n", last->channel);