From 411f5dbf811c1b2c4fedc3070af828bcfbe3ec9a Mon Sep 17 00:00:00 2001 From: "Alfred E. Heggestad" Date: Sun, 4 Sep 2016 15:02:46 +0200 Subject: remove ua_prm(), use ua_account() instead --- src/call.c | 6 ++++++ src/core.h | 1 + src/reg.c | 2 +- src/sipreq.c | 2 +- src/stream.c | 2 +- src/ua.c | 6 ------ 6 files changed, 10 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/call.c b/src/call.c index c3bea22..5e0b73f 100644 --- a/src/call.c +++ b/src/call.c @@ -1028,6 +1028,12 @@ struct ua *call_get_ua(const struct call *call) } +struct account *call_account(const struct call *call) +{ + return call ? call->acc : NULL; +} + + static int auth_handler(char **username, char **password, const char *realm, void *arg) { diff --git a/src/core.h b/src/core.h index f4ec68a..422b1ce 100644 --- a/src/core.h +++ b/src/core.h @@ -171,6 +171,7 @@ int call_notify_sipfrag(struct call *call, uint16_t scode, const char *reason, ...); int call_af(const struct call *call); void call_set_xrtpstat(struct call *call); +struct account *call_account(const struct call *call); /* diff --git a/src/reg.c b/src/reg.c index b206ed8..a8e53fb 100644 --- a/src/reg.c +++ b/src/reg.c @@ -223,7 +223,7 @@ int reg_register(struct reg *reg, const char *reg_uri, const char *params, routev[0] ? routev : NULL, routev[0] ? 1 : 0, reg->id, - sip_auth_handler, ua_prm(reg->ua), true, + sip_auth_handler, ua_account(reg->ua), true, register_handler, reg, params[0] ? ¶ms[1] : NULL, "Allow: %s\r\n", uag_allowed_methods()); diff --git a/src/sipreq.c b/src/sipreq.c index c1510b6..314f45c 100644 --- a/src/sipreq.c +++ b/src/sipreq.c @@ -136,7 +136,7 @@ int sip_req_send(struct ua *ua, const char *method, const char *uri, if (err) goto out; - err = sip_auth_alloc(&sr->auth, auth_handler, ua_prm(ua), true); + err = sip_auth_alloc(&sr->auth, auth_handler, ua_account(ua), true); if (err) goto out; diff --git a/src/stream.c b/src/stream.c index 24721d2..97e15ce 100644 --- a/src/stream.c +++ b/src/stream.c @@ -404,7 +404,7 @@ static void stream_start_keepalive(struct stream *s) if (!s) return; - rtpkeep = ua_prm(call_get_ua(s->call))->rtpkeep; + rtpkeep = call_account(s->call)->rtpkeep; s->rtpkeep = mem_deref(s->rtpkeep); diff --git a/src/ua.c b/src/ua.c index e6287fd..2b99255 100644 --- a/src/ua.c +++ b/src/ua.c @@ -1871,12 +1871,6 @@ int ua_print_supported(struct re_printf *pf, const struct ua *ua) } -struct account *ua_prm(const struct ua *ua) -{ - return ua ? ua->acc : NULL; -} - - struct list *ua_calls(const struct ua *ua) { return ua ? (struct list *)&ua->calls : NULL; -- cgit v1.2.3