Index: channels/chan_sip.c =================================================================== RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v retrieving revision 1.872 diff -u -r1.872 chan_sip.c --- channels/chan_sip.c 29 Sep 2005 17:41:00 -0000 1.872 +++ channels/chan_sip.c 3 Oct 2005 09:01:57 -0000 @@ -133,6 +133,9 @@ #define DEBUG_READ 0 /* Recieved data */ #define DEBUG_SEND 1 /* Transmit data */ +/* Some default header sizes */ +#define SIP_HEADER_CONTACT 256 + static const char desc[] = "Session Initiation Protocol (SIP)"; static const char channeltype[] = "SIP"; static const char config[] = "sip.conf"; @@ -593,8 +596,8 @@ struct ast_channel *owner; /* Who owns us */ char exten[AST_MAX_EXTENSION]; /* Extension where to start */ char refer_to[AST_MAX_EXTENSION]; /* Place to store REFER-TO extension */ - char referred_by[AST_MAX_EXTENSION]; /* Place to store REFERRED-BY extension */ - char refer_contact[AST_MAX_EXTENSION]; /* Place to store Contact info from a REFER extension */ + char referred_by[SIP_HEADER_CONTACT]; /* Place to store REFERRED-BY extension */ + char refer_contact[SIP_HEADER_CONTACT]; /* Place to store Contact info from a REFER extension */ struct sip_pvt *refer_call; /* Call we are referring */ struct sip_route *route; /* Head of linked list of routing steps (fm Record-Route) */ int route_persistant; /* Is this the "real" route? */ @@ -621,9 +624,9 @@ char cid_num[256]; /* Caller*ID */ char cid_name[256]; /* Caller*ID */ char via[256]; /* Via: header */ - char fullcontact[128]; /* The Contact: that the UA registers with us */ + char fullcontact[SIP_HEADER_CONTACT]; /* The Contact: that the UA registers with us */ char accountcode[AST_MAX_ACCOUNT_CODE]; /* Account code */ - char our_contact[256]; /* Our contact header */ + char our_contact[SIP_HEADER_CONTACT]; /* Our contact header */ char *rpid; /* Our RPID header */ char *rpid_from; /* Our RPID From header */ char realm[MAXHOSTNAMELEN]; /* Authorization realm */ @@ -730,7 +733,7 @@ char regexten[AST_MAX_EXTENSION]; /* Extension to register (if regcontext is used) */ char fromuser[80]; /* From: user when calling this peer */ char fromdomain[MAXHOSTNAMELEN]; /* From: domain when calling this peer */ - char fullcontact[256]; /* Contact registred with us (not in sip.conf) */ + char fullcontact[SIP_HEADER_CONTACT]; /* Contact registred with us (not in sip.conf) */ char cid_num[80]; /* Caller ID num */ char cid_name[80]; /* Caller ID name */ int callingpres; /* Calling id presentation */ @@ -3917,7 +3920,7 @@ snprintf(tmp, sizeof(tmp), "%d", p->expiry); add_header(resp, "Expires", tmp); if (p->expiry) { /* Only add contact if we have an expiry time */ - char contact[256]; + char contact[SIP_HEADER_CONTACT]; snprintf(contact, sizeof(contact), "%s;expires=%d", p->our_contact, p->expiry); add_header(resp, "Contact", contact); /* Not when we unregister */ }