提交 3a607ea0 authored 作者: Brian West's avatar Brian West

commit expire fix from yesterday

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7015 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 b115bea5
......@@ -601,13 +601,22 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char *
char *sub_to_host = argv[4];
char *event = argv[5];
char *call_id = argv[7];
char *expires = argv[10];
nua_handle_t *nh;
char *to = NULL;
char *open;
char *prpid;
int done = 0;
const char *ct;
time_t exptime = time(NULL) + 3600;
char exp[80] = "";
if (expires) {
long tmp = atol(expires);
if (tmp > 0) {
exptime = tmp - time(NULL);
}
}
if (!(nh = (nua_handle_t *) switch_core_hash_find(profile->sub_hash, call_id))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot find handle for %s\n", call_id);
......@@ -746,9 +755,11 @@ static int sofia_presence_sub_callback(void *pArg, int argc, char **argv, char *
ct = "application/pidf+xml";
}
switch_snprintf(exp, sizeof(exp), "active;expires=%ld", (long) exptime);
nua_notify(nh,
NUTAG_NEWSUB(1),
SIPTAG_SUBSCRIPTION_STATE_STR("active;expires=3600"),
SIPTAG_SUBSCRIPTION_STATE_STR(exp),
SIPTAG_EVENT_STR(event), SIPTAG_CONTENT_TYPE_STR(ct), SIPTAG_PAYLOAD_STR(pl), TAG_END());
if (done) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论