summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfred E. Heggestad <aeh@db.org>2016-09-04 15:02:46 +0200
committerAlfred E. Heggestad <aeh@db.org>2016-09-04 15:02:46 +0200
commit411f5dbf811c1b2c4fedc3070af828bcfbe3ec9a (patch)
treeffbeb0f0767513c0b6ace4c4ce42be0b2c009bab
parent8abcfeb1486a093a07360c63ea65958e3daaa57d (diff)
remove ua_prm(), use ua_account() instead
-rw-r--r--include/baresip.h1
-rw-r--r--modules/mwi/mwi.c2
-rw-r--r--modules/presence/notifier.c2
-rw-r--r--modules/presence/subscriber.c2
-rw-r--r--src/call.c6
-rw-r--r--src/core.h1
-rw-r--r--src/reg.c2
-rw-r--r--src/sipreq.c2
-rw-r--r--src/stream.c2
-rw-r--r--src/ua.c6
10 files changed, 13 insertions, 13 deletions
diff --git a/include/baresip.h b/include/baresip.h
index 0d6271c..bcd99c9 100644
--- a/include/baresip.h
+++ b/include/baresip.h
@@ -582,7 +582,6 @@ struct account *ua_account(const struct ua *ua);
const char *ua_outbound(const struct ua *ua);
struct call *ua_call(const struct ua *ua);
struct call *ua_prev_call(const struct ua *ua);
-struct account *ua_prm(const struct ua *ua);
struct list *ua_calls(const struct ua *ua);
enum presence_status ua_presence_status(const struct ua *ua);
void ua_presence_status_set(struct ua *ua, const enum presence_status status);
diff --git a/modules/mwi/mwi.c b/modules/mwi/mwi.c
index 2b94131..4ce4a19 100644
--- a/modules/mwi/mwi.c
+++ b/modules/mwi/mwi.c
@@ -109,7 +109,7 @@ static int mwi_subscribe(struct ua *ua)
NULL, ua_aor(ua), "message-summary", NULL,
600, ua_cuser(ua),
routev, routev[0] ? 1 : 0,
- auth_handler, ua_prm(ua), true, NULL,
+ auth_handler, ua_account(ua), true, NULL,
notify_handler, close_handler, mwi,
"Accept:"
" application/simple-message-summary\r\n");
diff --git a/modules/presence/notifier.c b/modules/presence/notifier.c
index 387a9bc..7fc0a67 100644
--- a/modules/presence/notifier.c
+++ b/modules/presence/notifier.c
@@ -130,7 +130,7 @@ static int notifier_alloc(struct notifier **notp,
msg, NULL, se, 200, "OK",
600, 600, 600,
ua_cuser(not->ua), "application/pidf+xml",
- auth_handler, ua_prm(not->ua), true,
+ auth_handler, ua_account(not->ua), true,
sipnot_close_handler, not, NULL);
if (err) {
warning("presence: sipevent_accept failed: %m\n", err);
diff --git a/modules/presence/subscriber.c b/modules/presence/subscriber.c
index c3dfc28..596e592 100644
--- a/modules/presence/subscriber.c
+++ b/modules/presence/subscriber.c
@@ -239,7 +239,7 @@ static int subscribe(struct presence *pres)
err = sipevent_subscribe(&pres->sub, uag_sipevent_sock(), uri, NULL,
ua_aor(ua), "presence", NULL, 600,
ua_cuser(ua), routev, routev[0] ? 1 : 0,
- auth_handler, ua_prm(ua), true, NULL,
+ auth_handler, ua_account(ua), true, NULL,
notify_handler, close_handler, pres,
"%H", ua_print_supported, ua);
if (err) {
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] ? &params[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;