mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2025-01-07 12:25:31 +00:00
sip: origin: get address on incoming call
This commit is contained in:
parent
588f70f78a
commit
c9949a5f9f
1 changed files with 13 additions and 2 deletions
|
@ -287,11 +287,22 @@ sip_callback (nua_event_t event,
|
||||||
{
|
{
|
||||||
CallsSipOrigin *origin = CALLS_SIP_ORIGIN (magic);
|
CallsSipOrigin *origin = CALLS_SIP_ORIGIN (magic);
|
||||||
CallsSipHandles *op = origin->oper;
|
CallsSipHandles *op = origin->oper;
|
||||||
const char * from = NULL;
|
g_autofree gchar * from = NULL;
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case nua_i_invite:
|
case nua_i_invite:
|
||||||
tl_gets (tags, SIPTAG_FROM_STR_REF (from), TAG_END ());
|
if (sip->sip_from && sip->sip_from->a_url &&
|
||||||
|
sip->sip_from->a_url->url_scheme &&
|
||||||
|
sip->sip_from->a_url->url_user &&
|
||||||
|
sip->sip_from->a_url->url_host)
|
||||||
|
from = g_strconcat (sip->sip_from->a_url->url_scheme, ":",
|
||||||
|
sip->sip_from->a_url->url_user, "@",
|
||||||
|
sip->sip_from->a_url->url_host, NULL);
|
||||||
|
else {
|
||||||
|
nua_respond (nh, 400, NULL, TAG_END ());
|
||||||
|
g_warning ("invalid incoming INVITE request");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
g_debug ("incoming call INVITE: %03d %s from %s", status, phrase, from);
|
g_debug ("incoming call INVITE: %03d %s from %s", status, phrase, from);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue