static int lpc_cmd_speak(LinphoneCore *lc, char *args);
static int lpc_cmd_codec(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);
/* Command handler helpers */
static void linphonec_proxy_add(LinphoneCore *lc);
"'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" },
-- { "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"},
++ { "codec", lpc_cmd_codec, "Codec configuration",
++ "'codec list' : list codecs\n"
++ "'codec enable <index>' : enable available codec\n"
++ "'codec disable <index>' : disable codecs" },
++ { "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,
- "Unmute microphone and resume voice transmission."},
++ "Unmute microphone and resume voice transmission."},
+ { "nortp-on-audio-mute", lpc_cmd_rtp_no_xmit_on_audio_mute,
- "Set the rtp_no_xmit_on_audio_mute configuration parameter",
- " If set to 1 then rtp transmission will be muted when\n"
- " audio is muted , otherwise rtp is always sent."},
- { (char *)NULL, (lpc_cmd_handler)NULL, (char *)NULL, (char *)NULL }
++ "Set the rtp_no_xmit_on_audio_mute configuration parameter",
++ " If set to 1 then rtp transmission will be muted when\n"
++ " audio is muted , otherwise rtp is always sent."},
+ { (char *)NULL, (lpc_cmd_handler)NULL, (char *)NULL, (char *)NULL }
};
/***************************************************************************
return 1;
}
- if ( lc->call != NULL )
- linphone_core_mute_mic(lc, 1);
- return 1;
+ static int lpc_cmd_mute_mic(LinphoneCore *lc, char *args)
+ {
-static int lpc_cmd_unmute_mic(LinphoneCore *lc, char *args)
-{
- if ( lc->call != NULL )
- linphone_core_mute_mic(lc, 0);
- return 1;
++ linphone_core_mute_mic(lc, 1);
++ return 1;
+ }
+
++static int lpc_cmd_unmute_mic(LinphoneCore *lc, char *args){
++ linphone_core_mute_mic(lc, 0);
++ return 1;
+ }
+
+ static int lpc_cmd_rtp_no_xmit_on_audio_mute(LinphoneCore *lc, char *args)
+ {
+ bool_t rtp_xmit_off=FALSE;
+ char *status;
+ gstate_t call_state=linphone_core_get_state(lc,GSTATE_GROUP_CALL);
+
+ if(args){
+ if(strstr(args,"1"))rtp_xmit_off=TRUE;
+ if(call_state == GSTATE_CALL_IDLE)
+ linphone_core_set_rtp_no_xmit_on_audio_mute(lc,rtp_xmit_off);
+ else
+ linphonec_out("nortp-on-audio-mute: call in progress - cannot change state\n");
+ }
+ rtp_xmit_off=linphone_core_get_rtp_no_xmit_on_audio_mute(lc);
+ if(rtp_xmit_off)status="off";
+ else status="on";
+ linphonec_out("rtp transmit %s when audio muted\n",status);
+ return 1;
+ }
+
+
/***************************************************************************
*
* Command table management funx
{
char *contact;
const char *tmpstr;
- int port;
+ LCSipTransports tr;
int i,tmp;
int ipv6;
-
- port=lp_config_get_int(lc->config,"sip","use_info",0);
- linphone_core_set_use_info_for_dtmf(lc,port);
+
+ tmp=lp_config_get_int(lc->config,"sip","use_info",0);
+ linphone_core_set_use_info_for_dtmf(lc,tmp);
+
+ if (lp_config_get_int(lc->config,"sip","use_session_timers",0)==1){
+ sal_use_session_timers(lc->sal,200);
+ }
- port=lp_config_get_int(lc->config,"sip","use_rfc2833",0);
- linphone_core_set_use_rfc2833_for_dtmf(lc,port);
+
++
+ tmp=lp_config_get_int(lc->config,"sip","use_rfc2833",0);
+ linphone_core_set_use_rfc2833_for_dtmf(lc,tmp);
ipv6=lp_config_get_int(lc->config,"sip","use_ipv6",-1);
if (ipv6==-1){
return FALSE;
}
+ #ifdef TEST_EXT_RENDERER
+ static void rendercb(void *data, const MSPicture *local, const MSPicture *remote){
+ ms_message("rendercb, local buffer=%p, remote buffer=%p",
+ local ? local->planes[0] : NULL, remote? remote->planes[0] : NULL);
+ }
+ #endif
+
void linphone_core_init_media_streams(LinphoneCore *lc, LinphoneCall *call){
+#ifdef PRINTF_DEBUG
+ printf("%s(%d)\n",__FUNCTION__,__LINE__);
+#endif
SalMediaDescription *md=call->localdesc;
lc->audiostream=audio_stream_new(md->streams[0].port,linphone_core_ipv6_enabled(lc));
if (linphone_core_echo_limiter_enabled(lc)){
}
void sal_set_keepalive_period(Sal *ctx,unsigned int value) {
+ ctx->keepalive_period=value;
eXosip_set_option (EXOSIP_OPT_UDP_KEEP_ALIVE, &value);
}
+ const char * sal_address_get_port(const SalAddress *addr) {
+ const osip_from_t *u=(const osip_from_t*)addr;
+ return null_if_empty(u->url->port);
+ }
+ int sal_address_get_port_int(const SalAddress *uri) {
+ const char* port = sal_address_get_port(uri);
+ if (port != NULL) {
+ return atoi(port);
+ } else {
+ return 5060;
+ }
+ }
+/**
+ * Send a re-Invite used to hold the current call
+ *
+ * @ingroup call_control
+ * @param lc the LinphoneCore object
+ * @param url the destination of the call (sip address).
+**/
+int sal_call_hold(SalOp *h, bool_t holdon)
+{
+ int err=0;
+
+ osip_message_t *reinvite;
+ if(eXosip_call_build_request(h->did,"INVITE",&reinvite) != OSIP_SUCCESS)
+ return -1;
+ if(reinvite==NULL)
+ return -2;
+ osip_message_set_subject(reinvite,osip_strdup("Phone Call Hold"));
+ osip_message_set_allow(reinvite, "INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO");
+ if (h->base.root->session_expires!=0){
+ osip_message_set_header(reinvite, "Session-expires", "200");
+ osip_message_set_supported(reinvite, "timer");
+ }
+ //add something to say that the distant sip phone will be in sendonly/sendrecv mode
+ if (h->base.local_media){
+ h->sdp_offering=TRUE;
+ set_hold_status_to_desc(h->base.local_media,holdon);
+ set_sdp_from_desc(reinvite,h->base.local_media);
+ }else h->sdp_offering=FALSE;
+ eXosip_lock();
+ err = eXosip_call_send_request(h->did, reinvite);
+ eXosip_unlock();
+
+ return err;
+}
+