From b08fc20a2832bec319540a39053b025453b09df9 Mon Sep 17 00:00:00 2001 From: Richard Aas Date: Fri, 30 Jun 2017 09:51:31 +0200 Subject: [PATCH] Added function sipreg_laddr() (#67) --- include/re_sipreg.h | 2 ++ src/sipreg/reg.c | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/include/re_sipreg.h b/include/re_sipreg.h index 765d1586..361d6dbd 100644 --- a/include/re_sipreg.h +++ b/include/re_sipreg.h @@ -13,3 +13,5 @@ int sipreg_register(struct sipreg **regp, struct sip *sip, const char *reg_uri, int regid, sip_auth_h *authh, void *aarg, bool aref, sip_resp_h *resph, void *arg, const char *params, const char *fmt, ...); + +const struct sa *sipreg_laddr(const struct sipreg *reg); diff --git a/src/sipreg/reg.c b/src/sipreg/reg.c index 8a8faec1..1905195d 100644 --- a/src/sipreg/reg.c +++ b/src/sipreg/reg.c @@ -392,3 +392,16 @@ int sipreg_register(struct sipreg **regp, struct sip *sip, const char *reg_uri, return err; } + + +/** + * Get the local socket address for a SIP Registration client + * + * @param reg SIP Registration client + * + * @return Local socket address + */ +const struct sa *sipreg_laddr(const struct sipreg *reg) +{ + return reg ? ®->laddr : NULL; +}