aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-09-13 12:24:38 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-09-13 12:24:38 +0000
commit7c29e05a807c3c840c381fbd7f143be85cafdc9d (patch)
treea18b22385df7eb1d0eae5c529f78f24b783be404
parenteae416c81995af0b554d0378435781b5ffdf53e7 (diff)
Use fromdomain in creating callid if specified (bug #2427)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3769 f38db490-d61c-443f-a65b-d21fe96a405b
-rwxr-xr-xchannels/chan_sip.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 632b0711c..832dfb063 100755
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -1261,6 +1261,7 @@ static int create_addr(struct sip_pvt *r, char *opeer)
struct sip_peer *p;
int found=0;
char *port;
+ char *callhost;
int portno;
char host[256], *hostn;
char peer[256]="";
@@ -1294,6 +1295,11 @@ static int create_addr(struct sip_pvt *r, char *opeer)
strncpy(r->username, p->username, sizeof(r->username)-1);
strncpy(r->tohost, p->tohost, sizeof(r->tohost)-1);
strncpy(r->fullcontact, p->fullcontact, sizeof(r->fullcontact)-1);
+ if (!r->initreq.headers && !ast_strlen_zero(p->fromdomain)) {
+ if ((callhost = strchr(r->callid, '@'))) {
+ strncpy(callhost + 1, p->fromdomain, sizeof(r->callid) - (callhost - r->callid) - 2);
+ }
+ }
if (ast_strlen_zero(r->tohost)) {
if (p->addr.sin_addr.s_addr)
ast_inet_ntoa(r->tohost, sizeof(r->tohost), p->addr.sin_addr);