Follow me with diversion

Status
Not open for further replies.

Gofaizen

New Member
Aug 5, 2020
13
0
1
51
Hello...

I need to make Diversion in Follow Me application - scripts/app/fllow_me/index.lua with correct origination_callee_id_name and origination_callee_id_number like call-forward-all in 'Dialplan Manager'.
So origination_callee_id_name must be equal outbound_caller_id_name of extension with 'Follow Me' enabled and origination_callee_id_number must be equal outbound_caller_id_number of extension with 'Follow Me' enabled. And I need to set Diversion in SIP header - sip_h_Diversion=<sip:${caller_destination}@${external_sip_ip}:5060>;reason=unconditional.

follow_me app makes new call to destination in 'Applications -> Follow Me -> Destinations' :

bridge({toll_allow=,accountcode=domain.com,origination_caller_id_name='INBOUND_NUMBER',origination_caller_id_number=INBOUND_NUMBER,sip_invite_domain=domain.com,domain_uuid=d28fd821-d412-49a8-a18c-fe1548b42749,call_direction=inbound,confirm=false,originate_timeout=30,originate_delay_start=0}loopback/FIRST_FOLLOW_ME_NUMBER:_:{sip_invite_domain=office.voip,call_direction=inbound,confirm=false,originate_timeout=30,originate_delay_start=30000,dialed_extension=EXT,extension_uuid=3e4a2c40-a23a-4e61-abe9-90e8fe9f1d6a}user/EXT@office.voip)

If I correctly understand this bridge makes new call from FusionPBX with number CallerID=INBOUND_NUMBER and CalledID=FIRST_FOLLOW_ME_NUMBER without Diversion.

To make Diversion work I need correct origination_callee_id_name and origination_callee_id_number in app_data and set SIP header Diversion - <sip:${caller_destination}@${external_sip_ip}:5060>;reason=unconditional.
Am I right ?
 

Gofaizen

New Member
Aug 5, 2020
13
0
1
51
Hello...

I haved solved my problem with diversion in follow me.
I haved added to bridge - sip_h_Diversion=<sip:${caller_destination}@${external_sip_ip}:5060>;reason=unconditional
Here is my modifications in follow_me/index.lua :

--get the variables
origination_callee_id_name = session:getVariable("origination_callee_id_name");
origination_callee_id_number = session:getVariable("origination_callee_id_number");

--set the caller id
diversion = '';
diversion = diversion.."sip_h_Diversion=<sip:"..origination_callee_id_number.."@EXTERNAL_IP:pORT>;reason=unconditional";

--set the destination dial string
dial_string = "[toll_allow=".. toll_allow ..",accountcode="..accountcode..",".. caller_id ..","..callee_id..","..diversion..",sip_invite_domain="..domain_name..",domain_uuid="..domain_uuid..",call_direction="..call_direction..","..group_confirm..","..timeout_name.."="..destination_timeout..","..delay_name.."="..destination_delay.."]"..route_bridge

In <sip:"..origination_callee_id_number.."@EXTERNAL_IP:pORT>;reason=unconditional" - reason can be variuos.
origination_callee_id_number - important thing.

This modification works with SIP gateways.
 
Status
Not open for further replies.