- FreeSWITCH 1.8
- Anthony Minessale II Giovanni Maruzzelli
- 173字
- 2025-04-04 18:52:56
SIP (sofia)
The basic Sofia dialstring takes two different formats, depending on wheter we use a gateway or not:
- sofia/<profile name>/<user@domain>
- sofia/gateway/<gateway name>/<user>
As we learned in Chapter 4, User Directory, SIP, and Verto, we can dial another SIP Endpoint, either with or without a gateway. When using Sofia to dial through a FreeSWITCH SIP profile, it is necessary to specify both the user and domain. However, when dialing through a gateway it is not possible to include the domain because this is already defined in the gateway configuration. Therefore, the following is not allowed:
<!-- Wrong --> <action application="bridge" data="sofia/gateway/my_gateway/user@1.2.3.4"/>
The correct syntax is as follows:
<!-- Correct --> <action application="bridge" data="sofia/gateway/my_gateway/user">
The equivalent for dialing through the internal profile would look like
the following:
<!--Also correct --> <action application="bridge" data="sofia/internal/user@1.2.3.4 /">
When dialing a user who is registered on your FreeSWITCH server there is a shortcut available:
user/<user id>[@domain]
This syntax makes it very easy to dial another phone registered on your system. In fact, Local_Extension in conf/dialplan/default.xml uses this method to connect calls to registered users:
<action application="bridge" data="user/${dialed_extension}@{domain_name}"/>
The @domain parameter is optional if you have only one domain defined on your FreeSWITCH server.