/* Start optimistic */
int res = AST_SENSE_ALLOW;
while(ha) {
- char tmp[80];
- char tmp2[80];
+ char iabuf[INET_ADDRSTRLEN];
+ char iabuf2[INET_ADDRSTRLEN];
/* DEBUG */
- ast_log(LOG_DEBUG, "##### Testing %s with %s\n",ast_inet_ntoa(tmp, sizeof(tmp), sin->sin_addr), ast_inet_ntoa(tmp2, sizeof(tmp2), ha->netaddr));
+ ast_log(LOG_DEBUG,
+ "##### Testing %s with %s\n",
+ ast_inet_ntoa(iabuf, sizeof(iabuf), sin->sin_addr),
+ ast_inet_ntoa(iabuf2, sizeof(iabuf2), ha->netaddr));
/* For each rule, if this address and the netmask = the net address
apply the current rule */
if ((sin->sin_addr.s_addr & ha->netmask.s_addr) == (ha->netaddr.s_addr))
struct rt_msghdr m_rtm;
char m_space[512];
} m_rtmsg;
- char tmp[80];
+ char iabuf[INET_ADDRSTRLEN];
char *cp, *p;
int i, l, s, seq, flags;
pid_t pid = getpid();
static int routeseq; /* Protected by "routeseq_lock" mutex */
- p = ast_strdupa(ast_inet_ntoa(tmp, sizeof(tmp), *them));
+ p = ast_strdupa(ast_inet_ntoa(iabuf, sizeof(iabuf), *them));
memset(us, 0, sizeof(struct in_addr));
memset(&m_rtmsg, 0, sizeof(m_rtmsg));
if (i == RTA_IFA && sa->sa_family == AF_INET) {
sin = (struct sockaddr_in *)sa;
*us = sin->sin_addr;
- ast_log(LOG_DEBUG, "Found route to %s, output from our address %s.\n", p, ast_inet_ntoa(tmp, sizeof(tmp), *us));
+ ast_log(LOG_DEBUG, "Found route to %s, output from our address %s.\n", p, ast_inet_ntoa(iabuf, sizeof(iabuf), *us));
return 0;
}
cp += sa->sa_len > 0 ?
sscanf(fields[2],"%x",&gateway);
sscanf(fields[7],"%x",&mask);
#if 0
- { char tmp[80];
- printf("Addr: %s %08x Dest: %08x Mask: %08x\n", ast_inet_ntoa(tmp, sizeof(tmp), *them), remote_ip, dest, mask); }
+ { char iabuf[INET_ADDRSTRLEN];
+ printf("Addr: %s %08x Dest: %08x Mask: %08x\n", ast_inet_ntoa(iabuf, sizeof(iabuf), *them), remote_ip, dest, mask); }
#endif
/* Looks simple, but here is the magic */
if (((remote_ip & mask) ^ dest) == 0) {
struct oh323_user *find_user(const call_details_t cd)
{
struct oh323_user *u;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
u = userl.users;
if(userbyalias == 1){
while(u) {
but this function wants to return a static variable so
the only way to do this will be to declare iabuf within
the oh323_pvt structure XXX */
- static char iabuf[80];
+ static char iabuf[INET_ADDRSTRLEN];
info = (struct rtp_info *) malloc(sizeof(struct rtp_info));
/* struct ast_channel *c = NULL; */
struct oh323_user *user = NULL;
struct oh323_alias *alias = NULL;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
/* allocate the call*/
p = oh323_alloc(cd.call_reference);
struct sockaddr_in them;
struct sockaddr_in us;
char *mode;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
mode = convertcap(chan->writeformat);
char subclass2[20];
char *class;
char *subclass;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (f) {
fh = f->data;
snprintf(retries, sizeof(retries), "%03d", f->retries);
static int send_packet(struct ast_iax_frame *f)
{
int res;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
/* Called with iaxsl held */
if (option_debug)
ast_log(LOG_DEBUG, "Sending %d on %d/%d to %s:%d\n", f->ts, f->callno, iaxs[f->callno]->peercallno, ast_inet_ntoa(iabuf, sizeof(iabuf), iaxs[f->callno]->addr.sin_addr), ntohs(iaxs[f->callno]->addr.sin_port));
struct ast_iax_frame *f = data;
int freeme=0;
int callno = f->callno;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
/* Make sure this call is still active */
if (callno > -1)
ast_mutex_lock(&iaxsl[callno]);
int res;
char req0[256];
char req1[256];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
struct chan_iax_pvt *p0 = c0->pvt->pvt;
struct chan_iax_pvt *p1 = c1->pvt->pvt;
snprintf(req0, sizeof(req0), "remip=%s;remport=%d;remcall=%d;", ast_inet_ntoa(iabuf, sizeof(iabuf), p1->addr.sin_addr), ntohs(p1->addr.sin_port), p1->peercallno);
{
char host[256];
struct ast_channel *tmp;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
tmp = ast_channel_alloc(1);
if (tmp) {
if (!iax_getpeername(i->addr, host, sizeof(host)))
#define FORMAT "%-15.15s %-15.15s %s %-15.15s %-8d %-10s\n"
struct iax_peer *peer;
char name[256] = "";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (argc != 3)
return RESULT_SHOWUSAGE;
ast_mutex_lock(&peerl.lock);
struct iax_registry *reg;
char host[80];
char perceived[80];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (argc != 3)
return RESULT_SHOWUSAGE;
ast_mutex_lock(&peerl.lock);
#define FORMAT "%-15.15s %-10.10s %5.5d/%5.5d %5.5d/%5.5d %-5.5dms %-4.4dms %-6.6s\n"
int x;
int numchans = 0;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (argc != 3)
return RESULT_SHOWUSAGE;
ast_cli(fd, FORMAT2, "Peer", "Username", "ID (Lo/Rem)", "Seq (Tx/Rx)", "Lag", "Jitter", "Format");
char *var, *value;
struct iax_user *user;
char request[256];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int gotcapability=0;
char *stringp=NULL;
strncpy(request, orequest, sizeof(request)-1);
static int raw_hangup(struct sockaddr_in *sin, short src, short dst)
{
struct ast_iax_full_hdr fh;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
fh.callno = htons(src | AST_FLAG_FULL);
fh.dcallno = htons(dst);
fh.ts = 0;
char md5secret[256] = "";
char rsasecret[256] = "";
char secret[256] = "";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
struct iax_peer *p;
struct ast_key *key;
char *var;
{
int res = -1;
int x;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (keyn && strlen(keyn)) {
if (!strstr(methods, "rsa")) {
if (!secret || !strlen(secret))
int ourport = 0;
int refresh = 0;
char ourip[256] = "<Unspecified>";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
struct sockaddr_in oldus;
char *var, *value;
char *stringp=NULL;
/* Called from IAX thread only, with proper iaxsl lock */
char requeststr[256] = "";
struct iax_peer *p;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
for (p = peerl.peers;p;p = p->next) {
if (!strcasecmp(name, p->name)) {
break;
char peer[256] = "";
char methods[256] = "";
char challenge[256] = "";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char *var, *value;
int res;
char *stringp=NULL;
int format;
int exists;
int mm;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char rel0[256];
char rel1[255];
char empty[32]=""; /* Safety measure */
int x;
struct iax_registry *reg;
struct iax_peer *peer;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
struct sockaddr_in sin;
static struct chan_iax2_pvt *new_iax(struct sockaddr_in *sin, int lockpeer)
{
struct chan_iax2_pvt *tmp;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
tmp = malloc(sizeof(struct chan_iax2_pvt));
if (tmp) {
memset(tmp, 0, sizeof(struct chan_iax2_pvt));
static int send_packet(struct iax_frame *f)
{
int res;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
/* Called with iaxsl held */
if (option_debug)
ast_log(LOG_DEBUG, "Sending %d on %d/%d to %s:%d\n", f->ts, f->callno, iaxs[f->callno]->peercallno, ast_inet_ntoa(iabuf, sizeof(iabuf), iaxs[f->callno]->addr.sin_addr), ntohs(iaxs[f->callno]->addr.sin_port));
struct iax_frame *f = data;
int freeme=0;
int callno = f->callno;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
/* Make sure this call is still active */
if (callno)
ast_mutex_lock(&iaxsl[callno]);
static int forward_delivery(struct iax_frame *fr)
{
struct chan_iax2_pvt *p1, *p2;
- char tmp[80];
+ char iabuf[INET_ADDRSTRLEN];
p1 = iaxs[fr->callno];
p2 = iaxs[p1->bridgecallno];
if (!p1)
fr->ts,
p1->callno, p1->peercallno,
p2->callno, p2->peercallno,
- ast_inet_ntoa(tmp, sizeof(tmp), p2->addr.sin_addr), ntohs(p2->addr.sin_port));
+ ast_inet_ntoa(iabuf, sizeof(iabuf), p2->addr.sin_addr),
+ ntohs(p2->addr.sin_port));
/* Fix relative timestamp */
fr->ts = calc_fakestamp(p1, p2, fr->ts);
if (mysql && (strlen(peer) < 128)) {
char query[512];
char *name;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
time_t nowtime;
name = alloca(strlen(peer) * 2 + 1);
time(&nowtime);
static struct iax2_trunk_peer *find_tpeer(struct sockaddr_in *sin)
{
struct iax2_trunk_peer *tpeer;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
/* Finds and locks trunk peer */
ast_mutex_lock(&tpeerlock);
tpeer = tpeers;
struct iax2_trunk_peer *tpeer;
void *tmp, *ptr;
struct ast_iax2_meta_trunk_entry *met;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
tpeer = find_tpeer(&pvt->addr);
if (tpeer) {
if (tpeer->trunkdatalen + f->datalen + 4 >= tpeer->trunkdataalloc) {
#define FORMAT "%-15.15s %-15.15s %s %-15.15s %-5d%s %-10s\n"
struct iax2_peer *peer;
char name[256] = "";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int registeredonly=0;
if ((argc != 3) && (argc != 4) && (argc != 5))
return RESULT_SHOWUSAGE;
struct iax2_registry *reg;
char host[80];
char perceived[80];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (argc != 3)
return RESULT_SHOWUSAGE;
ast_mutex_lock(&peerl.lock);
#define FORMAT "%-15.15s %-10.10s %5.5d/%5.5d %5.5d/%5.5d %-5.5dms %-4.4dms %-4.4dms %-6.6s\n"
int x;
int numchans = 0;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (argc != 3)
return RESULT_SHOWUSAGE;
ast_cli(fd, FORMAT2, "Peer", "Username", "ID (Lo/Rem)", "Seq (Tx/Rx)", "Lag", "Jitter", "JitBuf", "Format");
struct iax2_user *user, *best = NULL;
int bestscore = 0;
int gotcapability=0;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (!iaxs[callno])
return res;
static int raw_hangup(struct sockaddr_in *sin, unsigned short src, unsigned short dst)
{
struct ast_iax2_full_hdr fh;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
fh.scallno = htons(src | IAX_FLAG_FULL);
fh.dcallno = htons(dst);
fh.ts = 0;
char md5secret[256] = "";
char rsasecret[256] = "";
char secret[256] = "";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
struct iax2_peer *p;
struct ast_key *key;
char *keyn;
{
int res = -1;
int x;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (keyn && !ast_strlen_zero(keyn)) {
if (!(authmethods & IAX_AUTH_RSA)) {
if (!secret || ast_strlen_zero(secret))
char ourip[256] = "<Unspecified>";
struct sockaddr_in oldus;
struct sockaddr_in us;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int oldmsgs;
memset(&us, 0, sizeof(us));
{
char data[80];
struct in_addr in;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char *c, *d;
if (!ast_db_get("IAX/Registry", p->name, data, sizeof(data))) {
c = strchr(data, ':');
struct iax2_peer *p;
int msgcount;
char data[80];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int version;
memset(&ied, 0, sizeof(ied));
for (p = peerl.peers;p;p = p->next) {
/* Start pessimistic */
struct iax_ie_data ied;
char peer[256] = "";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char challenge[256] = "";
int res;
int authmethods = 0;
{
char buf[1024];
int res;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
struct iax2_trunk_peer *tpeer, *prev = NULL, *drop=NULL;
int processed = 0;
int totalcalls = 0;
char dblbuf[4096]; /* Declaration of dblbuf must immediately *preceed* fr on the stack */
struct iax_frame fr;
struct iax_frame *cur;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
struct ast_frame f;
struct ast_channel *c;
struct iax2_dpcache *dp;
char *config = "iax.conf";
int res = 0;
int x;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
struct iax2_registry *reg;
struct iax2_peer *peer;
{
struct mgcp_endpoint *p = sub->parent;
int res;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (mgcpdebug) {
ast_verbose("Retransmitting:\n%s\n to %s:%d\n", resp->buf, ast_inet_ntoa(iabuf, sizeof(iabuf), p->parent->addr.sin_addr), ntohs(p->parent->addr.sin_port));
}
{
struct mgcp_endpoint *p = sub->parent;
int res;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (mgcpdebug) {
ast_verbose("Transmitting:\n%s\n to %s:%d\n", req->data, ast_inet_ntoa(iabuf, sizeof(iabuf), p->parent->addr.sin_addr), ntohs(p->parent->addr.sin_port));
}
{
int res = 0;
struct mgcp_request **queue, *q, *r, *t;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
ast_mutex_t *l;
switch (req->cmd) {
struct mgcp_gateway *g;
struct mgcp_endpoint *e;
int hasendpoints = 0;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (argc != 3)
return RESULT_SHOWUSAGE;
ast_mutex_lock(&gatelock);
struct mgcp_endpoint *p = NULL;
struct mgcp_subchannel *sub = NULL;
struct mgcp_gateway *g;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char tmp[256] = "";
char *at = NULL, *c;
int found = 0;
char t[256];
char m[256];
char a[1024] = "";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int x;
struct sockaddr_in dest;
struct mgcp_endpoint *p = sub->parent;
struct mgcp_request **queue, ast_mutex_t *l, int ident)
{
struct mgcp_request *prev, *req;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
ast_mutex_lock(l);
for (prev = NULL, req = *queue; req; prev = req, req = req->next) {
struct ast_frame f = { 0, };
struct mgcp_endpoint *p = sub->parent;
struct mgcp_gateway *g = NULL;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int res;
if (mgcpdebug) {
ast_verbose("Handling request '%s' on %s@%s\n", req->verb, p->name, p->parent->name);
int len;
int result;
int ident;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
len = sizeof(sin);
memset(&req, 0, sizeof(req));
res = recvfrom(mgcpsock, req.data, sizeof(req.data) - 1, 0, (struct sockaddr *)&sin, &len);
struct ast_variable *v;
struct mgcp_gateway *g;
struct mgcp_endpoint *e;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char *cat;
struct ast_hostent ahp; struct hostent *hp;
int format;
static int __sip_xmit(struct sip_pvt *p, char *data, int len)
{
int res;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (p->nat == SIP_NAT_ALWAYS)
res=sendto(sipsock, data, len, 0, (struct sockaddr *)&p->recv, sizeof(struct sockaddr_in));
else
if (localaddr && externip.sin_addr.s_addr &&
ast_apply_ha(localaddr, &theirs)) {
char t[256];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
memcpy(us, &externip.sin_addr, sizeof(struct in_addr));
strcpy(t, ast_inet_ntoa(iabuf, sizeof(iabuf), *(struct in_addr *)&them->s_addr));
ast_log(LOG_DEBUG, "Target address %s is not local, substituting externip\n", t);
{
struct sip_pkt *pkt=data, *prev, *cur;
int res = 0;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
ast_mutex_lock(&pkt->owner->lock);
if (pkt->retrans < MAX_RETRANS) {
pkt->retrans++;
static int send_response(struct sip_pvt *p, struct sip_request *req, int reliable, int seqno)
{
int res;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (sip_debug_test_pvt(p)) {
if (p->nat == SIP_NAT_ALWAYS)
ast_verbose("%sTransmitting (NAT):\n%s\n to %s:%d\n", reliable ? "Reliably " : "", req->data, ast_inet_ntoa(iabuf, sizeof(iabuf), p->recv.sin_addr), ntohs(p->recv.sin_port));
static int send_request(struct sip_pvt *p, struct sip_request *req, int reliable, int seqno)
{
int res;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (sip_debug_test_pvt(p)) {
if (p->nat == SIP_NAT_ALWAYS)
ast_verbose("%sTransmitting:\n%s (NAT) to %s:%d\n", reliable ? "Reliably " : "", req->data, ast_inet_ntoa(iabuf, sizeof(iabuf), p->recv.sin_addr), ntohs(p->recv.sin_port));
char query[512];
char *name;
char *uname;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
time_t nowtime;
name = alloca(strlen(peer) * 2 + 1);
uname = alloca(strlen(username) * 2 + 1);
char *name = NULL;
int numfields, x;
int port;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
time_t regseconds, nowtime;
MYSQL_RES *result;
MYSQL_FIELD *fields;
int found=0;
char *port;
int portno;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char host[256], *hostn;
r->sa.sin_family = AF_INET;
int res;
int val;
int x;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
for (x=0;x<4;x++) {
val = rand();
res = snprintf(callid, len, "%08x", val);
static struct sip_pvt *sip_alloc(char *callid, struct sockaddr_in *sin, int useglobalnat)
{
struct sip_pvt *p;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
p = malloc(sizeof(struct sip_pvt));
if (!p)
struct sip_pvt *p;
char *callid;
char tmp[256] = "";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char *cmd;
char *tag = "", *c;
int themisfrom;
char *c;
char *a;
char host[258];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int len = -1;
int portno=0;
int vportno=0;
int start = 0;
int copied = 0;
char new[256];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
for (;;) {
tmp = __get_header(orig, field, &start);
if (!ast_strlen_zero(tmp)) {
static void set_destination(struct sip_pvt *p, char *uri)
{
char *h, *maddr, hostname[256];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int port, hn;
struct hostent *hp;
struct ast_hostent ahp;
char stripped[80] ="";
char tmp[80];
char newto[256];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char *c, *n;
char *ot, *of;
char m2[256] = "";
char a[1024] = "";
char a2[1024] = "";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int x;
int capability;
struct sockaddr_in dest;
/*--- build_contact: Build contact header - the contact header we send out ---*/
static void build_contact(struct sip_pvt *p)
{
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
/* Construct Contact: header */
if (ourport != 5060)
snprintf(p->our_contact, sizeof(p->our_contact), "<sip:%s@%s:%d>", p->exten, ast_inet_ntoa(iabuf, sizeof(iabuf), p->ourip), ourport);
char from[256];
char to[256];
char tmp[80];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char cid[256];
char *l = callerid, *n=NULL;
static int transmit_invite(struct sip_pvt *p, char *cmd, int sdp, char *auth, char *authheader, char *vxml_url, char *distinctive_ring, char *osptoken, int init)
{
struct sip_request req;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (init) {
/* Bump branch even on initial requests */
/* if we are here, our registration timed out, so we'll just do it over */
struct sip_registry *r=data;
struct sip_pvt *p;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int res;
ast_mutex_lock(®l.lock);
ast_log(LOG_NOTICE, "Registration for '%s@%s' timed out, trying again\n", r->username, ast_inet_ntoa(iabuf, sizeof(iabuf), r->addr.sin_addr));
char tmp[80];
char via[80];
char addr[80];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
struct sip_pvt *p;
struct ast_hostent ahp;
struct hostent *hp;
static void reg_source_db(struct sip_peer *p)
{
char data[80];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
struct in_addr in;
char *c, *d, *u;
int expiry;
{
char contact[80]= "";
char data[256];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char *expires = get_header(req, "Expires");
int expiry = atoi(expires);
char *c, *n, *pt;
int res = -1;
struct sip_peer *peer;
char tmp[256] = "";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char *name, *c;
char *t;
/* Terminate URI */
static int check_via(struct sip_pvt *p, struct sip_request *req)
{
char via[256] = "";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char *c, *pt;
struct hostent *hp;
struct ast_hostent ahp;
struct sip_peer *peer;
char *of, from[256] = "", *c;
char *rpid,rpid_num[50];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int res = 0;
char *t;
char calleridname[50];
#define FORMAT "%-15.15s %-15.15s %s %s %s %-15.15s %-8d %-10s\n"
struct sip_peer *peer;
char name[256] = "";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (argc != 3 && argc != 5)
return RESULT_SHOWUSAGE;
ast_mutex_lock(&peerl.lock);
static int sip_show_peer(int fd, int argc, char *argv[])
{
char status[30];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
struct sip_peer *peer;
if (argc != 4)
#define FORMAT "%-20.20s %-12.12s %8d %-20.20s\n"
struct sip_registry *reg;
char host[80];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (argc != 3)
return RESULT_SHOWUSAGE;
ast_mutex_lock(®l.lock);
#define FORMAT2 "%-15.15s %-10.10s %-11.11s %-11.11s %s\n"
#define FORMAT "%-15.15s %-10.10s %-11.11s %5.5d/%5.5d %-6.6s%s\n"
struct sip_pvt *cur;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int numchans = 0;
if (argc != 3)
return RESULT_SHOWUSAGE;
{
struct sip_pvt *cur;
char tmp[256];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
size_t len;
int found = 0;
if (argc != 4)
{
struct hostent *hp;
struct ast_hostent ahp;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int port = 0;
char *p, *arg;
if (argc != 4)
static int sip_do_debug_peer(int fd, int argc, char *argv[])
{
struct sip_peer *peer;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (argc != 4)
return RESULT_SHOWUSAGE;
ast_mutex_lock(&peerl.lock);
char resp_hash[256];
char uri[256] = "";
char cnonce[80];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (!ast_strlen_zero(p->domain))
strncpy(uri, p->domain, sizeof(uri) - 1);
int pingtime;
struct timeval tv;
int seqno=0;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
c = get_header(req, "Cseq");
if (sscanf(c, "%d ", &seqno) != 1) {
ast_log(LOG_WARNING, "Unable to determine sequence number\n");
int respid;
int res;
int gotdest;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
struct ast_frame af = { AST_FRAME_NULL, };
int debug = sip_debug_test_pvt(p);
/* Called with peerl lock, but releases it */
struct sip_pvt *p;
char name[256] = "";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int newmsgs, oldmsgs;
/* Check for messages */
ast_app_messagecount(peer->mailbox, &newmsgs, &oldmsgs);
static int sip_poke_peer(struct sip_peer *peer)
{
struct sip_pvt *p;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (!peer->maxms || !peer->addr.sin_addr.s_addr) {
/* IF we have no IP, or this isn't to be monitored, return
imeediately after clearing things out */
struct ast_channel *tmpc = NULL;
char *ext, *host;
char tmp[256] = "";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char *dest = data;
oldformat = format;
struct hostent *hp;
int format;
int oldport = ntohs(bindaddr.sin_port);
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
globaldtmfmode = SIP_DTMF_RFC2833;
globalpromiscredir = 0;
struct skinny_device *d;
struct skinny_line *l;
int haslines = 0;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (argc != 3)
return RESULT_SHOWUSAGE;
ast_mutex_lock(&devicelock);
int res;
skinny_req *req;
struct skinnysession *s = data;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
ast_verbose(VERBOSE_PREFIX_3 "Starting Skinny session from %s\n", ast_inet_ntoa(iabuf, sizeof(iabuf), s->sin.sin_addr));
struct ast_variable *v;
int format;
char *cat;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
struct skinny_device *d;
int oldport = ntohs(bindaddr.sin_port);
static void dump_addr(char *output, int maxlen, void *value, int len)
{
struct sockaddr_in sin;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (len == (int)sizeof(sin)) {
memcpy(&sin, value, len);
snprintf(output, maxlen, "IPV4 %s:%d", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), ntohs(sin.sin_port));
char *class;
char *subclass;
char tmp[256];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (f) {
fh = f->data;
snprintf(retries, (int)sizeof(retries), "%03d", f->retries);
static int handle_showmanconn(int fd, int argc, char *argv[])
{
struct mansession *s;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char *format = " %-15.15s %-15.15s\n";
ast_mutex_lock(&sessionlock);
s = sessions;
static int authenticate(struct mansession *s, struct message *m)
{
struct ast_config *cfg;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
char *cat;
char *user = astman_get_header(m, "Username");
char *pass = astman_get_header(m, "Secret");
struct manager_action *tmp = first_action;
char *id = astman_get_header(m,"ActionID");
char idText[256] = "";
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
strncpy(action, astman_get_header(m, "Action"), sizeof(action));
ast_log( LOG_DEBUG, "Manager received command '%s'\n", action );
int res;
int x;
struct pollfd fds[1];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
for (x=1;x<s->inlen;x++) {
if ((s->inbuf[x] == '\n') && (s->inbuf[x-1] == '\r')) {
/* Copy output data up to and including \r\n */
{
struct mansession *s = data;
struct message m;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int res;
ast_mutex_lock(&s->lock);
int ast_osp_validate(char *provider, char *token, int *handle, unsigned int *timelimit, char *callerid, struct in_addr addr, char *extension)
{
char tmp[256]="", *l, *n;
- char ip[256];
+ char iabuf[INET_ADDRSTRLEN];
char source[OSP_MAX]; /* Same length as osp->source */
char *token2;
int tokenlen;
}
callerid = l;
ast_mutex_lock(&osplock);
- ast_inet_ntoa(ip, sizeof(ip), addr);
+ ast_inet_ntoa(iabuf, sizeof(iabuf), addr);
osp = providers;
while(osp) {
if (!strcasecmp(osp->name, provider)) {
if (res) {
res = 0;
dummy = 0;
- if (!OSPPTransactionValidateAuthorisation(*handle, ip, source, NULL, NULL,
+ if (!OSPPTransactionValidateAuthorisation(*handle, iabuf, source, NULL, NULL,
callerid, OSPC_E164, extension, OSPC_E164, 0, "", tokenlen, token2, &authorised, timelimit, &dummy, NULL, TOKEN_ALGO_BOTH)) {
if (authorised) {
- ast_log(LOG_DEBUG, "Validated token for '%s' from '%s@%s'\n", extension, callerid, ip);
+ ast_log(LOG_DEBUG, "Validated token for '%s' from '%s@%s'\n", extension, callerid, iabuf);
res = 1;
}
}
{
struct timeval tv;
static struct ast_frame null_frame = { AST_FRAME_NULL, };
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
gettimeofday(&tv, NULL);
if ((tv.tv_sec < rtp->dtmfmute.tv_sec) ||
((tv.tv_sec == rtp->dtmfmute.tv_sec) && (tv.tv_usec < rtp->dtmfmute.tv_usec))) {
int res;
struct sockaddr_in sin;
unsigned int rtcpdata[1024];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if (!rtp->rtcp)
return &null_frame;
int payloadtype;
int hdrlen = 12;
int mark;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
unsigned int timestamp;
unsigned int *rtpheader;
static struct ast_frame *f, null_frame = { AST_FRAME_NULL, };
int ms;
int x;
char data[256];
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
if ((digit <= '9') && (digit >= '0'))
digit -= '0';
static int ast_rtp_raw_write(struct ast_rtp *rtp, struct ast_frame *f, int codec)
{
unsigned int *rtpheader;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
int hdrlen = 12;
int res;
int ms;
struct sockaddr_in vac0, vac1;
struct sockaddr_in t0, t1;
struct sockaddr_in vt0, vt1;
- char iabuf[80];
+ char iabuf[INET_ADDRSTRLEN];
void *pvt0, *pvt1;
int to;