summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Luebbe <jluebbe@debian.org>2017-12-27 17:06:01 +0100
committerthe 34c3 gsm team <34c3-gsm@congress>2017-12-27 17:18:39 +0100
commit1a0ee41c508e959318a05dabd97de721cc475451 (patch)
tree76bccf96a73629302821f6b97d5a7f2342ca90a3 /src
parent2129ed7ea337adf44128058b6260227f0fcea3bd (diff)
pass MO ISMI as X-IMSI SIP header
Diffstat (limited to 'src')
-rw-r--r--src/sip.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sip.c b/src/sip.c
index 4f3d034..a06173f 100644
--- a/src/sip.c
+++ b/src/sip.c
@@ -314,6 +314,10 @@ static int send_invite(struct sip_agent *agent, struct sip_call_leg *leg,
const char *calling_num, const char *called_num)
{
struct call_leg *other = leg->base.call->initial;
+ struct mncc_call_leg *other_mncc = NULL;
+
+ OSMO_ASSERT(other->type == CALL_TYPE_MNCC);
+ other_mncc = (struct mncc_call_leg *) other;
char *from = talloc_asprintf(leg, "sip:%s@%s:%d",
calling_num,
@@ -323,6 +327,8 @@ static int send_invite(struct sip_agent *agent, struct sip_call_leg *leg,
called_num,
agent->app->sip.remote_addr,
agent->app->sip.remote_port);
+ char *imsi = talloc_asprintf(leg, "X-IMSI: %.16s",
+ other_mncc->imsi);
char *sdp = sdp_create_file(leg, other);
leg->state = SIP_CC_INITIAL;
@@ -330,6 +336,7 @@ static int send_invite(struct sip_agent *agent, struct sip_call_leg *leg,
nua_invite(leg->nua_handle,
SIPTAG_FROM_STR(from),
SIPTAG_TO_STR(to),
+ SIPTAG_HEADER_STR(imsi),
NUTAG_MEDIA_ENABLE(0),
SIPTAG_CONTENT_TYPE_STR("application/sdp"),
SIPTAG_PAYLOAD_STR(sdp),
@@ -338,6 +345,7 @@ static int send_invite(struct sip_agent *agent, struct sip_call_leg *leg,
leg->base.call->remote = &leg->base;
talloc_free(from);
talloc_free(to);
+ talloc_free(imsi);
talloc_free(sdp);
return 0;
}