Click-to-call for multiple SIP clients with a single number
[from-crm-click2call-example]
exten => _X.,1,NoOp(CRM Click2Call to ${EXTEN})
; call to all devices of the operator (the number is taken from Local/XXX@...)
same => n,Set(CONTACTS=${PJSIP_DIAL_CONTACTS(${CUT(CUT(CHANNEL,/,2),@,1)})})
same => n,GotoIf($["${CONTACTS}"=""]?no_contacts)
same => n,Dial(${CONTACTS},30,g)
; ===== the operator answered =====
same => n,Set(OPERATOR=${BRIDGEPEER(pjsip,endpoint)})
same => n,NoOp(Answered by operator ${OPERATOR})
; CallerID
same => n,Set(CALLERID(num)=${OPERATOR})
same => n,Set(CALLERID(name)=CRM-Call)
; Calling the client
same => n,Dial(Local/${EXTEN}@from-internal,60)
same => n,Hangup()
exten => _X.,n(no_contacts)
same => n,NoOp(No operator available)
same => n,Hangup()

Last updated