diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/account.c | 47 |
1 files changed, 43 insertions, 4 deletions
diff --git a/src/account.c b/src/account.c index 40875f5..0e84eef 100644 --- a/src/account.c +++ b/src/account.c @@ -383,11 +383,11 @@ int account_alloc(struct account **accp, const char *sipaddr) goto out; } - if (acc->mnatid) { - err = stunsrv_decode(acc, &acc->laddr); - if (err) - goto out; + err = stunsrv_decode(acc, &acc->laddr); + if (err) + goto out; + if (acc->mnatid) { acc->mnat = mnat_find(baresip_mnatl(), acc->mnatid); if (!acc->mnat) { warning("account: medianat not found: `%s'\n", @@ -543,6 +543,45 @@ uint32_t account_ptime(const struct account *acc) } +/** + * Get the STUN username of an account + * + * @param acc User-Agent account + * + * @return STUN username + */ +const char *account_stun_user(const struct account *acc) +{ + return acc ? acc->stun_user : NULL; +} + + +/** + * Get the STUN password of an account + * + * @param acc User-Agent account + * + * @return STUN password + */ +const char *account_stun_pass(const struct account *acc) +{ + return acc ? acc->stun_pass : NULL; +} + + +/** + * Get the STUN hostname of an account + * + * @param acc User-Agent account + * + * @return STUN hostname + */ +const char *account_stun_host(const struct account *acc) +{ + return acc ? acc->stun_host : NULL; +} + + static const char *answermode_str(enum answermode mode) { switch (mode) { |