From 19e80e2d2c6368710cbb453b1f53e6c8c9dc1669 Mon Sep 17 00:00:00 2001 From: nils-ohlmeier Date: Mon, 11 Dec 2006 16:26:03 +0000 Subject: [PATCH] added 'star' as special word for the contact option -C git-svn-id: http://svn.berlios.de/svnroot/repos/sipsak/trunk@426 75b5f7c7-cfd4-0310-b54c-e118b2c5249a (cherry picked from commit 3860d1a03ef2d9840487969994fa3a68ff4d9d85) (cherry picked from commit 1e0ea08deb29a0c8cb1823297ee04a6b385b6367) --- sipsak.1 | 6 ++++++ sipsak.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/sipsak.1 b/sipsak.1 index 5368319..d65ba0e 100644 --- a/sipsak.1 +++ b/sipsak.1 @@ -175,6 +175,12 @@ or .B none will result in no contact header in the REGISTER request and thus the server should answer with the current bindings for the account at the registrar. +The special words +.B * +or +.B star +will result in Contact header containing just a star, e.g. to remove all +bindings by using expires value 0 together with this Contact. .IP "-d, --ignore-redirects" If this option is set all redirects will be ignored. By default without this diff --git a/sipsak.c b/sipsak.c index 49460c6..c370c49 100644 --- a/sipsak.c +++ b/sipsak.c @@ -393,7 +393,8 @@ int main(int argc, char *argv[]) (strlen(optarg) == 4 && STRNCASECMP(optarg, "none", 4) == 0)) { empty_contact = 1; } - else if (strlen(optarg) == 1 && STRNCASECMP(optarg, "*", 1) == 0) { + else if ((strlen(optarg) == 1 && STRNCASECMP(optarg, "*", 1) == 0) || + (strlen(optarg) == 4 && STRNCASECMP(optarg, "star", 4) == 0)) { contact_uri=str_alloc(strlen(optarg)+1); strncpy(contact_uri, optarg, strlen(optarg)); }