linphonecall.c 3.26 KB
Newer Older
1 2
/*
linphone
3
Copyright (C) 2010  Belledonne Communications SARL
4 5 6 7 8 9 10 11 12 13 14 15 16 17
 (simon.morlat@linphone.org)

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
18
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19
*/
20

21 22
#include <mediastreamer2/mediastream.h>
#include <mediastreamer2/msvolume.h>
23

24
#include "linphone/types.h"
25

26
#include "private.h"
27

28

29 30
const char *linphone_call_state_to_string(LinphoneCallState cs){
	switch (cs){
31
		case LinphoneCallIdle:
32 33 34
			return "LinphoneCallIdle";
		case LinphoneCallIncomingReceived:
			return "LinphoneCallIncomingReceived";
35
		case LinphoneCallOutgoingInit:
36
			return "LinphoneCallOutgoingInit";
37
		case LinphoneCallOutgoingProgress:
38 39 40 41 42 43 44 45 46
			return "LinphoneCallOutgoingProgress";
		case LinphoneCallOutgoingRinging:
			return "LinphoneCallOutgoingRinging";
		case LinphoneCallOutgoingEarlyMedia:
			return "LinphoneCallOutgoingEarlyMedia";
		case LinphoneCallConnected:
			return "LinphoneCallConnected";
		case LinphoneCallStreamsRunning:
			return "LinphoneCallStreamsRunning";
47
		case LinphoneCallPausing:
48
			return "LinphoneCallPausing";
49
		case LinphoneCallPaused:
50 51 52 53 54
			return "LinphoneCallPaused";
		case LinphoneCallResuming:
			return "LinphoneCallResuming";
		case LinphoneCallRefered:
			return "LinphoneCallRefered";
55
		case LinphoneCallError:
56 57 58 59 60
			return "LinphoneCallError";
		case LinphoneCallEnd:
			return "LinphoneCallEnd";
		case LinphoneCallPausedByRemote:
			return "LinphoneCallPausedByRemote";
61
		case LinphoneCallUpdatedByRemote:
62 63 64 65 66
			return "LinphoneCallUpdatedByRemote";
		case LinphoneCallIncomingEarlyMedia:
			return "LinphoneCallIncomingEarlyMedia";
		case LinphoneCallUpdating:
			return "LinphoneCallUpdating";
67
		case LinphoneCallReleased:
68 69 70 71 72
			return "LinphoneCallReleased";
		case LinphoneCallEarlyUpdatedByRemote:
			return "LinphoneCallEarlyUpdatedByRemote";
		case LinphoneCallEarlyUpdating:
			return "LinphoneCallEarlyUpdating";
73
	}
74
	return "undefined state";
75 76
}

77 78 79 80 81 82 83 84 85 86 87 88 89 90
/**
 * @ingroup call_control
 * @return string value of LinphonePrivacy enum
 **/
const char* linphone_privacy_to_string(LinphonePrivacy privacy) {
	switch(privacy) {
	case LinphonePrivacyDefault: return "LinphonePrivacyDefault";
	case LinphonePrivacyUser: return "LinphonePrivacyUser";
	case LinphonePrivacyHeader: return "LinphonePrivacyHeader";
	case LinphonePrivacySession: return "LinphonePrivacySession";
	case LinphonePrivacyId: return "LinphonePrivacyId";
	case LinphonePrivacyNone: return "LinphonePrivacyNone";
	case LinphonePrivacyCritical: return "LinphonePrivacyCritical";
	default: return "Unknown privacy mode";
91 92 93
	}
}

Benjamin REIS's avatar
Benjamin REIS committed
94 95 96 97
void set_playback_gain_db(AudioStream *st, float gain){
	if (st->volrecv){
		ms_filter_call_method(st->volrecv,MS_VOLUME_SET_DB_GAIN,&gain);
	}else ms_warning("Could not apply playback gain: gain control wasn't activated.");
98
}