FreeSWITCH 1.8
上QQ阅读APP看书,第一时间看更新

Caller profile Variables

Some variables we always find in a call (we also say those variables are part of the "caller profile"):

  • username
  • dialplan
  • caller_id_name
  • caller_id_number
  • callee_id_name
  • callee_id_number
  • network_addr
  • ani
  • aniii
  • rdnis
  • destination_number
  • source
  • uuid
  • context

Some of the variables' names in the caller profile may be obscure to you right now, but you'll find plenty of information later in this book, and in all the online documentation (we developers too we check the online docs, we do not memorize all and every variables, they're hundreds ;) ).

What's specific about the caller profile variables' is that you use them in the "field" of a "condition" by their plain names, without special syntax.
Why we specify that? Because variables in FreeSWITCH are indicated with the special syntaxes ${varname} or $${othervarname} (we'll see later the difference between the two syntaxes).
So, as a bonus for your fingers, you can save some typing and have a more pleasant and readable dialplan when you use caller profile variables in the condition's field:

<extension name="Local_Extension_Skinny">

<condition field="destination_number" expression="^(11[01][0-9])$">

<action application="bridge" data="skinny/internal/${destination_number}"/>

</condition>

</extension>

As you can see we wrote "destination_number" in the condition's field, while we had to type it entirely as "${destination_number}" when used elsewhere (here, in an action executed if the condition is matched).

All caller profile variables are read only (that is, you cannot change them) and are assigned automatically at the beginning of the call. They describe the call itself.