summaryrefslogtreecommitdiffstats
path: root/src/sip.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2016-04-04 19:52:41 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2016-04-04 19:52:41 +0200
commit211ad859de157c676bde6529a829e66db9fe4ff6 (patch)
tree0ca534e68b440d2ae56cf6108571e2ba47e1efea /src/sip.c
parent32162fe7c80b8201ff4cb4a32632830282b2249f (diff)
sip/call/mncc: Move source/dest into the call structure
In preparation of a better show calls VTY command it is of interest to know which number has been dialed by whom. For that store the source/dest in there. MNCC: Change the talloc root context to the call and don't try to free the strings after calling the routing code SIP: Use talloc_strdup to duplicate them. Call: Add null check because the talloc_strdup of the SIP layer could have failed.
Diffstat (limited to 'src/sip.c')
-rw-r--r--src/sip.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/sip.c b/src/sip.c
index 36e4967..139c620 100644
--- a/src/sip.c
+++ b/src/sip.c
@@ -136,7 +136,9 @@ static void new_call(struct sip_agent *agent, nua_handle_t *nh,
nua_handle_bind(nh, leg);
leg->sdp_payload = talloc_strdup(leg, sip->sip_payload->pl_data);
- app_route_call(call, from, to);
+ app_route_call(call,
+ talloc_strdup(leg, from),
+ talloc_strdup(leg, to));
}
void nua_callback(nua_event_t event, int status, char const *phrase, nua_t *nua, nua_magic_t *magic, nua_handle_t *nh, nua_hmagic_t *hmagic, sip_t const *sip, tagi_t tags[])
@@ -316,8 +318,7 @@ static int send_invite(struct sip_agent *agent, struct sip_call_leg *leg,
return 0;
}
-int sip_create_remote_leg(struct sip_agent *agent, struct call *call,
- const char *source, const char *dest)
+int sip_create_remote_leg(struct sip_agent *agent, struct call *call)
{
struct sip_call_leg *leg;
@@ -341,7 +342,7 @@ int sip_create_remote_leg(struct sip_agent *agent, struct call *call,
return -2;
}
- return send_invite(agent, leg, source, dest);
+ return send_invite(agent, leg, call->source, call->dest);
}
char *make_sip_uri(struct sip_agent *agent)