tSIP softphone: SIP call origination
With some Lua scripting tSIP softphone can be used to originate calls from PC via PBX using desk VoIP or even analog phone for talking. Here is how it works:
- softphone should be registered to the same PBX as desk phone
- user dials number using softphone
- Lua "on making call" script is replacing number dialed by the user with desk phone number and stores number dialed by the user as variable
- user picks up desk phone
- after call is connected "on call state" script is reading back variable holding number dialed by the user and transfers call to it
Lua scripts
Prepare two Lua files, place them in \scripts subdirectory and add them to tSIP configuration:
on_make_call.lua
desk_phone_number = "401" -- replace with number assigned to your desk phone -- end of user configuration target = GetInitialCallTarget() SetVariable("originate_target", target) SetInitialCallTarget(desk_phone_number)
on_call_connected_transfer.lua
call_state = GetCallState() call_incoming = IsCallIncoming() if call_incoming == 0 and call_state == 6 then -- outgoing call, CALL_STATE_ESTABLISHED local originate_target, var_isset = GetVariable("originate_target") if (var_isset ~= 0) then print(string.format("Lua originate: blind transfer to %s\n", originate_target)) BlindTransfer(originate_target) end end
Forcing auto-answer
Version 0.1.61 adds feature of inserting custom header lines into outgoing INVITEs. This allows to reduce number of steps needed from operator (especially if headphone is used) as initial call from softphone to desk phone can be answered automatically with these lines added:
Alert-Info: answer-after=0 Call-Info: answer-after=0
Note: refer to desk phone manual if these lines do not take effect - exact form varies between manufacturers.
Back to tSIP softphone