Function sofia contact

From FreeSWITCH Wiki
Jump to: navigation, search

Sofia_contact is a function that returns the contact string of a sofia user. If it's not registered, the contact string is "error/user_not_registered".

sofia_contact [profile]/[user](@domain)

Profile may be * for all. @domain is not required if the specified profile doesn't have overlapping users.

You can use this function to trigger, for example, a specific message if the user is not registered or you could fire up some actions to find that user on another switch in a clustered environment.

sofia_contact profile/user@domain


sofia_contact internal/

Additional Examples:

^222 is equivalent to from a request uri to somewhere different:

<action application="bridge" data="${sofia_contact(internal/100@sys.local)}^222" />
<action application="bridge" data="{sip_route_uri=222}${sofia_contact(internal/100@sys.local)}" /> 

or, if you want to change the sip from user:

<action application="bridge" data="{sip_from_user=222}${sofia_contact(internal/100@sys.local)}" />