mod_sofia: Set sip_to_tag on ringing indication for inbound channels.

When bridging a call, the to-tag used in the outgoing 180 Ringing
message for the inbound channel is unavailable until the channel has
been answered. For the outgoing channel this value is already available
through the sip_to_tag variable via the event socket.

This is solved this by setting sip_to_tag to the local leg's tag when
receiving a ringing indication for inbound channels. This will also make
the variable available in the CHANNEL_PROGRESS event through event
socket.

FS-7137 #resolve
This commit is contained in:
Jon Bergli Heier 2015-01-06 17:17:05 +01:00
parent f48ec61d54
commit 165f54216c
1 changed files with 9 additions and 0 deletions

View File

@ -2066,6 +2066,15 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
const char *call_info = switch_channel_get_variable(channel, "presence_call_info_full");
char *cid = generate_pai_str(tech_pvt);
/* Set sip_to_tag to local tag for inbound channels. */
if (switch_channel_direction(channel) == SWITCH_CALL_DIRECTION_INBOUND) {
const char* to_tag = "";
to_tag = switch_str_nil(nta_leg_get_tag(tech_pvt->nh->nh_ds->ds_leg));
if(to_tag) {
switch_channel_set_variable(channel, "sip_to_tag", to_tag);
}
}
switch (ring_ready_val) {
case SWITCH_RING_READY_QUEUED: