purple/utils.c

Go to the documentation of this file.
00001 /* OpenSER PURPLE MODULE
00002  * 
00003  * Copyright (C) 2008 Atos Worldline
00004  * Contact: Eric PTAK <eric.ptak@atosorigin.com>
00005  *
00006  * This program is free software: you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation, either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00018  *
00019  */
00020 #include "../../dprint.h"
00021 #include "utils.h"
00022 
00023 
00024 void primitive_parse(PurpleStatusPrimitive primitive, enum purple_publish_basic *basic, enum purple_publish_activity *activity) {
00025    *basic = PURPLE_BASIC_OPEN;
00026    *activity = 0;
00027       
00028    switch (primitive) {
00029       case PURPLE_STATUS_OFFLINE:
00030          LM_DBG("primitive: OFFLINE\n");
00031          *basic = PURPLE_BASIC_CLOSED;
00032          break;
00033       case PURPLE_STATUS_AVAILABLE:
00034          LM_DBG("primitive: AVAILABLE\n");
00035          *activity = PURPLE_ACTIVITY_AVAILABLE;
00036          break;
00037       case PURPLE_STATUS_UNAVAILABLE:
00038          LM_DBG("primitive: UNAVAILABLE\n");
00039          *activity = PURPLE_ACTIVITY_BUSY;
00040          break;
00041       case PURPLE_STATUS_INVISIBLE:
00042          LM_DBG("primitive: INVISIBLE\n");
00043          *basic = PURPLE_BASIC_CLOSED;
00044          break;
00045       case PURPLE_STATUS_AWAY:
00046          LM_DBG("primitive: AWAY\n");
00047          *activity = PURPLE_ACTIVITY_AWAY;
00048          break;
00049       case PURPLE_STATUS_EXTENDED_AWAY:
00050          LM_DBG("primitive: EXTENDED AWAY\n");
00051          *activity = PURPLE_ACTIVITY_AWAY;
00052          break;
00053       default:
00054          LM_DBG("primitive: [unknown]\n");
00055          break;
00056    }
00057 }

Generated on Thu May 24 08:00:56 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6