Multiple DIDs per SIP trunk (how to configure?)
Hi, everybody This is a newbie question: Suppose I have XX (variable dynamic number) DIDs assigned to one sip trunk (from VOIP provider ABC ). All calls coming from VOIP provider ABC MUST be routed to the same lua/js/whatever script. Is it possible in FS? If yes, how everything should be configuered? Dialplan, sip gateway? One more question: suppose it is doeable as I hope then how can I get in my script CalleeID (not a CallerID)? Basicaly, I want to acomplish the following: 1. Avoid re-configuring FS every time I got new bunch of DIDs assigned/released from/to my Voip provider. 2. Have a way of extracting CalleeID in my script. TIA, Vladimir Rodionov
mod_easyroute? 2009/8/6 Vladimir Rodionov <vladrodionov@gmail.com>
Hi, everybody
This is a newbie question: Suppose I have XX (variable dynamic number) DIDs assigned to one sip trunk (from VOIP provider ABC ). All calls coming from VOIP provider ABC MUST be routed to the same lua/js/whatever script. Is it possible in FS? If yes, how everything should be configuered? Dialplan, sip gateway? One more question: suppose it is doeable as I hope then how can I get in my script CalleeID (not a CallerID)? Basicaly,
I want to acomplish the following:
1. Avoid re-configuring FS every time I got new bunch of DIDs assigned/released from/to my Voip provider. 2. Have a way of extracting CalleeID in my script.
TIA,
Vladimir Rodionov
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
No, it is more like static routing. I need my *script program* be invoked when somebody dial in. That is it. One script for all inbound DIDs. Suppose I have thousand of them. I think I know how to accomplish this but I am not sure yet. in my dialplan I need to define: <!-- Launch a JavaScript application if dialed in--> <extension name="ProviderABC"> <condition field="source" expression="mod_sofia"/> *<condition field="destination_number" expression="^1NXXNXXXXXX$">* <action application="javascript" data="/usr/local/freeswitch/scripts/myapp.js"/> </condition> </extension> In provider configuration: <gateway name="voicepulse"> <!--/// account username *required* ///--> <param name="username" value="your-username"/> <!--/// auth realm: *optional* same as gateway name, if blank ///--> <param name="realm" value="nyc.voicepulse.com"/> <!--/// account password *required* ///--> <param name="password" value="your-password"/> <!--/// extension for inbound calls: *optional* same as username, if blank ///--> * * *<param name="extension" value="1NXXNXXXXXX"/> * <!--/// proxy host: *optional* same as realm, if blank ///--> <param name="proxy" value="nyc.voicepulse.com"/> <!--/// expire in seconds: *optional* 3600, if blank ///--> <param name="expire-seconds" value="600"/> <param name="register" value="true"/> </gateway> Something like this, yes? I can use regular expressions in destination_number? Q: There is object Session in JavaScript, Lua. Is Session.destination == destination_number from incoming call? It is not clear for me from what I have read so far. TIA, -Vladimir Rodionov On Wed, Aug 5, 2009 at 6:26 PM, Seven Du <dujinfang@gmail.com> wrote:
mod_easyroute?
2009/8/6 Vladimir Rodionov <vladrodionov@gmail.com>
Hi, everybody
This is a newbie question: Suppose I have XX (variable dynamic number) DIDs assigned to one sip trunk (from VOIP provider ABC ). All calls coming from VOIP provider ABC MUST be routed to the same lua/js/whatever script. Is it possible in FS? If yes, how everything should be configuered? Dialplan, sip gateway? One more question: suppose it is doeable as I hope then how can I get in my script CalleeID (not a CallerID)? Basicaly,
I want to acomplish the following:
1. Avoid re-configuring FS every time I got new bunch of DIDs assigned/released from/to my Voip provider. 2. Have a way of extracting CalleeID in my script.
TIA,
Vladimir Rodionov
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
On Wed, Aug 5, 2009 at 8:57 PM, Vladimir Rodionov <vladrodionov@gmail.com>wrote:
No, it is more like static routing. I need my *script program* be invoked when somebody dial in. That is it. One script for all inbound DIDs. Suppose I have thousand of them. I think I know how to accomplish this but I am not sure yet.
Have the external profile be used only for provider ABC, or define a new profile. Then in the profile have the calls go to a specific context. You could have something like this in the sip profile definition: <param name="context" value="abc_calls"/> Then create a dialplan context called "abc_calls" that handles all inbound calls. Create a file in conf/dialplan/ called abc_calls.xml: <include> <context name="abc_calls"> <extension name="abc_calls"> <condition field="destination_number" expression="^(.*)$"> <action application="lua" data="myscript.lua"/> </condition> </extension> </context> </include> Essentially you're just creating a SIP profile and a dialplan context that are servicing your VoIP provider. You can add other profiles/contexts for other providers if need be. Let us know how it goes... -MC
Thanks, I will give it it a try and let you know. On Wed, Aug 5, 2009 at 8:40 PM, Michael Collins <msc@freeswitch.org> wrote:
On Wed, Aug 5, 2009 at 8:57 PM, Vladimir Rodionov <vladrodionov@gmail.com>wrote:
No, it is more like static routing. I need my *script program* be invoked when somebody dial in. That is it. One script for all inbound DIDs. Suppose I have thousand of them. I think I know how to accomplish this but I am not sure yet.
Have the external profile be used only for provider ABC, or define a new profile. Then in the profile have the calls go to a specific context. You could have something like this in the sip profile definition:
<param name="context" value="abc_calls"/>
Then create a dialplan context called "abc_calls" that handles all inbound calls. Create a file in conf/dialplan/ called abc_calls.xml:
<include> <context name="abc_calls"> <extension name="abc_calls"> <condition field="destination_number" expression="^(.*)$"> <action application="lua" data="myscript.lua"/> </condition> </extension> </context> </include>
Essentially you're just creating a SIP profile and a dialplan context that are servicing your VoIP provider. You can add other profiles/contexts for other providers if need be.
Let us know how it goes... -MC
_______________________________________________ FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (3)
-
Michael Collins
-
Seven Du
-
Vladimir Rodionov