return NULL;
}
+/**
+ * Returns the far end's sip contact as a string, if available.
+**/
+const char *linphone_call_get_remote_contact(LinphoneCall *call){
+ if (call->op){
+ return sal_op_get_remote_contact(call->op);
+ }
+ return NULL;
+}
+
/**
* Returns true if this calls has received a transfer that has not been
* executed yet.
int linphone_call_take_video_snapshot(LinphoneCall *call, const char *file);
LinphoneReason linphone_call_get_reason(const LinphoneCall *call);
const char *linphone_call_get_remote_user_agent(LinphoneCall *call);
+const char *linphone_call_get_remote_contact(LinphoneCall *call);
float linphone_call_get_play_volume(LinphoneCall *call);
float linphone_call_get_record_volume(LinphoneCall *call);
float linphone_call_get_current_quality(LinphoneCall *call);
extern "C" jstring Java_org_linphone_core_LinphoneCallImpl_getRemoteUserAgent(JNIEnv *env, jobject thiz, jlong ptr) {
LinphoneCall *call = (LinphoneCall *)ptr;
- jstring jvalue = env->NewStringUTF(linphone_call_get_remote_user_agent(call));
+ const char *value=linphone_call_get_remote_user_agent(call);
+ jstring jvalue=NULL;
+ if (value) jvalue=env->NewStringUTF();
+ return jvalue;
+}
+
+extern "C" jstring Java_org_linphone_core_LinphoneCallImpl_getRemoteContact(JNIEnv *env, jobject thiz, jlong ptr) {
+ LinphoneCall *call = (LinphoneCall *)ptr;
+ const char *value=linphone_call_get_remote_contact(call);
+ jstring jvalue = NULL;
+ if (value) jvalue=env->NewStringUTF(value);
return jvalue;
}
return ((SalOpBase*)op)->contact;
}
+const char *sal_op_get_remote_contact(const SalOp *op){
+ return ((SalOpBase*)op)->remote_contact;
+}
+
const char *sal_op_get_route(const SalOp *op){
return ((SalOpBase*)op)->route;
}
assign_string(&((SalOpBase*)op)->origin,origin);
}
+void __sal_op_set_remote_contact(SalOp *op, const char *ct){
+ assign_string(&((SalOpBase*)op)->remote_contact,ct);
+}
void __sal_op_free(SalOp *op){
SalOpBase *b=(SalOpBase *)op;
ms_free(b->remote_ua);
b->remote_ua=NULL;
}
+ if (b->remote_contact){
+ ms_free(b->remote_contact);
+ b->remote_contact=NULL;
+ }
if (b->local_media)
sal_media_description_unref(b->local_media);
if (b->remote_media)
sal_media_description_unref(b->remote_media);
if (b->call_id)
- ms_free((void*)b->call_id);
+ ms_free(b->call_id);
ms_free(op);
}
SalMediaDescription *local_media;
SalMediaDescription *remote_media;
void *user_pointer;
- const char* call_id;
+ char* call_id;
+ char *remote_contact;
} SalOpBase;
const char *sal_op_get_contact(const SalOp *op);
const char *sal_op_get_route(const SalOp *op);
const char *sal_op_get_proxy(const SalOp *op);
+const char *sal_op_get_remote_contact(const SalOp *op);
/*for incoming requests, returns the origin of the packet as a sip uri*/
const char *sal_op_get_network_origin(const SalOp *op);
/*returns far-end "User-Agent" string */
-#define payload_type_set_number(pt,n) (pt)->user_data=(void*)((long)n);
+#define payload_type_set_number(pt,n) (pt)->user_data=(void*)((long)n);
#define payload_type_get_number(pt) ((int)(long)(pt)->user_data)
/*misc*/
/*internal API */
void __sal_op_init(SalOp *b, Sal *sal);
void __sal_op_set_network_origin(SalOp *op, const char *origin /*a sip uri*/);
+void __sal_op_set_remote_contact(SalOp *op, const char *ct);
void __sal_op_free(SalOp *b);
#endif
ms_error("Fail to send invite ! Error code %d", err);
return -1;
}else{
+ char *tmp=NULL;
callid=osip_message_get_call_id(invite);
- osip_call_id_to_str(callid,(char **)(&h->base.call_id));
+ osip_call_id_to_str(callid,&tmp);
+ h->base.call_id=ms_strdup(tmp);
+ osip_free(tmp);
sal_add_call(h->base.root,h);
}
return 0;
}
}
+static void set_remote_contact(SalOp* op, osip_message_t *req){
+ if (op->base.remote_contact==NULL){
+ osip_contact_t *h=NULL;
+ osip_message_get_contact(req,0,&h);
+ if (h){
+ char *tmp=NULL;
+ osip_contact_to_str(h,&tmp);
+ __sal_op_set_remote_contact(op,tmp);
+ osip_free(tmp);
+ }
+ }
+}
+
static void set_replaces(SalOp *op, osip_message_t *req){
osip_header_t *h=NULL;
SalOp *op=sal_op_new(sal);
osip_from_t *from,*to;
osip_call_info_t *call_info;
- char *tmp;
+ char *tmp=NULL;
sdp_message_t *sdp=eXosip_get_sdp_info(ev->request);
+
osip_call_id_t *callid=osip_message_get_call_id(ev->request);
- osip_call_id_to_str(callid,(char**)(&op->base.call_id));
-
+
+ osip_call_id_to_str(callid,&tmp);
+ op->base.call_id=ms_strdup(tmp);
+ osip_free(tmp);
+
set_network_origin(op,ev->request);
+ set_remote_contact(op,ev->request);
set_remote_ua(op,ev->request);
set_replaces(op,ev->request);
op->did=ev->did;
set_remote_ua(op,ev->response);
+ set_remote_contact(op,ev->response);
sdp=eXosip_get_sdp_info(ev->response);
if (sdp){
/**
* The call's parameters are updated, used for example when video is asked by remote
*/
- public static final State CallUpdatedByRemote = new State(15, "CallUpdatedByRemote");
+ public static final State CallUpdatedByRemote = new State(15, "UpdatedByRemote");
/**
* We are proposing early media to an incoming call
*/
- public static final State CallIncomingEarlyMedia = new State(16,"CallIncomingEarlyMedia");
+ public static final State CallIncomingEarlyMedia = new State(16,"IncomingEarlyMedia");
/**
- * The remote accepted the call update initiated by us
+ * We have initiated a call update. When the remote accepts the call update, state will move to StreamsRunning.
*/
- public static final State CallUpdated = new State(17, "CallUpdated");
+ public static final State CallUpdating = new State(17, "Updating");
/**
* The call object is now released.
*/
- public static final State CallReleased = new State(18,"CallReleased");
+ public static final State CallReleased = new State(18,"Released");
private State(int value,String stringValue) {
**/
LinphoneCallLog getCallLog();
- /**
- * Set the audio statistics associated with this call.
- * @return LinphoneCallStats
- */
- void setAudioStats(LinphoneCallStats stats);
-
- /**
- * Set the video statistics associated with this call.
- * @return LinphoneCallStats
- */
- void setVideoStats(LinphoneCallStats stats);
/**
* Get the audio statistics associated with this call.
*/
LinphoneCallStats getVideoStats();
+ /**
+ * Get call's remote parameters, as proposed by far end.
+ * This is useful for example to know if far end supports video or encryption.
+ **/
LinphoneCallParams getRemoteParams();
LinphoneCallParams getCurrentParamsCopy();
* Obtain the remote user agent string.
*/
String getRemoteUserAgent();
+
+ /**
+ * Obtain the remote sip contact string.
+ **/
+ String getRemoteContact();
/**
* Take a photo of currently received video and write it into a jpeg file.
public String getRemoteUserAgent() {
return getRemoteUserAgent(nativePtr);
}
+
+ private native String getRemoteContact(long nativePtr);
+ public String getRemoteContact() {
+ return getRemoteContact(nativePtr);
+ }
private native void takeSnapshot(long nativePtr, String path);
public void takeSnapshot(String path) {