3 Copyright (C) 2010 Simon MORLAT (simon.morlat@free.fr)
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 #include "linphonecore.h"
25 #include "mediastreamer2/mediastream.h"
28 static void register_failure(SalOp *op, SalError error, SalReason reason, const char *details);
30 void linphone_core_update_streams(LinphoneCore *lc, LinphoneCall *call, SalMediaDescription *new_md){
31 SalMediaDescription *oldmd=call->resultdesc;
33 if (lc->ringstream!=NULL){
34 ring_stop(lc->ringstream);
38 sal_media_description_ref(new_md);
39 call->media_pending=FALSE;
41 call->media_pending=TRUE;
43 call->resultdesc=new_md;
44 if (call->audiostream && call->audiostream->ticker){
45 /* we already started media: check if we really need to restart it*/
47 if (sal_media_description_equals(oldmd,new_md) && !call->playing_ringbacktone){
48 sal_media_description_unref(oldmd);
50 ms_message("Early media finished, unmuting inputs...");
51 /*we were in early media, now we want to enable real media */
52 linphone_call_enable_camera (call,linphone_call_camera_enabled (call));
53 if (call->audiostream)
54 linphone_core_mute_mic (lc, linphone_core_is_mic_muted(lc));
56 if (call->videostream && call->camera_active)
57 video_stream_change_camera(call->videostream,lc->video_conf.device );
60 ms_message("No need to restart streams, SDP is unchanged.");
63 ms_message("Media descriptions are different, need to restart the streams.");
66 linphone_call_stop_media_streams (call);
67 linphone_call_init_media_streams (call);
70 sal_media_description_unref(oldmd);
73 bool_t all_muted=FALSE;
74 bool_t send_ringbacktone=FALSE;
76 if (call->audiostream==NULL){
77 /*this happens after pausing the call locally. The streams is destroyed and then we wait the 200Ok to recreate it*/
78 linphone_call_init_media_streams (call);
80 if (call->state==LinphoneCallIncomingEarlyMedia && linphone_core_get_remote_ringback_tone (lc)!=NULL){
81 send_ringbacktone=TRUE;
83 if (call->state==LinphoneCallIncomingEarlyMedia ||
84 (call->state==LinphoneCallOutgoingEarlyMedia && !call->params.real_early_media)){
87 linphone_call_start_media_streams(call,all_muted,send_ringbacktone);
91 static bool_t is_duplicate_call(LinphoneCore *lc, const LinphoneAddress *from, const LinphoneAddress *to){
93 for(elem=lc->calls;elem!=NULL;elem=elem->next){
94 LinphoneCall *call=(LinphoneCall*)elem->data;
95 if (linphone_address_weak_equal(call->log->from,from) &&
96 linphone_address_weak_equal(call->log->to, to)){
103 static void call_received(SalOp *h){
104 LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(h));
107 const char *from,*to;
109 LinphoneAddress *from_parsed;
110 LinphoneAddress *from_addr, *to_addr;
111 SalMediaDescription *md;
112 bool_t propose_early_media=lp_config_get_int(lc->config,"sip","incoming_calls_early_media",FALSE);
113 const char *ringback_tone=linphone_core_get_remote_ringback_tone (lc);
115 /* first check if we can answer successfully to this invite */
116 if (lc->presence_mode==LinphoneStatusBusy ||
117 lc->presence_mode==LinphoneStatusOffline ||
118 lc->presence_mode==LinphoneStatusDoNotDisturb ||
119 lc->presence_mode==LinphoneStatusMoved){
120 if (lc->presence_mode==LinphoneStatusBusy )
121 sal_call_decline(h,SalReasonBusy,NULL);
122 else if (lc->presence_mode==LinphoneStatusOffline)
123 sal_call_decline(h,SalReasonTemporarilyUnavailable,NULL);
124 else if (lc->presence_mode==LinphoneStatusDoNotDisturb)
125 sal_call_decline(h,SalReasonTemporarilyUnavailable,NULL);
126 else if (lc->alt_contact!=NULL && lc->presence_mode==LinphoneStatusMoved)
127 sal_call_decline(h,SalReasonRedirect,lc->alt_contact);
131 if (!linphone_core_can_we_add_call(lc)){/*busy*/
132 sal_call_decline(h,SalReasonBusy,NULL);
136 from=sal_op_get_from(h);
138 from_addr=linphone_address_new(from);
139 to_addr=linphone_address_new(to);
141 if (is_duplicate_call(lc,from_addr,to_addr)){
142 ms_warning("Receiving duplicated call, refusing this one.");
143 sal_call_decline(h,SalReasonBusy,NULL);
144 linphone_address_destroy(from_addr);
145 linphone_address_destroy(to_addr);
149 call=linphone_call_new_incoming(lc,from_addr,to_addr,h);
150 sal_call_set_local_media_description(h,call->localdesc);
151 md=sal_call_get_final_media_description(h);
153 if (md && sal_media_description_empty(md)){
154 sal_call_decline(h,SalReasonMedia,NULL);
155 linphone_call_unref(call);
159 /* the call is acceptable so we can now add it to our list */
160 linphone_core_add_call(lc,call);
162 from_parsed=linphone_address_new(sal_op_get_from(h));
163 linphone_address_clean(from_parsed);
164 tmp=linphone_address_as_string(from_parsed);
165 linphone_address_destroy(from_parsed);
166 barmesg=ortp_strdup_printf("%s %s%s",tmp,_("is contacting you"),
167 (sal_call_autoanswer_asked(h)) ?_(" and asked autoanswer."):_("."));
168 if (lc->vtable.show) lc->vtable.show(lc);
169 if (lc->vtable.display_status)
170 lc->vtable.display_status(lc,barmesg);
172 /* play the ring if this is the only call*/
173 if (lc->sound_conf.ring_sndcard!=NULL && ms_list_size(lc->calls)==1){
174 lc->current_call=call;
175 if (lc->ringstream && lc->dmfs_playing_start_time!=0){
176 ring_stop(lc->ringstream);
178 lc->dmfs_playing_start_time=0;
180 if(lc->ringstream==NULL && lc->sound_conf.local_ring){
181 MSSndCard *ringcard=lc->sound_conf.lsd_card ?lc->sound_conf.lsd_card : lc->sound_conf.ring_sndcard;
182 ms_message("Starting local ring...");
183 lc->ringstream=ring_start(lc->sound_conf.local_ring,2000,ringcard);
187 ms_message("the local ring is already started");
190 /*TODO : play a tone within the context of the current call */
192 linphone_call_set_state(call,LinphoneCallIncomingReceived,"Incoming call");
194 sal_call_notify_ringing(h,propose_early_media || ringback_tone!=NULL);
196 if (propose_early_media || ringback_tone!=NULL){
197 linphone_call_set_state(call,LinphoneCallIncomingEarlyMedia,"Incoming call early media");
198 linphone_core_update_streams(lc,call,md);
204 if (sal_call_get_replaces(call->op)!=NULL && lp_config_get_int(lc->config,"sip","auto_answer_replacing_calls",1)){
205 linphone_core_accept_call(lc,call);
209 static void call_ringing(SalOp *h){
210 LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(h));
211 LinphoneCall *call=(LinphoneCall*)sal_op_get_user_pointer(h);
212 SalMediaDescription *md;
214 if (call==NULL) return;
216 if (lc->vtable.display_status)
217 lc->vtable.display_status(lc,_("Remote ringing."));
219 md=sal_call_get_final_media_description(h);
221 if (lc->ringstream && lc->dmfs_playing_start_time!=0){
222 ring_stop(lc->ringstream);
224 lc->dmfs_playing_start_time=0;
226 if (lc->ringstream!=NULL) return; /*already ringing !*/
227 if (lc->sound_conf.play_sndcard!=NULL){
228 MSSndCard *ringcard=lc->sound_conf.lsd_card ? lc->sound_conf.lsd_card : lc->sound_conf.play_sndcard;
229 ms_message("Remote ringing...");
230 lc->ringstream=ring_start(lc->sound_conf.remote_ring,2000,ringcard);
231 linphone_call_set_state(call,LinphoneCallOutgoingRinging,"Remote ringing");
234 /*accept early media */
235 if (call->audiostream && call->audiostream->ticker!=NULL){
236 /*streams already started */
237 ms_message("Early media already started.");
240 if (lc->vtable.show) lc->vtable.show(lc);
241 if (lc->vtable.display_status)
242 lc->vtable.display_status(lc,_("Early media."));
243 linphone_call_set_state(call,LinphoneCallOutgoingEarlyMedia,"Early media");
244 if (lc->ringstream!=NULL){
245 ring_stop(lc->ringstream);
248 ms_message("Doing early media...");
249 linphone_core_update_streams (lc,call,md);
255 * - when the call is accepted
256 * - when a request is accepted (pause, resume)
258 static void call_accepted(SalOp *op){
259 LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(op));
260 LinphoneCall *call=(LinphoneCall*)sal_op_get_user_pointer(op);
261 SalMediaDescription *md;
264 ms_warning("No call to accept.");
268 md=sal_call_get_final_media_description(op);
270 if (call->state==LinphoneCallOutgoingProgress ||
271 call->state==LinphoneCallOutgoingRinging ||
272 call->state==LinphoneCallOutgoingEarlyMedia){
273 linphone_call_set_state(call,LinphoneCallConnected,"Connected");
275 if (md && !sal_media_description_empty(md)){
276 if (sal_media_description_has_dir(md,SalStreamSendOnly) ||
277 sal_media_description_has_dir(md,SalStreamInactive)){
278 if (lc->vtable.display_status){
279 char *tmp=linphone_call_get_remote_address_as_string (call);
280 char *msg=ms_strdup_printf(_("Call with %s is paused."),tmp);
281 lc->vtable.display_status(lc,msg);
285 linphone_call_set_state(call,LinphoneCallPaused,"Call paused");
286 }else if (sal_media_description_has_dir(md,SalStreamRecvOnly)){
287 /*we are put on hold when the call is initially accepted */
288 if (lc->vtable.display_status){
289 char *tmp=linphone_call_get_remote_address_as_string (call);
290 char *msg=ms_strdup_printf(_("Call answered by %s - on hold."),tmp);
291 lc->vtable.display_status(lc,msg);
295 linphone_call_set_state(call,LinphoneCallPaused,"Call paused");
297 if (lc->vtable.display_status){
298 lc->vtable.display_status(lc,_("Call answered - connected."));
300 if (call->state==LinphoneCallStreamsRunning){
301 /*media was running before, the remote as acceted a call modification (that is
302 a reinvite made by us. We must notify the application this reinvite was accepted*/
303 linphone_call_set_state(call, LinphoneCallUpdated, "Call updated");
305 linphone_call_set_state(call,LinphoneCallStreamsRunning,"Connected (streams running)");
307 linphone_core_update_streams (lc,call,md);
310 ms_error("Incompatible SDP offer received in 200Ok, need to abort the call");
311 linphone_core_abort_call(lc,call,"No codec intersection");
315 static void call_ack(SalOp *op){
316 LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(op));
317 LinphoneCall *call=(LinphoneCall*)sal_op_get_user_pointer(op);
319 ms_warning("No call to be ACK'd");
322 if (call->media_pending){
323 SalMediaDescription *md=sal_call_get_final_media_description(op);
324 if (md && !sal_media_description_empty(md)){
325 if (call->state==LinphoneCallStreamsRunning){
326 /*media was running before, the remote as acceted a call modification (that is
327 a reinvite made by us. We must notify the application this reinvite was accepted*/
328 linphone_call_set_state(call, LinphoneCallUpdated, "Call updated");
330 linphone_core_update_streams (lc,call,md);
331 linphone_call_set_state (call,LinphoneCallStreamsRunning,"Connected (streams running)");
334 ms_error("Incompatible SDP response received in ACK, need to abort the call");
335 linphone_core_abort_call(lc,call,"No codec intersection");
341 /* this callback is called when an incoming re-INVITE modifies the session*/
342 static void call_updating(SalOp *op){
343 LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(op));
344 LinphoneCall *call=(LinphoneCall*)sal_op_get_user_pointer(op);
345 LinphoneCallState prevstate=LinphoneCallIdle;
346 SalMediaDescription *md;
348 md=sal_call_get_final_media_description(op);
350 if (md && !sal_media_description_empty(md))
352 if ((call->state==LinphoneCallPausedByRemote || call->state==LinphoneCallPaused) &&
353 sal_media_description_has_dir(md,SalStreamSendRecv) && strcmp(md->addr,"0.0.0.0")!=0){
354 /*make sure we can be resumed */
355 if (lc->current_call!=NULL && lc->current_call!=call){
356 ms_warning("Attempt to be resumed but already in call with somebody else!");
357 /*we are actively running another call, reject with a busy*/
358 sal_call_decline (op,SalReasonBusy,NULL);
361 if(lc->vtable.display_status)
362 lc->vtable.display_status(lc,_("We have been resumed..."));
363 linphone_call_set_state (call,LinphoneCallStreamsRunning,"Connected (streams running)");
365 else if(call->state==LinphoneCallStreamsRunning &&
366 ( sal_media_description_has_dir(md,SalStreamRecvOnly)
367 || sal_media_description_has_dir(md,SalStreamInactive)
368 || strcmp(md->addr,"0.0.0.0")==0)){
369 if(lc->vtable.display_status)
370 lc->vtable.display_status(lc,_("We are being paused..."));
371 linphone_call_set_state (call,LinphoneCallPausedByRemote,"Call paused by remote");
372 if (lc->current_call!=call){
373 ms_error("Inconsitency detected: current call is %p but call %p is being paused !",lc->current_call,call);
376 prevstate=call->state;
377 linphone_call_set_state(call, LinphoneCallUpdatedByRemote,"Call updated by remote");
379 /*accept the modification (sends a 200Ok)*/
381 linphone_core_update_streams (lc,call,md);
382 if (prevstate!=LinphoneCallIdle){
383 linphone_call_set_state (call,prevstate,"Connected (streams running)");
388 static void call_terminated(SalOp *op, const char *from){
389 LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(op));
390 LinphoneCall *call=(LinphoneCall*)sal_op_get_user_pointer(op);
392 if (call==NULL) return;
394 if (linphone_call_get_state(call)==LinphoneCallEnd || linphone_call_get_state(call)==LinphoneCallError){
395 ms_warning("call_terminated: ignoring.");
398 ms_message("Current call terminated...");
399 //we stop the call only if we have this current call or if we are in call
400 if (lc->ringstream!=NULL && ( (ms_list_size(lc->calls) == 1) || linphone_core_in_call(lc) )) {
401 ring_stop(lc->ringstream);
404 linphone_call_stop_media_streams(call);
405 if (lc->vtable.show!=NULL)
407 if (lc->vtable.display_status!=NULL)
408 lc->vtable.display_status(lc,_("Call terminated."));
410 linphone_call_set_state(call, LinphoneCallEnd,"Call ended");
413 static void call_failure(SalOp *op, SalError error, SalReason sr, const char *details, int code){
414 LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(op));
415 char *msg486=_("User is busy.");
416 char *msg480=_("User is temporarily unavailable.");
417 /*char *retrymsg=_("%s. Retry after %i minute(s).");*/
418 char *msg600=_("User does not want to be disturbed.");
419 char *msg603=_("Call declined.");
420 const char *msg=details;
421 LinphoneCall *call=(LinphoneCall*)sal_op_get_user_pointer(op);
424 ms_warning("Call faillure reported on already cleaned call ?");
428 if (lc->vtable.show) lc->vtable.show(lc);
430 if (error==SalErrorNoResponse){
431 msg=_("No response.");
432 if (lc->vtable.display_status)
433 lc->vtable.display_status(lc,msg);
434 }else if (error==SalErrorProtocol){
435 msg=details ? details : _("Protocol error.");
436 if (lc->vtable.display_status)
437 lc->vtable.display_status(lc, msg);
438 }else if (error==SalErrorFailure){
440 case SalReasonDeclined:
442 if (lc->vtable.display_status)
443 lc->vtable.display_status(lc,msg603);
447 if (lc->vtable.display_status)
448 lc->vtable.display_status(lc,msg486);
450 case SalReasonRedirect:
452 if (lc->vtable.display_status)
453 lc->vtable.display_status(lc,msg);
455 case SalReasonTemporarilyUnavailable:
457 if (lc->vtable.display_status)
458 lc->vtable.display_status(lc,msg480);
460 case SalReasonNotFound:
462 if (lc->vtable.display_status)
463 lc->vtable.display_status(lc,msg);
465 case SalReasonDoNotDisturb:
467 if (lc->vtable.display_status)
468 lc->vtable.display_status(lc,msg600);
471 msg=_("No common codecs");
472 if (lc->vtable.display_status)
473 lc->vtable.display_status(lc,msg);
476 if (lc->vtable.display_status)
477 lc->vtable.display_status(lc,_("Call failed."));
481 if (lc->ringstream!=NULL) {
482 ring_stop(lc->ringstream);
485 linphone_call_stop_media_streams (call);
486 if (sr!=SalReasonDeclined) linphone_call_set_state(call,LinphoneCallError,msg);
488 call->reason=LinphoneReasonDeclined;
489 linphone_call_set_state(call,LinphoneCallEnd,"Call declined.");
493 static void auth_requested(SalOp *h, const char *realm, const char *username){
494 LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(h));
495 LinphoneAuthInfo *ai=(LinphoneAuthInfo*)linphone_core_find_auth_info(lc,realm,username);
496 ms_message("auth_requested() for realm=%s, username=%s",realm,username);
497 if (ai && (ai->works || ai->usecount<3)){
499 sai.username=ai->username;
500 sai.userid=ai->userid;
502 sai.password=ai->passwd;
503 ms_message("auth_requested(): authenticating realm=%s, username=%s",realm,username);
504 sal_op_authenticate(h,&sai);
507 if (ai && ai->works==FALSE) {
508 register_failure(h, SalErrorFailure, SalReasonForbidden, _("Authentication failure"));
510 if (lc->vtable.auth_info_requested)
511 lc->vtable.auth_info_requested(lc,realm,username);
515 static void auth_success(SalOp *h, const char *realm, const char *username){
516 LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(h));
517 LinphoneAuthInfo *ai=(LinphoneAuthInfo*)linphone_core_find_auth_info(lc,realm,username);
519 ms_message("%s/%s authentication works.",realm,username);
524 static void register_success(SalOp *op, bool_t registered){
525 LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(op));
526 LinphoneProxyConfig *cfg=(LinphoneProxyConfig*)sal_op_get_user_pointer(op);
529 cfg->registered=registered;
530 linphone_proxy_config_set_error(cfg,LinphoneReasonNone);
531 linphone_proxy_config_set_state(cfg, registered ? LinphoneRegistrationOk : LinphoneRegistrationCleared ,
532 registered ? "Registration sucessful" : "Unregistration done");
533 if (lc->vtable.display_status){
534 if (cfg->registered) msg=ms_strdup_printf(_("Registration on %s successful."),sal_op_get_proxy(op));
535 else msg=ms_strdup_printf(_("Unregistration on %s done."),sal_op_get_proxy(op));
536 lc->vtable.display_status(lc,msg);
542 static void register_failure(SalOp *op, SalError error, SalReason reason, const char *details){
543 LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(op));
544 LinphoneProxyConfig *cfg=(LinphoneProxyConfig*)sal_op_get_user_pointer(op);
547 ms_warning("Registration failed for unknown proxy config.");
551 details=_("no response timeout");
553 if (lc->vtable.display_status) {
554 char *msg=ortp_strdup_printf(_("Registration on %s failed: %s"),sal_op_get_proxy(op),details );
555 lc->vtable.display_status(lc,msg);
558 if (error== SalErrorFailure && reason == SalReasonForbidden) {
559 linphone_proxy_config_set_error(cfg, LinphoneReasonBadCredentials);
560 } else if (error == SalErrorNoResponse) {
561 linphone_proxy_config_set_error(cfg, LinphoneReasonNoResponse);
563 linphone_proxy_config_set_state(cfg,LinphoneRegistrationFailed,details);
566 static void vfu_request(SalOp *op){
568 LinphoneCall *call=(LinphoneCall*)sal_op_get_user_pointer (op);
570 ms_warning("VFU request but no call !");
573 if (call->videostream)
574 video_stream_send_vfu(call->videostream);
578 static void dtmf_received(SalOp *op, char dtmf){
579 LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(op));
580 LinphoneCall *call=(LinphoneCall*)sal_op_get_user_pointer(op);
581 if (lc->vtable.dtmf_received != NULL)
582 lc->vtable.dtmf_received(lc, call, dtmf);
585 static void refer_received(Sal *sal, SalOp *op, const char *referto){
586 LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal);
587 LinphoneCall *call=(LinphoneCall*)sal_op_get_user_pointer(op);
589 if (call->refer_to!=NULL){
590 ms_free(call->refer_to);
592 call->refer_to=ms_strdup(referto);
593 call->refer_pending=TRUE;
594 linphone_call_set_state(call,LinphoneCallRefered,"Refered");
595 if (lc->vtable.display_status){
596 char *msg=ms_strdup_printf(_("We are transferred to %s"),referto);
597 lc->vtable.display_status(lc,msg);
600 if (call->state!=LinphoneCallPaused){
601 ms_message("Automatically pausing current call to accept transfer.");
602 linphone_core_pause_call(lc,call);
604 linphone_core_start_refered_call(lc,call);
605 sal_call_accept_refer(op);
606 }else if (lc->vtable.refer_received){
607 lc->vtable.refer_received(lc,referto);
608 sal_call_accept_refer(op);
612 static void text_received(Sal *sal, const char *from, const char *msg){
613 LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal);
614 linphone_core_text_received(lc,from,msg);
617 static void notify(SalOp *op, const char *from, const char *msg){
618 LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(op));
619 LinphoneCall *call=(LinphoneCall*)sal_op_get_user_pointer (op);
620 ms_message("get a %s notify from %s",msg,from);
621 if(lc->vtable.notify_recv)
622 lc->vtable.notify_recv(lc,call,from,msg);
625 static void notify_presence(SalOp *op, SalSubscribeState ss, SalPresenceStatus status, const char *msg){
626 LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(op));
627 linphone_notify_recv(lc,op,ss,status);
630 static void subscribe_received(SalOp *op, const char *from){
631 LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(op));
632 linphone_subscription_new(lc,op,from);
635 static void subscribe_closed(SalOp *op, const char *from){
636 LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(op));
637 linphone_subscription_closed(lc,op);
640 static void internal_message(Sal *sal, const char *msg){
641 LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal);
646 static void ping_reply(SalOp *op){
647 LinphoneCall *call=(LinphoneCall*) sal_op_get_user_pointer(op);
648 ms_message("ping reply !");
650 if (call->state==LinphoneCallOutgoingInit){
651 linphone_core_start_invite(call->core,call,NULL);
656 ms_warning("ping reply without call attached...");
660 SalCallbacks linphone_sal_callbacks={