mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-21 09:10:36 +00:00
Add "From" to register
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@756 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1980,6 +1980,27 @@ static int transmit_response_reliable(struct sip_pvt *p, char *msg, struct sip_r
|
|||||||
return __transmit_response(p, msg, req, 1);
|
return __transmit_response(p, msg, req, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void append_date(struct sip_request *req)
|
||||||
|
{
|
||||||
|
char tmpdat[256];
|
||||||
|
struct tm tm;
|
||||||
|
time_t t;
|
||||||
|
time(&t);
|
||||||
|
gmtime_r(&t, &tm);
|
||||||
|
strftime(tmpdat, sizeof(tmpdat), "%a, %d %b %Y %T GMT", &tm);
|
||||||
|
add_header(req, "Date", tmpdat);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int transmit_response_with_date(struct sip_pvt *p, char *msg, struct sip_request *req)
|
||||||
|
{
|
||||||
|
struct sip_request resp;
|
||||||
|
respprep(&resp, p, msg, req);
|
||||||
|
append_date(&resp);
|
||||||
|
add_header(&resp, "Content-Length", "0");
|
||||||
|
add_blank_header(&resp);
|
||||||
|
return send_response(p, &resp, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
static int transmit_response_with_allow(struct sip_pvt *p, char *msg, struct sip_request *req)
|
static int transmit_response_with_allow(struct sip_pvt *p, char *msg, struct sip_request *req)
|
||||||
{
|
{
|
||||||
struct sip_request resp;
|
struct sip_request resp;
|
||||||
@@ -2770,7 +2791,7 @@ static int register_verify(struct sip_pvt *p, struct sockaddr_in *sin, struct si
|
|||||||
ast_log(LOG_WARNING, "Failed to parse contact info\n");
|
ast_log(LOG_WARNING, "Failed to parse contact info\n");
|
||||||
} else {
|
} else {
|
||||||
/* Say OK and ask subsystem to retransmit msg counter */
|
/* Say OK and ask subsystem to retransmit msg counter */
|
||||||
transmit_response(p, "200 OK", req);
|
transmit_response_with_date(p, "200 OK", req);
|
||||||
peer->lastmsgssent = -1;
|
peer->lastmsgssent = -1;
|
||||||
res = 0;
|
res = 0;
|
||||||
}
|
}
|
||||||
@@ -4178,7 +4199,7 @@ static void *do_monitor(void *data)
|
|||||||
restartsearch:
|
restartsearch:
|
||||||
sip = iflist;
|
sip = iflist;
|
||||||
while(sip) {
|
while(sip) {
|
||||||
if (sip->needdestroy) {
|
if (sip->needdestroy && !sip->packets) {
|
||||||
__sip_destroy(sip, 1);
|
__sip_destroy(sip, 1);
|
||||||
goto restartsearch;
|
goto restartsearch;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user