outbound_registration: Add 'pjsip send register' and update 'send unregister'
authorGeorge Joseph <george.joseph@fairview5.com>
Tue, 6 Jan 2015 17:43:16 +0000 (17:43 +0000)
committerGeorge Joseph <george.joseph@fairview5.com>
Tue, 6 Jan 2015 17:43:16 +0000 (17:43 +0000)
commitfb3c8e342463afc645c87d5ca2b98adafea2b31e
treefb66dac48726f7687f151cec028c21f9278c3e89
parent7dc0c88fc62ca0e1791b68363f6221af66de43e5
outbound_registration: Add 'pjsip send register' and update 'send unregister'

The current behavior of 'pjsip send unregister' is to send the unregister
(REGISTER with 0 exp) but let the next scheduled register proceed normally.
I don't think that's a good idea.  If you unregister, it should stay
unregistered until you decide to start registrations again.  So this patch
just adds a cancel_registration call to the current unregister_task to
cancel the timer.

Of course, now you need  a way to start registration again so I've added
a 'pjsip send register' command that unregisters and cancels any existing
registration (the same as send unregister), then sends an immediate
registration and starts the timer back up again.

Both changes also ripple to AMI.  There's a new PJSIPRegister command.

There's no harm in calling either command repeatedly.  They don't care
about the actual state.

Tested-by: George Joseph

Review: https://reviewboard.asterisk.org/r/4301/
........

Merged revisions 430223 from http://svn.asterisk.org/svn/asterisk/branches/13

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430224 65c4cc65-6c06-0410-ace0-fbb531ad65f3
CHANGES
res/res_pjsip_outbound_registration.c