inet_ntoa, which uses thread specific data (aka thread local storage) instead
of stack allocatted buffers to store the result.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
/* Find first unused call number that hasn't been used in a while */
@ -1575,7 +1574,7 @@ static int handle_error(void)
if(m.msg_controllen){
sin=(structsockaddr_in*)SO_EE_OFFENDER(&e);
if(sin)
ast_log(LOG_WARNING,"Receive error from %s\n",ast_inet_ntoa(iabuf,sizeof(iabuf),sin->sin_addr));
ast_log(LOG_WARNING,"Receive error from %s\n",ast_inet_ntoa(sin->sin_addr));
else
ast_log(LOG_WARNING,"No address detected??\n");
}else{
@ -1603,7 +1602,6 @@ static int transmit_trunk(struct iax_frame *f, struct sockaddr_in *sin, int sock
staticintsend_packet(structiax_frame*f)
{
intres;
chariabuf[INET_ADDRSTRLEN];
intcallno=f->callno;
/* Don't send if there was an error, but return error instead */
@ -1612,7 +1610,7 @@ static int send_packet(struct iax_frame *f)
/* Called with iaxsl held */
if(option_debug>2&&iaxdebug)
ast_log(LOG_DEBUG,"Sending %d on %d/%d to %s:%d\n",f->ts,callno,iaxs[callno]->peercallno,ast_inet_ntoa(iabuf,sizeof(iabuf),iaxs[callno]->addr.sin_addr),ntohs(iaxs[callno]->addr.sin_port));
ast_log(LOG_DEBUG,"Sending %d on %d/%d to %s:%d\n",f->ts,callno,iaxs[callno]->peercallno,ast_inet_ntoa(iaxs[callno]->addr.sin_addr),ntohs(iaxs[callno]->addr.sin_port));
ast_log(LOG_DEBUG,"Expanded trunk '%s:%d' to %d bytes\n",ast_inet_ntoa(iabuf,sizeof(iabuf),tpeer->addr.sin_addr),ntohs(tpeer->addr.sin_port),tpeer->trunkdataalloc);
ast_log(LOG_DEBUG,"Expanded trunk '%s:%d' to %d bytes\n",ast_inet_ntoa(tpeer->addr.sin_addr),ntohs(tpeer->addr.sin_port),tpeer->trunkdataalloc);
}else{
ast_log(LOG_WARNING,"Maximum trunk data space exceeded to %s:%d\n",ast_inet_ntoa(iabuf,sizeof(iabuf),tpeer->addr.sin_addr),ntohs(tpeer->addr.sin_port));
ast_log(LOG_WARNING,"Maximum trunk data space exceeded to %s:%d\n",ast_inet_ntoa(tpeer->addr.sin_addr),ntohs(tpeer->addr.sin_port));
ast_mutex_unlock(&tpeer->lock);
return-1;
}
@ -4021,7 +4008,6 @@ static int __iax2_show_peers(int manager, int fd, struct mansession *s, int argc
structiax2_peer*peer=NULL;
charname[256];
chariabuf[INET_ADDRSTRLEN];
intregisteredonly=0;
char*term=manager?"\r\n":"\n";
@ -4089,10 +4075,10 @@ static int __iax2_show_peers(int manager, int fd, struct mansession *s, int argc
/* They've provided a plain text password and we support that */
if(strcmp(secret,p->secret)){
if(authdebug)
ast_log(LOG_NOTICE,"Host %s did not provide proper plaintext password for '%s'\n",ast_inet_ntoa(iabuf,sizeof(iabuf),sin->sin_addr),p->name);
ast_log(LOG_NOTICE,"Host %s did not provide proper plaintext password for '%s'\n",ast_inet_ntoa(sin->sin_addr),p->name);
if(ast_test_flag(p,IAX_TEMPONLY))
destroy_peer(p);
return-1;
@ -5083,13 +5064,12 @@ static int authenticate(char *challenge, char *secret, char *keyn, int authmetho
{
intres=-1;
intx;
chariabuf[INET_ADDRSTRLEN];
if(!ast_strlen_zero(keyn)){
if(!(authmethods&IAX_AUTH_RSA)){
if(ast_strlen_zero(secret))
ast_log(LOG_NOTICE,"Asked to authenticate to %s with an RSA key, but they don't allow RSA authentication\n",ast_inet_ntoa(iabuf,sizeof(iabuf),sin->sin_addr));
ast_log(LOG_NOTICE,"Asked to authenticate to %s with an RSA key, but they don't allow RSA authentication\n",ast_inet_ntoa(sin->sin_addr));
}elseif(ast_strlen_zero(challenge)){
ast_log(LOG_NOTICE,"No challenge provided for RSA authentication to %s\n",ast_inet_ntoa(iabuf,sizeof(iabuf),sin->sin_addr));
ast_log(LOG_NOTICE,"No challenge provided for RSA authentication to %s\n",ast_inet_ntoa(sin->sin_addr));
}else{
charsig[256];
structast_key*key;
@ -5128,7 +5108,7 @@ static int authenticate(char *challenge, char *secret, char *keyn, int authmetho
iax_ie_append_str(ied,IAX_IE_PASSWORD,secret);
res=0;
}else
ast_log(LOG_NOTICE,"No way to send secret to peer '%s' (their methods: %d)\n",ast_inet_ntoa(iabuf,sizeof(iabuf),sin->sin_addr),authmethods);
ast_log(LOG_NOTICE,"No way to send secret to peer '%s' (their methods: %d)\n",ast_inet_ntoa(sin->sin_addr),authmethods);
}
returnres;
}
@ -5356,7 +5336,6 @@ static int iax2_ack_registry(struct iax_ies *ies, struct sockaddr_in *sin, int c
charourip[256]="<Unspecified>";
structsockaddr_inoldus;
structsockaddr_inus;
chariabuf[INET_ADDRSTRLEN];
intoldmsgs;
memset(&us,0,sizeof(us));
@ -5377,7 +5356,7 @@ static int iax2_ack_registry(struct iax_ies *ies, struct sockaddr_in *sin, int c
memcpy(&oldus,®->us,sizeof(oldus));
oldmsgs=reg->messages;
if(inaddrcmp(®->addr,sin)){
ast_log(LOG_WARNING,"Received unsolicited registry ack from '%s'\n",ast_inet_ntoa(iabuf,sizeof(iabuf),sin->sin_addr));
ast_log(LOG_WARNING,"Received unsolicited registry ack from '%s'\n",ast_inet_ntoa(sin->sin_addr));
return-1;
}
memcpy(®->us,&us,sizeof(reg->us));
@ -5400,10 +5379,10 @@ static int iax2_ack_registry(struct iax_ies *ies, struct sockaddr_in *sin, int c
snprintf(msgstatus,sizeof(msgstatus)," with 1 new message waiting\n");
else
snprintf(msgstatus,sizeof(msgstatus)," with no messages waiting\n");
ast_log(LOG_DEBUG,"Trunking %d call chunks in %d bytes to %s:%d, ts=%d\n",calls,fr->datalen,ast_inet_ntoa(iabuf,sizeof(iabuf),tpeer->addr.sin_addr),ntohs(tpeer->addr.sin_port),ntohl(mth->ts));
ast_log(LOG_DEBUG,"Trunking %d call chunks in %d bytes to %s:%d, ts=%d\n",calls,fr->datalen,ast_inet_ntoa(tpeer->addr.sin_addr),ntohs(tpeer->addr.sin_port),ntohl(mth->ts));
#endif
/* Reset transmit trunk side data */
tpeer->trunkdatalen=0;
@ -5926,7 +5902,6 @@ static int timing_read(int *id, int fd, short events, void *cbdata)
@ -5972,7 +5947,7 @@ static int timing_read(int *id, int fd, short events, void *cbdata)
}else{
res=send_trunk(tpeer,&now);
if(iaxtrunkdebug)
ast_verbose(" - Trunk peer (%s:%d) has %d call chunk%s in transit, %d bytes backloged and has hit a high water mark of %d bytes\n",ast_inet_ntoa(iabuf,sizeof(iabuf),tpeer->addr.sin_addr),ntohs(tpeer->addr.sin_port),res,(res!=1)?"s":"",tpeer->trunkdatalen,tpeer->trunkdataalloc);
ast_verbose(" - Trunk peer (%s:%d) has %d call chunk%s in transit, %d bytes backloged and has hit a high water mark of %d bytes\n",ast_inet_ntoa(tpeer->addr.sin_addr),ntohs(tpeer->addr.sin_port),res,(res!=1)?"s":"",tpeer->trunkdatalen,tpeer->trunkdataalloc);
}
totalcalls+=res;
res=0;
@ -5985,7 +5960,7 @@ static int timing_read(int *id, int fd, short events, void *cbdata)
ast_mutex_lock(&drop->lock);
/* Once we have this lock, we're sure nobody else is using it or could use it once we release it,
@ -6246,7 +6221,6 @@ static int socket_process(struct iax2_thread *thread)
structast_iax2_meta_trunk_mini*mtm;
structiax_frame*fr;
structiax_frame*cur;
chariabuf[INET_ADDRSTRLEN];
structast_framef;
structast_channel*c;
structiax2_dpcache*dp;
@ -6282,7 +6256,7 @@ static int socket_process(struct iax2_thread *thread)
}
if((vh->zeros==0)&&(ntohs(vh->callno)&0x8000)){
if(res<sizeof(*vh)){
ast_log(LOG_WARNING,"Rejecting packet from '%s.%d' that is flagged as a video frame but is too short\n",ast_inet_ntoa(iabuf,sizeof(iabuf),sin.sin_addr),ntohs(sin.sin_port));
ast_log(LOG_WARNING,"Rejecting packet from '%s.%d' that is flagged as a video frame but is too short\n",ast_inet_ntoa(sin.sin_addr),ntohs(sin.sin_port));
return1;
}
@ -6293,7 +6267,7 @@ static int socket_process(struct iax2_thread *thread)
unsignedcharmetatype;
if(res<sizeof(*meta)){
ast_log(LOG_WARNING,"Rejecting packet from '%s.%d' that is flagged as a meta frame but is too short\n",ast_inet_ntoa(iabuf,sizeof(iabuf),sin.sin_addr),ntohs(sin.sin_port));
ast_log(LOG_WARNING,"Rejecting packet from '%s.%d' that is flagged as a meta frame but is too short\n",ast_inet_ntoa(sin.sin_addr),ntohs(sin.sin_port));
return1;
}
@ -6312,7 +6286,7 @@ static int socket_process(struct iax2_thread *thread)
ptr=mth->data;
tpeer=find_tpeer(&sin,fd);
if(!tpeer){
ast_log(LOG_WARNING,"Unable to accept trunked packet from '%s:%d': No matching peer\n",ast_inet_ntoa(iabuf,sizeof(iabuf),sin.sin_addr),ntohs(sin.sin_port));
ast_log(LOG_WARNING,"Unable to accept trunked packet from '%s:%d': No matching peer\n",ast_inet_ntoa(sin.sin_addr),ntohs(sin.sin_port));
return1;
}
tpeer->trunkact=ast_tvnow();
@ -6339,7 +6313,7 @@ static int socket_process(struct iax2_thread *thread)
callno=ntohs(mte->callno);
trunked_ts=0;
}else{
ast_log(LOG_WARNING,"Unknown meta trunk cmd from '%s:%d': dropping\n",ast_inet_ntoa(iabuf,sizeof(iabuf),sin.sin_addr),ntohs(sin.sin_port));
ast_log(LOG_WARNING,"Unknown meta trunk cmd from '%s:%d': dropping\n",ast_inet_ntoa(sin.sin_addr),ntohs(sin.sin_port));
break;
}
/* Stop if we don't have enough data */
@ -6413,7 +6387,7 @@ static int socket_process(struct iax2_thread *thread)
#endif
if(ntohs(mh->callno)&IAX_FLAG_FULL){
if(res<sizeof(*fh)){
ast_log(LOG_WARNING,"Rejecting packet from '%s.%d' that is flagged as a full frame but is too short\n",ast_inet_ntoa(iabuf,sizeof(iabuf),sin.sin_addr),ntohs(sin.sin_port));
ast_log(LOG_WARNING,"Rejecting packet from '%s.%d' that is flagged as a full frame but is too short\n",ast_inet_ntoa(sin.sin_addr),ntohs(sin.sin_port));
return1;
}
@ -6616,7 +6590,7 @@ static int socket_process(struct iax2_thread *thread)
ast_log(LOG_WARNING,"Undecodable frame received from '%s'\n",ast_inet_ntoa(iabuf,sizeof(iabuf),sin.sin_addr));
ast_log(LOG_WARNING,"Undecodable frame received from '%s'\n",ast_inet_ntoa(sin.sin_addr));
ast_mutex_unlock(&iaxsl[fr->callno]);
return1;
}
@ -6761,7 +6735,7 @@ retryowner:
/* They're not allowed on */
auth_fail(fr->callno,IAX_COMMAND_REJECT);
if(authdebug)
ast_log(LOG_NOTICE,"Rejected connect attempt from %s, who was trying to reach '%s@%s'\n",ast_inet_ntoa(iabuf,sizeof(iabuf),sin.sin_addr),iaxs[fr->callno]->exten,iaxs[fr->callno]->context);
ast_log(LOG_NOTICE,"Rejected connect attempt from %s, who was trying to reach '%s@%s'\n",ast_inet_ntoa(sin.sin_addr),iaxs[fr->callno]->exten,iaxs[fr->callno]->context);
break;
}
/* This might re-enter the IAX code and need the lock */
ast_log(LOG_NOTICE,"Rejected connect attempt from %s, request '%s@%s' does not exist\n",ast_inet_ntoa(iabuf,sizeof(iabuf),sin.sin_addr),iaxs[fr->callno]->exten,iaxs[fr->callno]->context);
ast_log(LOG_NOTICE,"Rejected connect attempt from %s, request '%s@%s' does not exist\n",ast_inet_ntoa(sin.sin_addr),iaxs[fr->callno]->exten,iaxs[fr->callno]->context);
ast_log(LOG_NOTICE,"Rejected call to %s, format 0x%x incompatible with our capability 0x%x.\n",ast_inet_ntoa(iabuf,sizeof(iabuf),sin.sin_addr),iaxs[fr->callno]->peerformat,iaxs[fr->callno]->capability);
ast_log(LOG_NOTICE,"Rejected call to %s, format 0x%x incompatible with our capability 0x%x.\n",ast_inet_ntoa(sin.sin_addr),iaxs[fr->callno]->peerformat,iaxs[fr->callno]->capability);
ast_log(LOG_NOTICE,"Host %s failed to authenticate as %s\n",ast_inet_ntoa(iabuf,sizeof(iabuf),iaxs[fr->callno]->addr.sin_addr),iaxs[fr->callno]->username);
ast_log(LOG_NOTICE,"Host %s failed to authenticate as %s\n",ast_inet_ntoa(iaxs[fr->callno]->addr.sin_addr),iaxs[fr->callno]->username);
ast_log(LOG_NOTICE,"Rejected connect attempt from %s, request '%s@%s' does not exist\n",ast_inet_ntoa(iabuf,sizeof(iabuf),sin.sin_addr),iaxs[fr->callno]->exten,iaxs[fr->callno]->context);
ast_log(LOG_NOTICE,"Rejected connect attempt from %s, request '%s@%s' does not exist\n",ast_inet_ntoa(sin.sin_addr),iaxs[fr->callno]->exten,iaxs[fr->callno]->context);
memset(&ied0,0,sizeof(ied0));
iax_ie_append_str(&ied0,IAX_IE_CAUSE,"No such context/extension");
ast_log(LOG_NOTICE,"Rejected dial attempt from %s, request '%s@%s' does not exist\n",ast_inet_ntoa(iabuf,sizeof(iabuf),sin.sin_addr),iaxs[fr->callno]->exten,iaxs[fr->callno]->context);
ast_log(LOG_NOTICE,"Rejected dial attempt from %s, request '%s@%s' does not exist\n",ast_inet_ntoa(sin.sin_addr),iaxs[fr->callno]->exten,iaxs[fr->callno]->context);
memset(&ied0,0,sizeof(ied0));
iax_ie_append_str(&ied0,IAX_IE_CAUSE,"No such context/extension");
@ -1019,7 +1016,6 @@ static int mgcp_show_endpoints(int fd, int argc, char *argv[])
structmgcp_gateway*g;
structmgcp_endpoint*e;
inthasendpoints=0;
chariabuf[INET_ADDRSTRLEN];
if(argc!=3)
returnRESULT_SHOWUSAGE;
@ -1027,7 +1023,7 @@ static int mgcp_show_endpoints(int fd, int argc, char *argv[])
g=gateways;
while(g){
e=g->endpoints;
ast_cli(fd,"Gateway '%s' at %s (%s)\n",g->name,g->addr.sin_addr.s_addr?ast_inet_ntoa(iabuf,sizeof(iabuf),g->addr.sin_addr):ast_inet_ntoa(iabuf,sizeof(iabuf),g->defaddr.sin_addr),g->dynamic?"Dynamic":"Static");
ast_cli(fd,"Gateway '%s' at %s (%s)\n",g->name,g->addr.sin_addr.s_addr?ast_inet_ntoa(g->addr.sin_addr):ast_inet_ntoa(g->defaddr.sin_addr),g->dynamic?"Dynamic":"Static");
while(e){
/* Don't show wilcard endpoint */
if(strcmp(e->name,g->wcardep)!=0)
@ -1536,7 +1532,6 @@ static struct mgcp_subchannel *find_subchannel_and_lock(char *name, int msgid, s
structmgcp_endpoint*p=NULL;
structmgcp_subchannel*sub=NULL;
structmgcp_gateway*g;
chariabuf[INET_ADDRSTRLEN];
chartmp[256]="";
char*at=NULL,*c;
intfound=0;
@ -1568,7 +1563,7 @@ static struct mgcp_subchannel *find_subchannel_and_lock(char *name, int msgid, s
if(ast_ouraddrfor(&g->addr.sin_addr,&g->ourip))
memcpy(&g->ourip,&__ourip,sizeof(g->ourip));
if(option_verbose>2)
ast_verbose(VERBOSE_PREFIX_3"Registered MGCP gateway '%s' at %s port %d\n",g->name,ast_inet_ntoa(iabuf,sizeof(iabuf),g->addr.sin_addr),ntohs(g->addr.sin_port));
ast_verbose(VERBOSE_PREFIX_3"Registered MGCP gateway '%s' at %s port %d\n",g->name,ast_inet_ntoa(g->addr.sin_addr),ntohs(g->addr.sin_port));
ast_log(LOG_WARNING,"sip_xmit of %p (len %d) to %s:%d returned %d: %s\n",data,len,ast_inet_ntoa(iabuf,sizeof(iabuf),dst->sin_addr),ntohs(dst->sin_port),res,strerror(errno));
ast_log(LOG_WARNING,"sip_xmit of %p (len %d) to %s:%d returned %d: %s\n",data,len,ast_inet_ntoa(dst->sin_addr),ntohs(dst->sin_port),res,strerror(errno));
returnres;
}
@ -1691,13 +1690,12 @@ static int __sip_xmit(struct sip_pvt *p, char *data, int len)
ast_verbose("%sTransmitting (NAT) to %s:%d:\n%s\n---\n",reliable?"Reliably ":"",ast_inet_ntoa(iabuf,sizeof(iabuf),p->recv.sin_addr),ntohs(p->recv.sin_port),req->data);
ast_verbose("%sTransmitting (NAT) to %s:%d:\n%s\n---\n",reliable?"Reliably ":"",ast_inet_ntoa(p->recv.sin_addr),ntohs(p->recv.sin_port),req->data);
else
ast_verbose("%sTransmitting (no NAT) to %s:%d:\n%s\n---\n",reliable?"Reliably ":"",ast_inet_ntoa(iabuf,sizeof(iabuf),p->sa.sin_addr),ntohs(p->sa.sin_port),req->data);
ast_verbose("%sTransmitting (no NAT) to %s:%d:\n%s\n---\n",reliable?"Reliably ":"",ast_inet_ntoa(p->sa.sin_addr),ntohs(p->sa.sin_port),req->data);
ast_verbose(VERBOSE_PREFIX_3"Registered SIP '%s' at %s port %d expires %d\n",peer->name,ast_inet_ntoa(iabuf,sizeof(iabuf),peer->addr.sin_addr),ntohs(peer->addr.sin_port),expiry);
ast_verbose(VERBOSE_PREFIX_3"Registered SIP '%s' at %s port %d expires %d\n",peer->name,ast_inet_ntoa(peer->addr.sin_addr),ntohs(peer->addr.sin_port),expiry);
ast_log(LOG_NOTICE,"Dont know how to handle a %d %s response from %s\n",resp,rest,p->owner?p->owner->name:ast_inet_ntoa(iabuf,sizeof(iabuf),p->sa.sin_addr));
ast_log(LOG_NOTICE,"Dont know how to handle a %d %s response from %s\n",resp,rest,p->owner?p->owner->name:ast_inet_ntoa(p->sa.sin_addr));
}
}else{
/* Responses to OUTGOING SIP requests on INCOMING calls
ast_log(LOG_ERROR,"Got SUBSCRIBE for extension %s@%s from %s, but there is no hint for that extension\n",p->exten,p->context,ast_inet_ntoa(iabuf,sizeof(iabuf),p->sa.sin_addr));
ast_log(LOG_ERROR,"Got SUBSCRIBE for extension %s@%s from %s, but there is no hint for that extension\n",p->exten,p->context,ast_inet_ntoa(p->sa.sin_addr));
ast_log(LOG_DEBUG,"Sending reinvite on SIP '%s' - It's UDPTL soon redirected to IP %s:%d\n",p->callid,ast_inet_ntoa(iabuf,sizeof(iabuf),udptl?p->udptlredirip.sin_addr:p->ourip),udptl?ntohs(p->udptlredirip.sin_port):0);
ast_log(LOG_DEBUG,"Sending reinvite on SIP '%s' - It's UDPTL soon redirected to IP %s:%d\n",p->callid,ast_inet_ntoa(udptl?p->udptlredirip.sin_addr:p->ourip),udptl?ntohs(p->udptlredirip.sin_port):0);
ast_log(LOG_DEBUG,"Deferring reinvite on SIP '%s' - It's UDPTL will be redirected to IP %s:%d\n",p->callid,ast_inet_ntoa(iabuf,sizeof(iabuf),udptl?p->udptlredirip.sin_addr:p->ourip),udptl?ntohs(p->udptlredirip.sin_port):0);
ast_log(LOG_DEBUG,"Deferring reinvite on SIP '%s' - It's UDPTL will be redirected to IP %s:%d\n",p->callid,ast_inet_ntoa(udptl?p->udptlredirip.sin_addr:p->ourip),udptl?ntohs(p->udptlredirip.sin_port):0);
ast_log(LOG_DEBUG,"Sending reinvite on SIP '%s' - It's UDPTL soon redirected to IP %s:%d\n",p->callid,ast_inet_ntoa(iabuf,sizeof(iabuf),p->udptlredirip.sin_addr),ntohs(p->udptlredirip.sin_port));
ast_log(LOG_DEBUG,"Sending reinvite on SIP '%s' - It's UDPTL soon redirected to IP %s:%d\n",p->callid,ast_inet_ntoa(p->udptlredirip.sin_addr),ntohs(p->udptlredirip.sin_port));
else
ast_log(LOG_DEBUG,"Sending reinvite on SIP '%s' - It's UDPTL soon redirected to us (IP %s)\n",p->callid,ast_inet_ntoa(iabuf,sizeof(iabuf),p->ourip));
ast_log(LOG_DEBUG,"Sending reinvite on SIP '%s' - It's UDPTL soon redirected to us (IP %s)\n",p->callid,ast_inet_ntoa(p->ourip));
ast_log(LOG_DEBUG,"Deferring reinvite on SIP '%s' - It's UDPTL will be redirected to IP %s:%d\n",p->callid,ast_inet_ntoa(iabuf,sizeof(iabuf),p->udptlredirip.sin_addr),ntohs(p->udptlredirip.sin_port));
ast_log(LOG_DEBUG,"Deferring reinvite on SIP '%s' - It's UDPTL will be redirected to IP %s:%d\n",p->callid,ast_inet_ntoa(p->udptlredirip.sin_addr),ntohs(p->udptlredirip.sin_port));
else
ast_log(LOG_DEBUG,"Deferring reinvite on SIP '%s' - It's UDPTL will be redirected to us (IP %s)\n",p->callid,ast_inet_ntoa(iabuf,sizeof(iabuf),p->ourip));
ast_log(LOG_DEBUG,"Deferring reinvite on SIP '%s' - It's UDPTL will be redirected to us (IP %s)\n",p->callid,ast_inet_ntoa(p->ourip));
ast_log(LOG_DEBUG,"Responding 200 OK on SIP '%s' - It's UDPTL soon redirected to IP %s:%d\n",p->callid,ast_inet_ntoa(iabuf,sizeof(iabuf),p->udptlredirip.sin_addr),ntohs(p->udptlredirip.sin_port));
ast_log(LOG_DEBUG,"Responding 200 OK on SIP '%s' - It's UDPTL soon redirected to IP %s:%d\n",p->callid,ast_inet_ntoa(p->udptlredirip.sin_addr),ntohs(p->udptlredirip.sin_port));
else
ast_log(LOG_DEBUG,"Responding 200 OK on SIP '%s' - It's UDPTL soon redirected to us (IP %s)\n",p->callid,ast_inet_ntoa(iabuf,sizeof(iabuf),p->ourip));
ast_log(LOG_DEBUG,"Responding 200 OK on SIP '%s' - It's UDPTL soon redirected to us (IP %s)\n",p->callid,ast_inet_ntoa(p->ourip));
if(chan->_state!=AST_STATE_UP){/* We are in early state */
chariabuf[INET_ADDRSTRLEN];
if(recordhistory)
append_history(p,"ExtInv","Initial invite sent with remote bridge proposal.");
if(option_debug)
ast_log(LOG_DEBUG,"Early remote bridge setting SIP '%s' - Sending media to %s\n",p->callid,ast_inet_ntoa(iabuf,sizeof(iabuf),rtp ?p->redirip.sin_addr:p->ourip));
ast_log(LOG_DEBUG,"Early remote bridge setting SIP '%s' - Sending media to %s\n",p->callid,ast_inet_ntoa(rtp ?p->redirip.sin_addr:p->ourip));
}elseif(!p->pendinginvite){/* We are up, and have no outstanding invite */
if(option_debug>2){
chariabuf[INET_ADDRSTRLEN];
ast_log(LOG_DEBUG,"Sending reinvite on SIP '%s' - It's audio soon redirected to IP %s\n",p->callid,ast_inet_ntoa(iabuf,sizeof(iabuf),rtp?p->redirip.sin_addr:p->ourip));
ast_log(LOG_DEBUG,"Sending reinvite on SIP '%s' - It's audio soon redirected to IP %s\n",p->callid,ast_inet_ntoa(rtp?p->redirip.sin_addr:p->ourip));
ast_log(LOG_DEBUG,"Deferring reinvite on SIP '%s' - It's audio will be redirected to IP %s\n",p->callid,ast_inet_ntoa(iabuf,sizeof(iabuf),rtp?p->redirip.sin_addr:p->ourip));
ast_log(LOG_DEBUG,"Deferring reinvite on SIP '%s' - It's audio will be redirected to IP %s\n",p->callid,ast_inet_ntoa(rtp?p->redirip.sin_addr:p->ourip));
}
/* We have a pending Invite. Send re-invite when we're done with the invite */
ast_verbose(VERBOSE_PREFIX_2"%sManager '%s' logged on from %s\n",(s->sessiontimeout?"HTTP ":""),s->username,ast_inet_ntoa(iabuf,sizeof(iabuf),s->sin.sin_addr));
ast_verbose(VERBOSE_PREFIX_2"%sManager '%s' logged on from %s\n",(s->sessiontimeout?"HTTP ":""),s->username,ast_inet_ntoa(s->sin.sin_addr));
}
}
ast_log(LOG_EVENT,"%sManager '%s' logged on from %s\n",(s->sessiontimeout?"HTTP ":""),s->username,ast_inet_ntoa(iabuf,sizeof(iabuf),s->sin.sin_addr));
ast_log(LOG_EVENT,"%sManager '%s' logged on from %s\n",(s->sessiontimeout?"HTTP ":""),s->username,ast_inet_ntoa(s->sin.sin_addr));
ast_log(LOG_ERROR,"Unable to bind to %s port %d: %s\n",ast_inet_ntoa(iabuf,sizeof(iabuf),bindaddr->sin_addr),ntohs(bindaddr->sin_port),strerror(errno));
ast_log(LOG_ERROR,"Unable to bind to %s port %d: %s\n",ast_inet_ntoa(bindaddr->sin_addr),ntohs(bindaddr->sin_port),strerror(errno));
ast_log(LOG_DEBUG,"RTCP NAT: Got RTCP from other end. Now sending to address %s:%d\n",ast_inet_ntoa(iabuf,sizeof(iabuf),rtp->rtcp->them.sin_addr),ntohs(rtp->rtcp->them.sin_port));
ast_log(LOG_DEBUG,"RTCP NAT: Got RTCP from other end. Now sending to address %s:%d\n",ast_inet_ntoa(rtp->rtcp->them.sin_addr),ntohs(rtp->rtcp->them.sin_port));
ast_verbose("Received an SDES from %s:%d\n",ast_inet_ntoa(iabuf,sizeof(iabuf),rtp->rtcp->them.sin_addr),ntohs(rtp->rtcp->them.sin_port));
ast_verbose("Received an SDES from %s:%d\n",ast_inet_ntoa(rtp->rtcp->them.sin_addr),ntohs(rtp->rtcp->them.sin_port));
break;
caseRTCP_PT_BYE:
if(rtcp_debug_test_addr(&sin))
ast_verbose("Received a BYE from %s:%d\n",ast_inet_ntoa(iabuf,sizeof(iabuf),rtp->rtcp->them.sin_addr),ntohs(rtp->rtcp->them.sin_port));
ast_verbose("Received a BYE from %s:%d\n",ast_inet_ntoa(rtp->rtcp->them.sin_addr),ntohs(rtp->rtcp->them.sin_port));
break;
default:
ast_log(LOG_NOTICE,"Unknown RTCP packet (pt=%d) received from %s:%d\n",pt,ast_inet_ntoa(iabuf,sizeof(iabuf),rtp->rtcp->them.sin_addr),ntohs(rtp->rtcp->them.sin_port));
ast_log(LOG_NOTICE,"Unknown RTCP packet (pt=%d) received from %s:%d\n",pt,ast_inet_ntoa(rtp->rtcp->them.sin_addr),ntohs(rtp->rtcp->them.sin_port));
ast_log(LOG_DEBUG,"RTP NAT: Got audio from other end. Now sending to address %s:%d\n",ast_inet_ntoa(iabuf,sizeof(iabuf),rtp->them.sin_addr),ntohs(rtp->them.sin_port));
ast_log(LOG_DEBUG,"RTP NAT: Got audio from other end. Now sending to address %s:%d\n",ast_inet_ntoa(rtp->them.sin_addr),ntohs(rtp->them.sin_port));
ast_log(LOG_ERROR,"RTCP SR transmission error to %s:%d, rtcp halted %s\n",ast_inet_ntoa(iabuf,sizeof(iabuf),rtp->rtcp->them.sin_addr),ntohs(rtp->rtcp->them.sin_port),strerror(errno));
ast_log(LOG_ERROR,"RTCP SR transmission error to %s:%d, rtcp halted %s\n",ast_inet_ntoa(rtp->rtcp->them.sin_addr),ntohs(rtp->rtcp->them.sin_port),strerror(errno));
if(rtp->rtcp->schedid>0)
ast_sched_del(rtp->sched,rtp->rtcp->schedid);
rtp->rtcp->schedid=-1;
@ -2063,7 +2055,7 @@ static int ast_rtcp_write_sr(void *data)
rtp->rtcp->lastsrtxcount=rtp->txcount;
if(rtcp_debug_test_addr(&rtp->rtcp->them)){
ast_verbose("* Sent RTCP SR to %s:%d\n",ast_inet_ntoa(iabuf,sizeof(iabuf),rtp->rtcp->them.sin_addr),ntohs(rtp->rtcp->them.sin_port));
ast_verbose("* Sent RTCP SR to %s:%d\n",ast_inet_ntoa(rtp->rtcp->them.sin_addr),ntohs(rtp->rtcp->them.sin_port));
ast_log(LOG_DEBUG,"RTP Transmission error of packet %d to %s:%d: %s\n",rtp->seqno,ast_inet_ntoa(iabuf,sizeof(iabuf),rtp->them.sin_addr),ntohs(rtp->them.sin_port),strerror(errno));
ast_log(LOG_DEBUG,"RTP Transmission error of packet %d to %s:%d: %s\n",rtp->seqno,ast_inet_ntoa(rtp->them.sin_addr),ntohs(rtp->them.sin_port),strerror(errno));
/* Only give this error message once if we are not RTP debugging */
if(option_debug||rtpdebug)
ast_log(LOG_DEBUG,"RTP NAT: Can't write RTP to private address %s:%d, waiting for other end to send audio...\n",ast_inet_ntoa(iabuf,sizeof(iabuf),rtp->them.sin_addr),ntohs(rtp->them.sin_port));
ast_log(LOG_DEBUG,"RTP NAT: Can't write RTP to private address %s:%d, waiting for other end to send audio...\n",ast_inet_ntoa(rtp->them.sin_addr),ntohs(rtp->them.sin_port));
ast_set_flag(rtp,FLAG_NAT_INACTIVE_NOWARN);
}
}else{
@ -2312,7 +2300,7 @@ static int ast_rtp_raw_write(struct ast_rtp *rtp, struct ast_frame *f, int codec
if(rtp_debug_test_addr(&rtp->them))
ast_verbose("Sent RTP packet to %s:%d (type %-2.2d, seq %-6.6u, ts %-6.6u, len %-6.6u)\n",