static int sip_fixup(struct ast_channel *oldchan, struct ast_channel *newchan);
static int sip_senddigit_begin(struct ast_channel *ast, char digit);
static int sip_senddigit_end(struct ast_channel *ast, char digit, unsigned int duration);
+static char *sip_get_callid(struct ast_channel *chan);
static int handle_request_do(struct sip_request *req, struct sockaddr_in *sin);
static int sip_standard_port(struct sip_socket s);
.early_bridge = ast_rtp_early_bridge,
.send_text = sip_sendtext, /* called with chan locked */
.func_channel_read = acf_channel_read,
+ .get_pvt_uniqueid = sip_get_callid,
};
/*! \brief This version of the sip channel tech has no send_digit_begin
return 0;
}
+/*! \brief Deliver SIP call ID for the call */
+static char *sip_get_callid(struct ast_channel *chan)
+{
+ struct sip_pvt *p = chan->tech_pvt;
+ if (!p)
+ return "";
+ return ((char *)p->callid);
+}
+
/*! \brief Send SIP MESSAGE text within a call
Called from PBX core sendtext() application */
static int sip_sendtext(struct ast_channel *ast, const char *text)
manager_event(EVENT_FLAG_SYSTEM, "ChannelUpdate",
"Channel: %s\r\nChanneltype: %s\r\nUniqueid: %s\r\nSIPcallid: %s\r\nSIPfullcontact: %s\r\nPeername: %s\r\n",
p->owner->name, p->owner->uniqueid, "SIP", p->callid, p->fullcontact, p->peername);
+ /* Set bridged channel variable */
+ bridgepeer = ast_bridged_channel(p->owner);
+ if (bridgepeer)
+ pbx_builtin_setvar_helper(bridgepeer, "SIP_BRIDGED_CALLID", p->callid);
} else { /* RE-invite */
ast_queue_frame(p->owner, &ast_null_frame);
}
pbx_builtin_setvar_helper(c0, "BRIDGEPEER", c1->name);
if (!ast_strlen_zero(pbx_builtin_getvar_helper(c1, "BRIDGEPEER")))
pbx_builtin_setvar_helper(c1, "BRIDGEPEER", c0->name);
+ if (c0->tech->get_pvt_uniqueid)
+ pbx_builtin_setvar_helper(c1, "BRIDGEPVTCALLID", c0->tech->get_pvt_uniqueid(c0));
+ if (c1->tech->get_pvt_uniqueid)
+ pbx_builtin_setvar_helper(c0, "BRIDGEPVTCALLID", c1->tech->get_pvt_uniqueid(c1));
if (c0->tech->bridge &&
(config->timelimit == 0) &&