[Freeswitch-users] Freeswitch as Registrar for SIP Trunk

Jai Rangi jprangi at gmail.com
Tue Feb 2 23:47:50 MSK 2016


We used LUA script to deal with registered asterisk systems.
Example DID 888 555 6666 is assigned to user 101, registered on some ip say
8.8.8.8
Contact will look like
s at 8.8.8.8
or
101 at 8.8.8.8.8

LUA Code
DIALED_NUMBER=8885556666
USER = 111
location = api:execute("sofia_contact", USER) or ""
destinationlocation=location:gsub("sip:(.-)@","sip:"..DIALED_NUMBER.."@")
-- This will replace user part in contact heard, (s or even username) with
the DID number.
-- destinationlocation will look like sip:8885556666 at 8.8.8.8

if (destinationlocation ~= "") then

session:execute("bridge","{sip_cid_type=rpid,loop=3}"..destinationlocation)

end

Hope this help.

*Jai Rangi*
Cebod Technologies LLC dba DIDforSale/Cebod Telecom
O 949-471-0102 <O%20949-471-0101> | C 949-419-7634 <C%20949-742-2666> | F
949-269-0449 / 949-232-1410 | jprangi at didforsale.com  www.cebod.com |
www.didforsale.com |3200 Bristol St Suite 615, Costa Mesa, CA 92626






On Tue, Feb 2, 2016 at 12:29 PM, Oz Mortimer <omortimer at gmail.com> wrote:

> I think you need to explain what you are trying to achieve..
> What you are doing currently is registering a user against freeswitch -
> not dissimilar to logging in to Skype.
> In your bridge statement you are calling the registered user - again like
> you would in Skype.
> Is there a reason you want asterisk to register against freeswitch? The
> only thing I can think of is that it's on a private LAN and that your
> asterisk box does something "special"..
>
>
> On 2 Feb 2016, at 19:28, Marc S <therebel22 at gmail.com> wrote:
>
> It seems that "freeswitch gateway username" return all results about setup
> username and password on FS to register against external SIP gateway, am i
> wrong ?
>
> 2016-02-02 20:23 GMT+01:00 Oz Mortimer <omortimer at gmail.com>:
>
>> Setup username / password authentication on asterisk and set the
>> corresponding user & pass in your freeswitch gateway.
>> I'm sure a google for "asterisk username authentication" and "freeswitch
>> gateway username" will give you plenty of examples - you will want
>> freeswitch to bridge to gateway - again Google "freeswitch bridge gateway".
>> Google is your friend..
>>
>>
>> On 2 Feb 2016, at 19:03, Marc S <therebel22 at gmail.com> wrote:
>>
>> I want to use mod xml curl to generate dynamic dialplan xml like this :
>>
>>  <extension name="inbound_12345678">
>>         <condition field="destination_number" expression="^(12345678)$">
>>            <action application="bridge" data="user/myuserid"/>
>>         </condition>
>> </extension>
>>
>> Thanks
>>
>>
>>
>> 2016-02-02 19:16 GMT+01:00 Sergey Safarov <s.safarov at gmail.com>:
>>
>>> What is way you planing to use for link DID with user?
>>>
>>> Sergey
>>>
>>> On Tue, Feb 2, 2016 at 8:20 PM, Marc S <therebel22 at gmail.com> wrote:
>>>
>>>> Hello,
>>>> sorry for asking again :
>>>>
>>>> I hav an asterisk that register on Freeswitch (as a user).
>>>>
>>>> When a call is incoming to FS, FS send it to asterisk : In asterisk, it
>>>> is the s extension.
>>>>
>>>> Here my bridge tests
>>>>
>>>> <action application="bridge" data="user/myuserid"/>
>>>>
>>>> => s extension in asterisk instead of extension
>>>>
>>>> <action application="bridge" data="sofia/mycontext/myextension@
>>>> <ASTERISK_IP>"/>
>>>>
>>>> => Not authenticated in asterisk (because no IP authentication in
>>>> asterisk)
>>>>
>>>> Have you an idea how to send real extension instead of s extension  ?
>>>> Thanks
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> 2016-01-03 10:45 GMT+01:00 Marc S <therebel22 at gmail.com>:
>>>>
>>>>> Hello,
>>>>>
>>>>> i'm discovering FS. I hav read a lot about users and gateways.
>>>>>
>>>>> I would like to  FS act as registrar for authenticated SIP trunking.
>>>>>
>>>>> - Customers IPBX would register with login/password to Freeswitch.
>>>>> - Incoming call would be routed to these SIP trunks in dialplan XML.
>>>>>
>>>>> directory/users does not seem to be the solution because in dialplan,
>>>>> destination DID can't be defined, only user id :
>>>>>
>>>>> <action application="bridge" data="user/myuserid"/>
>>>>>
>>>>> gateway seems to be designed for SIP trunking to remote SIP gateway,
>>>>> not for FS to act as registrar.
>>>>>
>>>>> Is it possible to FS to act as authenticated SIP trunking registrar ?
>>>>>
>>>>> Thanks a lot,
>>>>> Marc
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> _________________________________________________________________________
>>>> Professional FreeSWITCH Consulting Services:
>>>> consulting at freeswitch.org
>>>> http://www.freeswitchsolutions.com
>>>>
>>>> Official FreeSWITCH Sites
>>>> http://www.freeswitch.org
>>>> http://confluence.freeswitch.org
>>>> http://www.cluecon.com
>>>>
>>>> FreeSWITCH-users mailing list
>>>> FreeSWITCH-users at lists.freeswitch.org
>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>> UNSUBSCRIBE:
>>>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>> http://www.freeswitch.org
>>>>
>>>
>>>
>>> _________________________________________________________________________
>>> Professional FreeSWITCH Consulting Services:
>>> consulting at freeswitch.org
>>> http://www.freeswitchsolutions.com
>>>
>>> Official FreeSWITCH Sites
>>> http://www.freeswitch.org
>>> http://confluence.freeswitch.org
>>> http://www.cluecon.com
>>>
>>> FreeSWITCH-users mailing list
>>> FreeSWITCH-users at lists.freeswitch.org
>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>>> http://www.freeswitch.org
>>>
>>
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at freeswitch.org
>> http://www.freeswitchsolutions.com
>>
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://confluence.freeswitch.org
>> http://www.cluecon.com
>>
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>>
>>
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at freeswitch.org
>> http://www.freeswitchsolutions.com
>>
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://confluence.freeswitch.org
>> http://www.cluecon.com
>>
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20160202/e0fe63b0/attachment.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list