Advertisement
Bobrovozka

Untitled

Aug 10th, 2021
1,124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.66 KB | None | 0 0
  1. freeswitch.consoleLog("info","lua outgoing")
  2.  
  3. local Client = session:getVariable("Client")
  4. local Campaign = session:getVariable("Campaign")
  5. local CallTaskId = session:getVariable("CallTaskId")
  6. local CallingSystemCallUuid = session:getVariable("CallingSystemCallUuid")
  7.  
  8. local CallTaskServiceHost = session:getVariable("CallTaskServiceHost")
  9. local CallTaskServicePort = session:getVariable("CallTaskServicePort")
  10.  
  11. local callerNumber=session:getVariable("sip_to_user")
  12.  
  13.  
  14. local bridgeTo="sofia/gateway/sipservlet/outgoingSolution?taskId="..CallTaskId.."&callUuid="..CallingSystemCallUuid.."&callTaskServiceHost="..CallTaskServiceHost.."&callTaskServicePort="..CallTaskServicePort
  15. freeswitch.consoleLog("info","bridging to ss: "..bridgeTo)
  16. local sipServletSession = freeswitch.Session(bridgeTo)
  17. freeswitch.bridge(session,sipServletSession)
  18.  
  19. -- origination_caller_id_name=${destination_number},origination_caller_id_number=TO
  20. -- local bridgeParams="{sip_h_X-IVOICE_SCENARIO=ivoice_to,sip_cid_type=rpid,origination_caller_id_name=TO,origination_caller_id_number="..callerNumber.."}"
  21. local bridgeParams="{sip_h_X-IVOICE_SCENARIO=ivoice_to,sip_cid_type=rpid,origination_caller_id_name="..callerNumber..",origination_caller_id_number=TO}"
  22. local bridgeAfterIvr=sipServletSession:getVariable("sip_bye_h_X-Ivoice-BridgeDestination")
  23.  
  24. if bridgeAfterIvr == nil then
  25.    freeswitch.consoleLog("INFO","bridgeAfterIvr is nil, hangup")
  26.    session:hangup()
  27. else
  28.    freeswitch.consoleLog("INFO","bridgeAfterIvr not nil, bridging to " .. bridgeAfterIvr)
  29.    local bridgeAfterIvrSession = freeswitch.Session(bridgeParams..bridgeAfterIvr)
  30.    freeswitch.bridge(session, bridgeAfterIvrSession)
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement