Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- freeswitch.consoleLog("info","lua outgoing")
- local Client = session:getVariable("Client")
- local Campaign = session:getVariable("Campaign")
- local CallTaskId = session:getVariable("CallTaskId")
- local CallingSystemCallUuid = session:getVariable("CallingSystemCallUuid")
- local CallTaskServiceHost = session:getVariable("CallTaskServiceHost")
- local CallTaskServicePort = session:getVariable("CallTaskServicePort")
- local callerNumber=session:getVariable("sip_to_user")
- local bridgeTo="sofia/gateway/sipservlet/outgoingSolution?taskId="..CallTaskId.."&callUuid="..CallingSystemCallUuid.."&callTaskServiceHost="..CallTaskServiceHost.."&callTaskServicePort="..CallTaskServicePort
- freeswitch.consoleLog("info","bridging to ss: "..bridgeTo)
- local sipServletSession = freeswitch.Session(bridgeTo)
- freeswitch.bridge(session,sipServletSession)
- -- origination_caller_id_name=${destination_number},origination_caller_id_number=TO
- -- local bridgeParams="{sip_h_X-IVOICE_SCENARIO=ivoice_to,sip_cid_type=rpid,origination_caller_id_name=TO,origination_caller_id_number="..callerNumber.."}"
- local bridgeParams="{sip_h_X-IVOICE_SCENARIO=ivoice_to,sip_cid_type=rpid,origination_caller_id_name="..callerNumber..",origination_caller_id_number=TO}"
- local bridgeAfterIvr=sipServletSession:getVariable("sip_bye_h_X-Ivoice-BridgeDestination")
- if bridgeAfterIvr == nil then
- freeswitch.consoleLog("INFO","bridgeAfterIvr is nil, hangup")
- session:hangup()
- else
- freeswitch.consoleLog("INFO","bridgeAfterIvr not nil, bridging to " .. bridgeAfterIvr)
- local bridgeAfterIvrSession = freeswitch.Session(bridgeParams..bridgeAfterIvr)
- freeswitch.bridge(session, bridgeAfterIvrSession)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement