Saturday, January 21, 2017

Asterisk (localnet/exteraddr) -> Freeswitch

Just to remember one option.
Bu default, when Asterisk working behind NAT and parameters like localnet and externaddr are set properly, it automatically uses internal address in SIP/SDP messages for internal connections and external for external.
Freeswitch can do same, but needed a bit more option to use.
Profile settings
<param name="ext-sip-ip" value="autonat:$${external_sip_ip}"/>
<param name="ext-rtp-ip" value="autonat:$${external_rtp_ip}"/>
<param name="local-network-acl" value=""/>
Point on autonat: prefix. Yes, I know it described in wiki, but never the less. Without it, FreeSwitch will use ext-rtp-ip address in all messages regardless are they internal or external.

Tuesday, January 17, 2017

FusionPBX parking based on mod_fifo

Got an interesting task recently. To make parking slots on FusionPBX like asterisk parking. With BLF support, but without work "park+<slot>", like mod_valet_parking wants to.
Actually, googling shows this solution.

I've just modified it a bit to fit Fusion logic + make BLF more stable.
Here I use *771 is single slot parking extension.
<extension name="ParkExtension771">
   <condition field="destination_number" expression="^\*771$" break="on-false">
    <action inline="true" application="set" data="presence_id=${destination_number}@${domain_name}"/>
     <action inline="true" application="set" data="slot_count=${fifo(count ${destination_number}@${domain_name})}"/>
     <action inline="true" application="set" data="slot_count=${slot_count:-9:2}"/>
   <condition field="${slot_count}" expression="^\:0|no$" break="always">
     <action application="unset" data="fifo_chime_list"/>
     <action application="set" data="fifo_chime_freq=0"/>
     <action application="fifo" data="${destination_number}@${domain_name} in undef ${hold_music}"/>
     <anti-action application="fifo" data="${destination_number}@${domain_name} out nowait"/>

Actually, almost same with Confluence solution, but need add presence_id variable set and make in inline (without inline BLF is not working on transfer calls, only on direct calls)
Also add additional condition to slot_count. It's for initialize fifo slot on first time.
So, just set your BLF key to *771 (in this case) and this is your parking slot number. When it's red - you have line on it.
"Your wife is on line 2", like in old US police TV-series :)