Skip to content
Snippets Groups Projects
Commit 562f8c8a authored by Olivier Dion's avatar Olivier Dion
Browse files

agent/examples: Fix examples

Change-Id: Idf54e78391eb77c7964c6650b6f70df71b8eac3a
parent 914a8ec5
No related branches found
No related tags found
No related merge requests found
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
(success #f) (success #f)
(over #f)) (over #f))
(jami:on-signal 'call-state-changed (jami:on-signal 'state-changed
(lambda (call-id state code) (lambda (call-id state code)
(with-mutex mtx (with-mutex mtx
(let ((ret (cond (let ((ret (cond
...@@ -52,12 +52,18 @@ ...@@ -52,12 +52,18 @@
(agent:ensure-account) (agent:ensure-account)
(while #t (let ((account (fluid-ref agent:account-id))
(begin (peer "FIXME"))
(make-a-call agent:account-id "bcebc2f134fc15eb06c64366c1882de2e0f1e54f")
(jami:info "Disabling account") (when (string= peer "FIXME")
(account:send-register agent:account-id #f) (throw 'bad-peer
(sleep 30) "Peer was not set! Please set variable `peer` to a valid Jami's ID"))
(jami:info "Enabling account") (while #t
(account:send-register agent:account-id #t) (begin
(sleep 30))) (make-a-call account peer)
(jami:info "Disabling account")
(account:send-register account #f)
(sleep 30)
(jami:info "Enabling account")
(account:send-register account #t)
(sleep 30))))
...@@ -10,11 +10,13 @@ ...@@ -10,11 +10,13 @@
(agent:ensure-account) (agent:ensure-account)
(jami:on-signal 'incomming-call (jami:info "Agent peer-id: ~a" (fluid-ref agent:peer-id))
(lambda (account-id call-id peer-display-name media-list)
(when (string= account-id agent:account-id) (let ((account (fluid-ref agent:account-id)))
(jami:info (jami:on-signal 'incoming-call/media
"Incoming [call:~a] from peer ~a~%" (lambda (account-id call-id peer media-lst)
call-id peer-display-name) (when (string= account-id account)
(call:accept call-id media-list)) (jami:info "Incoming [call:~a] from peer ~a~%" call-id peer)
#t)) (call:accept call-id media-lst))
#t)))
(while #t (pause))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment