static int lpc_cmd_status(LinphoneCore *lc, char *args);
static int lpc_cmd_ports(LinphoneCore *lc, char *args);
static int lpc_cmd_speak(LinphoneCore *lc, char *args);
- static int lpc_cmd_codec(LinphoneCore *lc, char *args);
+ static int lpc_cmd_acodec(LinphoneCore *lc, char *args);
+ static int lpc_cmd_vcodec(LinphoneCore *lc, char *args);
+ static int lpc_cmd_codec(int type, LinphoneCore *lc, char *args);
static int lpc_cmd_echocancellation(LinphoneCore *lc, char *args);
+static int lpc_cmd_pause(LinphoneCore *lc, char *args);
+static int lpc_cmd_resume(LinphoneCore *lc, char *args);
static int lpc_cmd_mute_mic(LinphoneCore *lc, char *args);
static int lpc_cmd_unmute_mic(LinphoneCore *lc, char *args);
static int lpc_cmd_rtp_no_xmit_on_audio_mute(LinphoneCore *lc, char *args);
"'speak <voice name> <sentence>' : speak a text using the specified espeak voice.\n"
"Example for english voice: 'speak default Hello my friend !'"
},
- { "codec", lpc_cmd_codec, "Codec configuration",
- "'codec list' : list codecs\n"
- "'codec enable <index>' : enable available codec\n"
- "'codec disable <index>' : disable codecs" },
+ { "codec", lpc_cmd_acodec, "Audio codec configuration",
+ "'codec list' : list audio codecs\n"
+ "'codec enable <index>' : enable available audio codec\n"
+ "'codec disable <index>' : disable audio codec" },
+ { "vcodec", lpc_cmd_vcodec, "Video codec configuration",
+ "'vcodec list' : list video codecs\n"
+ "'vcodec enable <index>' : enable available video codec\n"
+ "'vcodec disable <index>' : disable video codec" },
- { "ec", lpc_cmd_echocancellation, "Echo cancellation",
- "'ec on [<delay>] [<tail>] [<framesize>]' : turn EC on with given delay, tail length and framesize\n"
- "'ec off' : turn echo cancellation (EC) off\n"
- "'ec show' : show EC status" },
+ { "ec", lpc_cmd_echocancellation, "Echo cancellation",
+ "'ec on [<delay>] [<tail>] [<framesize>]' : turn EC on with given delay, tail length and framesize\n"
+ "'ec off' : turn echo cancellation (EC) off\n"
+ "'ec show' : show EC status" },
+ { "pause", lpc_cmd_pause, "pause a call",
+ "'pause' : pause the current call\n"},
+ { "resume", lpc_cmd_resume, "resume a call",
+ "'resume' : resume the unique call\n"
+ "'resume <sip:XXX@XXX.XXX.XXX.XXX>' : hold off the call with cid <cid>\n"},
{ "mute", lpc_cmd_mute_mic,
"Mute microphone and suspend voice transmission."},
{ "unmute", lpc_cmd_unmute_mic,
lc->vtable.display_status(lc,barmesg);
/* play the ring */
- if (lc->sound_conf.ring_sndcard!=NULL){
- ms_message("Starting local ring...");
- lc->ringstream=ring_start(lc->sound_conf.local_ring,2000,lc->sound_conf.ring_sndcard);
+ if (lc->sound_conf.ring_sndcard!=NULL && !linphone_core_in_call(lc)){
+ if(lc->ringstream==NULL){
+ MSSndCard *ringcard=lc->sound_conf.lsd_card ?lc->sound_conf.lsd_card : lc->sound_conf.ring_sndcard;
+ ms_message("Starting local ring...");
+ lc->ringstream=ring_start(lc->sound_conf.local_ring,2000,ringcard);
+ }
+ else
+ {
+ ms_message("the local ring is already started");
+ }
}
- linphone_call_set_state(call,LCStateRinging);
+ call->state=LinphoneCallRinging;
sal_call_notify_ringing(h);
- linphone_core_init_media_streams(lc,call);
+ #if !(__IPHONE_OS_VERSION_MIN_REQUIRED >= 40000)
+ linphone_core_init_media_streams(lc,lc->call);
+ #endif
- if (lc->vtable.inv_recv) lc->vtable.inv_recv(lc,tmp);
+ if (lc->vtable.inv_recv) lc->vtable.inv_recv(lc,call);
++#endif
ms_free(barmesg);
ms_free(tmp);
}
/*char *retrymsg=_("%s. Retry after %i minute(s).");*/
char *msg600=_("User does not want to be disturbed.");
char *msg603=_("Call declined.");
- char *msg=(char*)details;
+ const char *msg=details;
- LinphoneCall *call=lc->call;
+ LinphoneCall *call=(LinphoneCall*)sal_op_get_user_pointer(op);
+ LinphoneGeneralStateContext gctx;
- if (sal_op_get_user_pointer(op)!=lc->call){
- ms_warning("call_failure: ignoring.");
- return;
- }
+ gctx.call=call;
if (lc->vtable.show) lc->vtable.show(lc);
if (error==SalErrorNoResponse){
contact=get_fixed_contact(lc,call,cfg);
if (contact)
sal_op_set_contact(call->op,contact);
-
+ #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 40000
+ linphone_core_init_media_streams(lc,call);
+ #endif
sal_call_accept(call->op);
- lc->vtable.display_status(lc,_("Connected."));
- gstate_new_state(lc, GSTATE_CALL_IN_CONNECTED, NULL);
+ if (lc->vtable.display_status!=NULL)
+ lc->vtable.display_status(lc,_("Connected."));
+ gctx.call=call;
+ gstate_new_state(lc, GSTATE_CALL_IN_CONNECTED, gctx, NULL);
call->resultdesc=sal_call_get_final_media_description(call->op);
if (call->resultdesc){
sal_media_description_ref(call->resultdesc);
linphone_core_uninit(lc);
ms_free(lc);
}
+/**
+ * Get the number of Call
+ *
+ * @ingroup call_control
+**/
+int linphone_core_get_calls_nb(const LinphoneCore *lc)
+{
+ int returned;
+ if(lc->calls == NULL)
+ {
+ returned = 0;
+ }
+ else
+ {
+ returned = ms_list_size(lc->calls);
+ }
+ return returned;
+}
+
+/**
+ * Check if we do not have exceed the number of simultaneous call
+ *
+ * @ingroup call_control
+**/
+bool_t linphone_core_can_we_add_call(LinphoneCore *lc)
+{
+ if(linphone_core_get_calls_nb(lc) < NB_MAX_CALLS)
+ return TRUE;
+ ms_error("Maximum amount of simultaneous calls reached !");
+ return FALSE;
+}
+
+/**
+ * Unset the current call
+ *
+ * @ingroup call_control
+**/
+int linphone_core_unset_the_current_call(LinphoneCore *lc)
+{
+ if(lc->current_call == NULL)
+ return -1;
+ lc->current_call = NULL;
+ ms_message("Current call unset\n");
+ return 0;
+}
+
+/**
+ * Set the call in parameter as the new current call
+ *
+ * @ingroup call_control
+**/
+int linphone_core_set_as_current_call(LinphoneCore *lc, LinphoneCall *call)
+{
+ if(lc->current_call != NULL)
+ return -1;
+ lc->current_call = call;
+ return 0;
+}
+
+/**
+ * Add the call in the LinphoneCall list
+ *
+ * @ingroup call_control
+**/
+int linphone_core_add_call( LinphoneCore *lc, LinphoneCall *call)
+{
+ if(linphone_core_can_we_add_call(lc))
+ {
+ MSList *the_calls = lc->calls;
+ the_calls = ms_list_append(the_calls,call);
+ lc->calls = the_calls;
+ return 0;
+ }
+ return -1;
+}
+
+/**
+ * Add the call in the LinphoneCall list
+ *
+ * @ingroup call_control
+**/
+int linphone_core_del_call( LinphoneCore *lc, LinphoneCall *call)
+{
+ MSList *it;
+
+ MSList *the_calls = lc->calls;
+ if(call == linphone_core_get_current_call(lc))
+ {
+ linphone_core_unset_the_current_call(lc);
+ }
+ it=ms_list_find(the_calls,call);
+ if (it)
+ {
+ the_calls = ms_list_remove_link(the_calls,it);
+ }
+ else
+ {
+ ms_warning("could not find the call into the list\n");
+ return -1;
+ }
+ lc->calls = the_calls;
+ return 0;
+}
+
+ static PayloadType* find_payload_type_from_list(const char* type, int rate,const MSList* from) {
+ const MSList *elem;
+ for(elem=from;elem!=NULL;elem=elem->next){
+ PayloadType *pt=(PayloadType*)elem->data;
+ if ((strcmp((char*)type, payload_type_get_mime(pt)) == 0) && rate==pt->clock_rate) {
+ return pt;
+ }
+ }
+ return NULL;
+ }
+
+ PayloadType* linphone_core_find_payload_type(LinphoneCore* lc, const char* type, int rate) {
+ PayloadType* result = find_payload_type_from_list(type, rate, linphone_core_get_audio_codecs(lc));
+ if (result) {
+ return result;
+ } else {
+ result = find_payload_type_from_list(type, rate, linphone_core_get_video_codecs(lc));
+ if (result) {
+ return result;
+ }
+ }
+ //not found
+ return NULL;
+ }
+++ /dev/null
- Subproject commit bc6cdb650a9fc76d00380221eb0198ba4bb96812
-Subproject commit 4b5164714c2cf77a284f0213fc79e9b147e8563a