Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add server_only account config #1156

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/re_sipreg.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ int sipreg_send(struct sipreg *reg);
int sipreg_set_rwait(struct sipreg *reg, uint32_t rwait);

const struct sa *sipreg_laddr(const struct sipreg *reg);
const struct sa *sipreg_paddr(const struct sipreg *reg);

uint32_t sipreg_proxy_expires(const struct sipreg *reg);
bool sipreg_registered(const struct sipreg *reg);
Expand Down
16 changes: 16 additions & 0 deletions src/sipreg/reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ enum {
struct sipreg {
struct sip_loopstate ls;
struct sa laddr;
struct sa paddr;
struct tmr tmr;
struct sip *sip;
struct sip_keepalive *ka;
Expand Down Expand Up @@ -201,6 +202,8 @@ static void response_handler(int err, const struct sip_msg *msg, void *arg)
goto out;
}

reg->paddr = msg->src;

if (msg->scode < 200) {
return;
}
Expand Down Expand Up @@ -565,6 +568,19 @@ const struct sa *sipreg_laddr(const struct sipreg *reg)
}


/**
* Get the peer address for a SIP Registration client
*
* @param reg SIP Registration client
*
* @return Peer address
*/
const struct sa *sipreg_paddr(const struct sipreg *reg)
{
return reg ? &reg->paddr : NULL;
}


/**
* Get the proxy expires value of a SIP registration client
*
Expand Down
Loading