M
M
Maxim Chornopolsky2016-06-27 09:10:43
FreeSWITCH
Maxim Chornopolsky, 2016-06-27 09:10:43

How to make calls to text extensions of the user type in freeswitch?

Hello.
It is required to authorize users by text accounts of the "uservasya" type.
After that, you need to call them and from them.
Calls from them pass without problems. What is displayed in callerid is what is specified as effective_caller_id_number. But you can't call them.
I tried two options:

<user id="user">
    <params>
      <param name="password" value="$${default_password}"/>
      <param name="vm-password" value="1011"/>
    </params>
    <variables>
      <variable name="toll_allow" value="domestic,international,local"/>
      <variable name="accountcode" value="1011"/>
      <variable name="user_context" value="default"/>
      <variable name="effective_caller_id_name" value="Extension 1011"/>
      <variable name="effective_caller_id_number" value="1011"/>
      <variable name="outbound_caller_id_name" value="$${outbound_caller_name}"/>
      <variable name="outbound_caller_id_number" value="$${outbound_caller_id}"/>
      <variable name="callgroup" value="techsupport"/>
    </variables>
  </user>

and
<include>
  <user id="user">
    <params>
      <param name="password" value="$${default_password}"/>
      <param name="vm-password" value="user"/>
    </params>
    <variables>
      <variable name="toll_allow" value="domestic,international,local"/>
      <variable name="accountcode" value="user"/>
      <variable name="user_context" value="default"/>
      <variable name="effective_caller_id_name" value="Extension user"/>
      <variable name="effective_caller_id_number" value="user"/>
      <variable name="outbound_caller_id_name" value="$${outbound_caller_name}"/>
      <variable name="outbound_caller_id_number" value="$${outbound_caller_id}"/>
      <variable name="callgroup" value="techsupport"/>
    </variables>
  </user>
</include>

For the second option, I added the following to the dialplan:
<extension name="Local_Extension_2">
      <condition field="destination_number" expression="^(\w)$">
  <action application="export" data="dialed_extension=$1"/>
  <!-- bind_meta_app can have these args <key> [a|b|ab] [a|b|o|s] <app> -->
  <action application="bind_meta_app" data="1 b s execute_extension::dx XML features"/>
  <action application="bind_meta_app" data="2 b s record_session::$${recordings_dir}/${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>
  <action application="bind_meta_app" data="3 b s execute_extension::cf XML features"/>
  <action application="bind_meta_app" data="4 b s execute_extension::att_xfer XML features"/>
  <action application="set" data="ringback=${us-ring}"/>
  <action application="set" data="transfer_ringback=$${hold_music}"/>
  <action application="set" data="call_timeout=30"/>
  <!-- <action application="set" data="sip_exclude_contact=${network_addr}"/> -->
  <action application="set" data="hangup_after_bridge=true"/>
  <!--<action application="set" data="continue_on_fail=NORMAL_TEMPORARY_FAILURE,USER_BUSY,NO_ANSWER,TIMEOUT,NO_ROUTE_DESTINATION"/> -->
  <action application="set" data="continue_on_fail=true"/>
  <action application="hash" data="insert/${domain_name}-call_return/${dialed_extension}/${caller_id_number}"/>
  <action application="hash" data="insert/${domain_name}-last_dial_ext/${dialed_extension}/${uuid}"/>
  <action application="set" data="called_party_callgroup=${user_data(${dialed_extension}@${domain_name} var callgroup)}"/>
  <action application="hash" data="insert/${domain_name}-last_dial_ext/${called_party_callgroup}/${uuid}"/>
  <action application="hash" data="insert/${domain_name}-last_dial_ext/global/${uuid}"/>
  <!--<action application="export" data="nolocal:rtp_secure_media=${user_data(${dialed_extension}@${domain_name} var rtp_secure_media)}"/>-->
  <action application="hash" data="insert/${domain_name}-last_dial/${called_party_callgroup}/${uuid}"/>
  <action application="bridge" data="user/${dialed_extension}@${domain_name}"/>
  <action application="answer"/>
  <action application="sleep" data="1000"/>
  <action application="bridge" data="loopback/app=voicemail:default ${domain_name} ${dialed_extension}"/>
      </condition>

Calls, unfortunately, do not go through. Neither on user, nor on 1011.
Tell me how to do this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir, 2016-06-27
@Voiddancer

vm-password has nothing to do with calls at all
accountcode, effective_caller_id_name and effective_caller_id_name are only relevant for outgoing calls
as a result your options in terms of incoming are absolutely identical
and smoke logs

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question