Virtual hotline service: almost ready

The PBX configuration is finished, with all the call routing as desired.

The SMS gateway service is ordered from  iNetWorx.

Few quirks in FreeSWITCH that I had to go around:

The channel variables are not automatically propagated through a loopback endpoint. So, if I want to display the correct Caller ID in call forwarding, I need to export the corresponding variable in A-leg. In the public profile for the incoming extension, I need to set

<action application="export" data="outbound_caller_id_number=${ani}"/>

Then, in the PSTN outgoing extension, my provider needs a custom SIP header “X-Number” to point to the caller ID:

<condition field="destination_number" expression="^([01]\d+)$">
      <action application="set" data="sip_h_X-Number=${outbound_caller_id_number}"/>

Then I can create a user which forwards calls to my mobile:

  <user id="7011">
    <params>
      <param name="dial-string" value="loopback/0794070224/default"/>
    </params>
  </user>

It is important to put the context name in the loopback statement. Otherwise, if a call is transferred from another context, FreeSWITCH tries to find the matching pattern in the current context where the transfer is originated.

Another trick which took awhile: I need the voicemail to send emails with a specific From address, and by default it uses <CallerID>@domain as From address. The ticketing system will then try to send a confirmation to the sender.  The thing is, in FreeSWITCH, mod_voicemail has three different places where From address is defined. Two of them are actually documented: “vm-mailfrom” user parameter and “email-from” voicemail profile parameter. The third one is not documented, and it actually takes the higherst priority: in default email template, “voicemail.tpl“, the From line is explicitly defined. And it needs to look through the mod_voicemail sources in order to realize that.

Also the email template allows to set custom email headers, so I inject the customer ID in “X-Hotline-Cust-Id:”, and then the ticketing system moves the new ticket into the corresponding queue.

Advertisements

, , , ,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: