Files
jami-daemon/test/agent/examples/passive-agent.scm
Olivier Dion d66edafb7d agent/agent: Use parameter instead of fluid
Change-Id: I365b4346d123b0cc8c71a17e62e25bae37e5fc49
2021-11-12 11:20:19 -05:00

23 lines
773 B
Scheme

;;; This is an example of a passive agent.
;;;
;;; The passive agent ensure that an account is created and then wait for
;;; incomming call of any peer.
(use-modules ((agent) #:prefix agent:)
((jami signal) #:prefix jami:)
((jami call) #:prefix call:)
((jami logger) #:prefix jami:))
(agent:ensure-account)
(jami:info "Agent peer-id: ~a" (agent:peer-id))
(let ((account (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))