mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
agent/examples: Fix examples
Change-Id: Idf54e78391eb77c7964c6650b6f70df71b8eac3a
This commit is contained in:
@ -19,7 +19,7 @@
|
||||
(success #f)
|
||||
(over #f))
|
||||
|
||||
(jami:on-signal 'call-state-changed
|
||||
(jami:on-signal 'state-changed
|
||||
(lambda (call-id state code)
|
||||
(with-mutex mtx
|
||||
(let ((ret (cond
|
||||
@ -52,12 +52,18 @@
|
||||
|
||||
(agent:ensure-account)
|
||||
|
||||
(while #t
|
||||
(begin
|
||||
(make-a-call agent:account-id "bcebc2f134fc15eb06c64366c1882de2e0f1e54f")
|
||||
(jami:info "Disabling account")
|
||||
(account:send-register agent:account-id #f)
|
||||
(sleep 30)
|
||||
(jami:info "Enabling account")
|
||||
(account:send-register agent:account-id #t)
|
||||
(sleep 30)))
|
||||
(let ((account (fluid-ref agent:account-id))
|
||||
(peer "FIXME"))
|
||||
|
||||
(when (string= peer "FIXME")
|
||||
(throw 'bad-peer
|
||||
"Peer was not set! Please set variable `peer` to a valid Jami's ID"))
|
||||
(while #t
|
||||
(begin
|
||||
(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 @@
|
||||
|
||||
(agent:ensure-account)
|
||||
|
||||
(jami:on-signal 'incomming-call
|
||||
(lambda (account-id call-id peer-display-name media-list)
|
||||
(when (string= account-id agent:account-id)
|
||||
(jami:info
|
||||
"Incoming [call:~a] from peer ~a~%"
|
||||
call-id peer-display-name)
|
||||
(call:accept call-id media-list))
|
||||
#t))
|
||||
(jami:info "Agent peer-id: ~a" (fluid-ref agent:peer-id))
|
||||
|
||||
(let ((account (fluid-ref agent:account-id)))
|
||||
(jami:on-signal 'incoming-call/media
|
||||
(lambda (account-id call-id peer media-lst)
|
||||
(when (string= account-id account)
|
||||
(jami:info "Incoming [call:~a] from peer ~a~%" call-id peer)
|
||||
(call:accept call-id media-lst))
|
||||
#t)))
|
||||
(while #t (pause))
|
||||
|
Reference in New Issue
Block a user