提交 9b61add5 authored 作者: Brian West's avatar Brian West 提交者: Mike Jerris

FS-10903: [mod_sofia,mod_valet_parking] Fix Issue with subscriptions and Valet Parking #resolve

上级 583bcded
......@@ -786,6 +786,7 @@ static void pres_event_handler(switch_event_t *event)
char *dup_to = NULL, *lot_name, *dup_lot_name = NULL, *domain_name;
valet_lot_t *lot;
int found = 0;
const char *call_id;
if (!to || strncasecmp(to, "park+", 5) || !strchr(to, '@')) {
return;
......@@ -801,6 +802,8 @@ static void pres_event_handler(switch_event_t *event)
*domain_name++ = '\0';
}
call_id = switch_event_get_header(event, "sub-call-id");
dup_lot_name = switch_mprintf("%q@%q", lot_name, domain_name);
if ((lot = valet_find_lot(lot_name, SWITCH_FALSE)) || (dup_lot_name && (lot = valet_find_lot(dup_lot_name, SWITCH_FALSE)))) {
......@@ -821,6 +824,9 @@ static void pres_event_handler(switch_event_t *event)
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "channel-state", "CS_ROUTING");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "answer-state", "confirmed");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "presence-call-direction", "inbound");
if (call_id) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-id", call_id);
}
switch_event_fire(&event);
}
found++;
......@@ -838,6 +844,9 @@ static void pres_event_handler(switch_event_t *event)
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "channel-state", "CS_HANGUP");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "answer-state", "terminated");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "presence-call-direction", "inbound");
if (call_id) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-id", call_id);
}
switch_event_fire(&event);
}
}
......@@ -883,6 +892,9 @@ static void pres_event_handler(switch_event_t *event)
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "channel-state", "CS_ROUTING");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "answer-state", "confirmed");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "presence-call-direction", token->bridged == 0 ? "outbound" : "inbound");
if (call_id) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-id", call_id);
}
switch_event_fire(&event);
}
}
......@@ -908,6 +920,9 @@ static void pres_event_handler(switch_event_t *event)
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "channel-state", "CS_HANGUP");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "answer-state", "terminated");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "presence-call-direction", "inbound");
if (call_id) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "call-id", call_id);
}
switch_event_fire(&event);
}
......
......@@ -4364,6 +4364,7 @@ void sofia_presence_handle_sip_i_subscribe(int status,
switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "event_type", "presence");
switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "alt_event_type", "dialog");
switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "expires", exp_delta_str);
switch_event_add_header_string(sevent, SWITCH_STACK_BOTTOM, "sub-call-id", call_id);
switch_event_fire(&sevent);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论