projects
/
asterisk/asterisk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fba6a02
)
Build tohost on options
author
Mark Spencer
<markster@digium.com>
Sat, 3 May 2003 03:29:58 +0000
(
03:29
+0000)
committer
Mark Spencer
<markster@digium.com>
Sat, 3 May 2003 03:29:58 +0000
(
03:29
+0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@952
65c4cc65
-6c06-0410-ace0-
fbb531ad65f3
channels/chan_sip.c
patch
|
blob
|
history
diff --git
a/channels/chan_sip.c
b/channels/chan_sip.c
index
74ae10c
..
10f2075
100755
(executable)
--- a/
channels/chan_sip.c
+++ b/
channels/chan_sip.c
@@
-4740,7
+4740,10
@@
static int sip_poke_peer(struct sip_peer *peer)
}
memcpy(&p->sa, &peer->addr, sizeof(p->sa));
memcpy(&p->recv, &peer->addr, sizeof(p->sa));
- strncpy(p->tohost, peer->tohost, sizeof(p->tohost) - 1);
+ if (strlen(p->tohost))
+ strncpy(p->tohost, peer->tohost, sizeof(p->tohost) - 1);
+ else
+ snprintf(p->tohost, sizeof(p->tohost), "%s", inet_ntoa(p->addr.sin_addr));
/* Recalculate our side, and recalculate Call ID */
memcpy(&p->ourip, myaddrfor(&p->sa.sin_addr), sizeof(p->ourip));