Selecting a particular outgoing gateway ?
I have configured two providers in sip_profiles/external/example.xml as follows: <include> <gateway name="voicepulse"> <param name="username" value="09515130"/> <param name="realm" value="sip.faktortel.com.au"/> <param name="password" value="xxxx"/> <param name="expire-seconds" value="600"/> <param name="register" value="true"/> <param name="extension" value="1000"/> </gateway> <gateway name="voicepulse_pt"> <param name="username" value="8889200745"/> <param name="realm" value="sip.pennytel.com"/> <param name="password" value="xxxx"/> <param name="expire-seconds" value="600"/> <param name="register" value="true"/> <param name="extension" value="1000"/> </gateway> </include> I have put this in dialplan/defaul.xml to dial out. Regexp matches the first extension if it's a mobile. I want it to route to Pennytelm. voicepulse_pt. <extension name="Long Distance - voicepulse pt"> <condition field="destination_number" expression="^(04\d+)$"> <action application="set" data="effective_caller_id_number=11111111111"/> <!-- If your provider does not provide ringback (180 or 183) you may simulate ringback by uncommenting the following line. --> <!-- action application="ringback" /--> <action application="bridge" data="sofia/gateway/voicepulse_pt/ $1"/> </condition> </extension> <extension name="Long Distance - voicepulse"> <condition field="destination_number" expression="^(\d{4,10})$"> <action application="set" data="effective_caller_id_number=99999999999"/> <!-- If your provider does not provide ringback (180 or 183) you may simulate ringback by uncommenting the following line. --> <!-- action application="ringback" /--> <action application="bridge" data="sofia/gateway/voicepulse/$1"/> </condition> </extension> Is this how I should be doing this ? I want to specify a different gateway for a different rexep. Please give me some idea what path I should take. David
Sure, you can simply set your regexp in your dialplan. Your example routes numbers starting with 04 to voicepulse_pt 4 or 10 digit numbers go to voicepulse. Now, why you named your gateways voicepulse when neither are using voicepulse, I'll let you ponder. :) If your needs are more complex and/or you have many routes, look into using mod_lcr. I have routes loaded from 2 providers in my tables (teliax and vitelity). phone=> select count(*) from lcr; count ------- 15425 (1 row) Queries against this datbase (postgresql 8.3, using prefix module on a lower end box in the middle of a rsync backup) for lcr info are on the order of 5 milliseconds. http://wiki.freeswitch.org/wiki/Mod_lcr On Sat, Apr 11, 2009 at 11:55 PM, David Robinson <pawzlion@gmail.com> wrote:
I have configured two providers in sip_profiles/external/example.xml as follows:
<include> <gateway name="voicepulse"> <param name="username" value="09515130"/> <param name="realm" value="sip.faktortel.com.au"/> <param name="password" value="xxxx"/> <param name="expire-seconds" value="600"/> <param name="register" value="true"/> <param name="extension" value="1000"/> </gateway>
<gateway name="voicepulse_pt"> <param name="username" value="8889200745"/> <param name="realm" value="sip.pennytel.com"/> <param name="password" value="xxxx"/> <param name="expire-seconds" value="600"/> <param name="register" value="true"/> <param name="extension" value="1000"/> </gateway> </include>
I have put this in dialplan/defaul.xml to dial out. Regexp matches the first extension if it's a mobile. I want it to route to Pennytelm. voicepulse_pt.
<extension name="Long Distance - voicepulse pt"> <condition field="destination_number" expression="^(04\d+)$"> <action application="set" data="effective_caller_id_number=11111111111"/> <!-- If your provider does not provide ringback (180 or 183) you may simulate ringback by uncommenting the following line. --> <!-- action application="ringback" /--> <action application="bridge" data="sofia/gateway/voicepulse_pt/ $1"/> </condition> </extension>
<extension name="Long Distance - voicepulse"> <condition field="destination_number" expression="^(\d{4,10})$"> <action application="set" data="effective_caller_id_number=99999999999"/> <!-- If your provider does not provide ringback (180 or 183) you may simulate ringback by uncommenting the following line. --> <!-- action application="ringback" /--> <action application="bridge" data="sofia/gateway/voicepulse/$1"/> </condition> </extension>
Is this how I should be doing this ? I want to specify a different gateway for a different rexep. Please give me some idea what path I should take.
David
_______________________________________________ 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
-- -Rupa
David Robinson <pawzlion@gmail.com> wrote:
Is this how I should be doing this ? I want to specify a different gateway for a different rexep. Please give me some idea what path I should take.
Make sure that FreeSWITCH actually reaches your extensions while searching the dial plan. Order is important: if another extension is matched first, and continue="true" is not specified in that extension, your extension will never be invoked. I would also suggest creating a new file in conf/dialplan/default instead of editing the default.xml file, unless of course you want to eliminate some of the extensions provided in default.xml in the sample configurations. Use the sofia status commands from fs_cli to see whether FreeSWITCH is registering to your gateways. for example, sofia status gateway <gateway name> If it doesn't work, the debug logs are in logs/freeswitch.log; read them carefully, as they will usually enable you to pinpoint the problem. To see where your extensions appear in the dial plan, have a look in logs/freeswitch.xml.fsxml, but don't edit that file! I hoe this helps.
participants (3)
-
David Robinson
-
Jason White
-
Rupa Schomaker