Dear all, when I get an incoming call from my SIP provider I do receive an invite on the trunk number, e.g. in Germany 0xxxxx9. However I have an extension block of 0xxxxx90 to 0xxxxx999. In the dialplan I checked the condition field="destination_number" but this compares to the number of the trunk 0xxxxx9, so I do not get the direct inward dialling extensions. The SIP to-header contains the direct inward dialling number 0xxxxx90 to 0xxxxx999 but I have no success in accessing it in the dialplan. I tried sip_to_user, sip_to_uri, sip_req_user, sip_req_uri, but no success. They are all empty. Any idea which variable to parse? Best regards Peter
route the call to the "info" app and look for the one that has it. On Wed, Nov 12, 2008 at 1:36 PM, Peter P GMX <Prometheus001@gmx.net> wrote:
Dear all,
when I get an incoming call from my SIP provider I do receive an invite on the trunk number, e.g. in Germany 0xxxxx9. However I have an extension block of 0xxxxx90 to 0xxxxx999. In the dialplan I checked the condition field="destination_number" but this compares to the number of the trunk 0xxxxx9, so I do not get the direct inward dialling extensions.
The SIP to-header contains the direct inward dialling number 0xxxxx90 to 0xxxxx999 but I have no success in accessing it in the dialplan.
I tried sip_to_user, sip_to_uri, sip_req_user, sip_req_uri, but no success. They are all empty.
Any idea which variable to parse?
Best regards Peter
_______________________________________________ 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
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:213-799-1400
I checked your hint. The variable sip_to_user has the right value - but it is evaluated as empty at the time it is parsed. Info gives me: . . variable_sip_to_user: [xxxxxxxxx8910] variable_sip_to_uri: [xxxxxxxxx8910@my.ip.addre.ss] Example1,: I check with condition field="destination_number" Match Result 2008-11-13 10:24:55 [DEBUG] mod_dialplan_xml.c:117 parse_exten() Regex: [Inbound QSC trunk] destination_number(xxxxxxxxx89) =~ /^(xxxxxxxxx89)$/ This works but gives only the DID of the trunk (10 is missing at the end). Example2: I check with condition field="sip_to_user" Match Result 2008-11-13 10:30:42 [DEBUG] mod_dialplan_xml.c:117 parse_exten() Regex: [Inbound QSC trunk] sip_to_user() =~ /^(xxxxxxxxx89[0-9.])$/ 2008-11-13 10:30:42 [DEBUG] mod_dialplan_xml.c:119 parse_exten() Regex mismatch sip_to_user() is empty Example3: I check with condition field="variable_sip_to_user" Match Result 2008-11-13 10:39:53 [DEBUG] mod_dialplan_xml.c:117 parse_exten() Regex: [Inbound QSC trunk] variable_sip_to_user() =~ /^(xxxxxxxxx89[0-9.])$/ 2008-11-13 10:39:53 [DEBUG] mod_dialplan_xml.c:119 parse_exten() Regex mismatch variable_sip_to_user() is empty So at the time of evaluation "sip_to_user" resp. "variable_sip_to_user" is empty. What can I do? Best regards Peter Anthony Minessale schrieb:
route the call to the "info" app and look for the one that has it.
On Wed, Nov 12, 2008 at 1:36 PM, Peter P GMX <Prometheus001@gmx.net <mailto:Prometheus001@gmx.net>> wrote:
Dear all,
when I get an incoming call from my SIP provider I do receive an invite on the trunk number, e.g. in Germany 0xxxxx9. However I have an extension block of 0xxxxx90 to 0xxxxx999. In the dialplan I checked the condition field="destination_number" but this compares to the number of the trunk 0xxxxx9, so I do not get the direct inward dialling extensions.
The SIP to-header contains the direct inward dialling number 0xxxxx90 to 0xxxxx999 but I have no success in accessing it in the dialplan.
I tried sip_to_user, sip_to_uri, sip_req_user, sip_req_uri, but no success. They are all empty.
Any idea which variable to parse?
Best regards Peter
_______________________________________________ Freeswitch-users mailing list Freeswitch-users@lists.freeswitch.org <mailto: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
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/
AIM: anthm MSN:anthony_minessale@hotmail.com <mailto:MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com <mailto:PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net <http://irc.freenode.net> #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <mailto:sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 <http://iax:guest@conference.freeswitch.org/888> googletalk:conf+888@conference.freeswitch.org <mailto:googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:213-799-1400 ------------------------------------------------------------------------
_______________________________________________ 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
here's another hint. use field="${sip_to_user}" On Thu, Nov 13, 2008 at 3:43 AM, Peter P GMX <Prometheus001@gmx.net> wrote:
I checked your hint. The variable sip_to_user has the right value - but it is evaluated as empty at the time it is parsed.
Info gives me: . . variable_sip_to_user: [xxxxxxxxx8910] variable_sip_to_uri: [xxxxxxxxx8910@my.ip.addre.ss]
Example1,: I check with condition field="destination_number" Match Result 2008-11-13 10:24:55 [DEBUG] mod_dialplan_xml.c:117 parse_exten() Regex: [Inbound QSC trunk] destination_number(xxxxxxxxx89) =~ /^(xxxxxxxxx89)$/ This works but gives only the DID of the trunk (10 is missing at the end).
Example2: I check with condition field="sip_to_user" Match Result 2008-11-13 10:30:42 [DEBUG] mod_dialplan_xml.c:117 parse_exten() Regex: [Inbound QSC trunk] sip_to_user() =~ /^(xxxxxxxxx89[0-9.])$/ 2008-11-13 10:30:42 [DEBUG] mod_dialplan_xml.c:119 parse_exten() Regex mismatch sip_to_user() is empty Example3: I check with condition field="variable_sip_to_user" Match Result 2008-11-13 10:39:53 [DEBUG] mod_dialplan_xml.c:117 parse_exten() Regex: [Inbound QSC trunk] variable_sip_to_user() =~ /^(xxxxxxxxx89[0-9.])$/ 2008-11-13 10:39:53 [DEBUG] mod_dialplan_xml.c:119 parse_exten() Regex mismatch variable_sip_to_user() is empty
So at the time of evaluation "sip_to_user" resp. "variable_sip_to_user" is empty.
What can I do?
Best regards Peter
Anthony Minessale schrieb:
route the call to the "info" app and look for the one that has it.
On Wed, Nov 12, 2008 at 1:36 PM, Peter P GMX <Prometheus001@gmx.net <mailto:Prometheus001@gmx.net>> wrote:
Dear all,
when I get an incoming call from my SIP provider I do receive an invite on the trunk number, e.g. in Germany 0xxxxx9. However I have an extension block of 0xxxxx90 to 0xxxxx999. In the dialplan I checked the condition field="destination_number" but this compares to the number of the trunk 0xxxxx9, so I do not get the direct inward dialling extensions.
The SIP to-header contains the direct inward dialling number 0xxxxx90 to 0xxxxx999 but I have no success in accessing it in the dialplan.
I tried sip_to_user, sip_to_uri, sip_req_user, sip_req_uri, but no success. They are all empty.
Any idea which variable to parse?
Best regards Peter
_______________________________________________ Freeswitch-users mailing list Freeswitch-users@lists.freeswitch.org <mailto: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
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/
AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> <mailto:MSN%3Aanthony_minessale@hotmail.com<MSN%253Aanthony_minessale@hotmail.com>
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> <mailto:PAYPAL%3Aanthony.minessale@gmail.com<PAYPAL%253Aanthony.minessale@gmail.com>
IRC: irc.freenode.net <http://irc.freenode.net> #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> <mailto:sip%3A888@conference.freeswitch.org<sip%253A888@conference.freeswitch.org>
iax:guest@conference.freeswitch.org/888 <http://iax:guest@conference.freeswitch.org/888> googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> <mailto:googletalk%3Aconf%2B888@conference.freeswitch.org<googletalk%253Aconf%252B888@conference.freeswitch.org>
pstn:213-799-1400 ------------------------------------------------------------------------
_______________________________________________ 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
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:213-799-1400
Thanks, this works Best regards Peter Anthony Minessale schrieb:
here's another hint.
use field="${sip_to_user}"
On Thu, Nov 13, 2008 at 3:43 AM, Peter P GMX <Prometheus001@gmx.net <mailto:Prometheus001@gmx.net>> wrote:
I checked your hint. The variable sip_to_user has the right value - but it is evaluated as empty at the time it is parsed.
Info gives me: . . variable_sip_to_user: [xxxxxxxxx8910] variable_sip_to_uri: [xxxxxxxxx8910@my.ip.addre.ss]
Example1,: I check with condition field="destination_number" Match Result 2008-11-13 10:24:55 [DEBUG] mod_dialplan_xml.c:117 parse_exten() Regex: [Inbound QSC trunk] destination_number(xxxxxxxxx89) =~ /^(xxxxxxxxx89)$/ This works but gives only the DID of the trunk (10 is missing at the end).
Example2: I check with condition field="sip_to_user" Match Result 2008-11-13 10:30:42 [DEBUG] mod_dialplan_xml.c:117 parse_exten() Regex: [Inbound QSC trunk] sip_to_user() =~ /^(xxxxxxxxx89[0-9.])$/ 2008-11-13 10:30:42 [DEBUG] mod_dialplan_xml.c:119 parse_exten() Regex mismatch sip_to_user() is empty Example3: I check with condition field="variable_sip_to_user" Match Result 2008-11-13 10:39:53 [DEBUG] mod_dialplan_xml.c:117 parse_exten() Regex: [Inbound QSC trunk] variable_sip_to_user() =~ /^(xxxxxxxxx89[0-9.])$/ 2008-11-13 10:39:53 [DEBUG] mod_dialplan_xml.c:119 parse_exten() Regex mismatch variable_sip_to_user() is empty
So at the time of evaluation "sip_to_user" resp. "variable_sip_to_user" is empty.
What can I do?
Best regards Peter
Anthony Minessale schrieb: > route the call to the "info" app and look for the one that has it. > > > On Wed, Nov 12, 2008 at 1:36 PM, Peter P GMX <Prometheus001@gmx.net <mailto:Prometheus001@gmx.net> > <mailto:Prometheus001@gmx.net <mailto:Prometheus001@gmx.net>>> wrote: > > Dear all, > > when I get an incoming call from my SIP provider I do receive an > invite > on the trunk number, e.g. in Germany 0xxxxx9. However I have an > extension block of 0xxxxx90 to 0xxxxx999. > In the dialplan I checked the condition field="destination_number" but > this compares to the number of the trunk 0xxxxx9, so I do not get the > direct inward dialling extensions. > > The SIP to-header contains the direct inward dialling number > 0xxxxx90 to > 0xxxxx999 but I have no success in accessing it in the dialplan. > > I tried sip_to_user, sip_to_uri, sip_req_user, sip_req_uri, but no > success. They are all empty. > > Any idea which variable to parse? > > Best regards > Peter > > > > > > > _______________________________________________ > Freeswitch-users mailing list > Freeswitch-users@lists.freeswitch.org <mailto:Freeswitch-users@lists.freeswitch.org> > <mailto:Freeswitch-users@lists.freeswitch.org <mailto: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 > > > > > -- > Anthony Minessale II > > FreeSWITCH http://www.freeswitch.org/ > ClueCon http://www.cluecon.com/ > > AIM: anthm > MSN:anthony_minessale@hotmail.com <mailto:MSN%3Aanthony_minessale@hotmail.com> > <mailto:MSN%3Aanthony_minessale@hotmail.com <mailto:MSN%253Aanthony_minessale@hotmail.com>> > GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com <mailto:PAYPAL%3Aanthony.minessale@gmail.com> > <mailto:PAYPAL%3Aanthony.minessale@gmail.com <mailto:PAYPAL%253Aanthony.minessale@gmail.com>> > IRC: irc.freenode.net <http://irc.freenode.net> <http://irc.freenode.net> #freeswitch > > FreeSWITCH Developer Conference > sip:888@conference.freeswitch.org <mailto:sip%3A888@conference.freeswitch.org> > <mailto:sip%3A888@conference.freeswitch.org <mailto:sip%253A888@conference.freeswitch.org>> > iax:guest@conference.freeswitch.org/888 <http://iax:guest@conference.freeswitch.org/888> > <http://iax:guest@conference.freeswitch.org/888> > googletalk:conf+888@conference.freeswitch.org <mailto:googletalk%3Aconf%2B888@conference.freeswitch.org> > <mailto:googletalk%3Aconf%2B888@conference.freeswitch.org <mailto:googletalk%253Aconf%252B888@conference.freeswitch.org>> > pstn:213-799-1400 > ------------------------------------------------------------------------ > > _______________________________________________ > Freeswitch-users mailing list > Freeswitch-users@lists.freeswitch.org <mailto: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 <mailto: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
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/
AIM: anthm MSN:anthony_minessale@hotmail.com <mailto:MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com <mailto:PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net <http://irc.freenode.net> #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <mailto:sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 <http://iax:guest@conference.freeswitch.org/888> googletalk:conf+888@conference.freeswitch.org <mailto:googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:213-799-1400 ------------------------------------------------------------------------
_______________________________________________ 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
Hello I want to follow up on this example from YEARS ago. I had tried using the variable "destination_number" but that didn't work, and I figured that it was because the To: header doesn't have the destination_number but has just the URI, so I thought I'd use sip_to_user instead. We have calls coming in with the following info in the INVITE From: "16469NNNNNN" <sip:16469NNNNNN;phone-context=+1@67.1x.xxx.xxx :5060;user=phone>;tag=SDru6fc01-gK0c10a887. To: <sip:011390NNNNNNNNNN;phone-context=+39@xxx.xxx.xxx.xxx :5060;user=phone>. (N and x are obviously being masked for privacy) I use this info in the dialplan like so <include> <extension name="DIDtest"> <condition field="ani" expression="^(\+?|\+1?|1?)(6469NNNNNN).*$" break="never"> <action application="set" data="effective_caller_id_number=$2"/> <action application="set" data="effective_caller_id_name=$2"/> </condition> <condition field="${sip_to_user}" expression="^(\+?|\+1?|1?|011?)(390NNNNNNNNNN).$" break="never"> <action application="set" data="continue_on_fail=false"/> <action application="set" data="hangup_after_bridge=true"/> <action application="set" data="domain_name=$${domain}"/> <action application="set" data="bypass_media=true"/> <action application="bridge" data="{sip_invite_domain=${sip_from_host}}sofia/gateway/blade2/$2"/> </condition> </extension> </include> However, the calls aren't passing the condition in this dialplan and thus not being forwarded to "blade2" server. In fact, even the 011 is not being stripped off. What am I doing wrong? Thanks \RR On Thu, Nov 13, 2008 at 10:52 AM, Peter P GMX <Prometheus001@gmx.net> wrote:
Thanks,
this works
Best regards Peter
Anthony Minessale schrieb:
here's another hint.
use field="${sip_to_user}"
On Thu, Nov 13, 2008 at 3:43 AM, Peter P GMX <Prometheus001@gmx.net <mailto:Prometheus001@gmx.net>> wrote:
I checked your hint. The variable sip_to_user has the right value - but it is evaluated as empty at the time it is parsed.
Info gives me: . . variable_sip_to_user: [xxxxxxxxx8910] variable_sip_to_uri: [xxxxxxxxx8910@my.ip.addre.ss]
Example1,: I check with condition field="destination_number" Match Result 2008-11-13 10:24:55 [DEBUG] mod_dialplan_xml.c:117 parse_exten() Regex: [Inbound QSC trunk] destination_number(xxxxxxxxx89) =~ /^(xxxxxxxxx89)$/ This works but gives only the DID of the trunk (10 is missing at the end).
Example2: I check with condition field="sip_to_user" Match Result 2008-11-13 10:30:42 [DEBUG] mod_dialplan_xml.c:117 parse_exten() Regex: [Inbound QSC trunk] sip_to_user() =~ /^(xxxxxxxxx89[0-9.])$/ 2008-11-13 10:30:42 [DEBUG] mod_dialplan_xml.c:119 parse_exten() Regex mismatch sip_to_user() is empty Example3: I check with condition field="variable_sip_to_user" Match Result 2008-11-13 10:39:53 [DEBUG] mod_dialplan_xml.c:117 parse_exten() Regex: [Inbound QSC trunk] variable_sip_to_user() =~ /^(xxxxxxxxx89[0-9.])$/ 2008-11-13 10:39:53 [DEBUG] mod_dialplan_xml.c:119 parse_exten() Regex mismatch variable_sip_to_user() is empty
So at the time of evaluation "sip_to_user" resp. "variable_sip_to_user" is empty.
What can I do?
Best regards Peter
Anthony Minessale schrieb: > route the call to the "info" app and look for the one that has it. > > > On Wed, Nov 12, 2008 at 1:36 PM, Peter P GMX <Prometheus001@gmx.net <mailto:Prometheus001@gmx.net> > <mailto:Prometheus001@gmx.net <mailto:Prometheus001@gmx.net>>> wrote: > > Dear all, > > when I get an incoming call from my SIP provider I do receive an > invite > on the trunk number, e.g. in Germany 0xxxxx9. However I have an > extension block of 0xxxxx90 to 0xxxxx999. > In the dialplan I checked the condition field="destination_number" but > this compares to the number of the trunk 0xxxxx9, so I do not get the > direct inward dialling extensions. > > The SIP to-header contains the direct inward dialling number > 0xxxxx90 to > 0xxxxx999 but I have no success in accessing it in the dialplan. > > I tried sip_to_user, sip_to_uri, sip_req_user, sip_req_uri, but no > success. They are all empty. > > Any idea which variable to parse? > > Best regards > Peter > > > > > > > _______________________________________________ > Freeswitch-users mailing list > Freeswitch-users@lists.freeswitch.org <mailto:Freeswitch-users@lists.freeswitch.org> > <mailto:Freeswitch-users@lists.freeswitch.org <mailto: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 > > > > > -- > Anthony Minessale II > > FreeSWITCH http://www.freeswitch.org/ > ClueCon http://www.cluecon.com/ > > AIM: anthm > MSN:anthony_minessale@hotmail.com<MSN%3Aanthony_minessale@hotmail.com> <mailto:MSN%3Aanthony_minessale@hotmail.com<MSN%253Aanthony_minessale@hotmail.com>
> <mailto:MSN%3Aanthony_minessale@hotmail.com<MSN%253Aanthony_minessale@hotmail.com> <mailto:MSN%253Aanthony_minessale@hotmail.com<MSN%25253Aanthony_minessale@hotmail.com>
> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> <mailto:PAYPAL%3Aanthony.minessale@gmail.com<PAYPAL%253Aanthony.minessale@gmail.com>
> <mailto:PAYPAL%3Aanthony.minessale@gmail.com<PAYPAL%253Aanthony.minessale@gmail.com> <mailto:PAYPAL%253Aanthony.minessale@gmail.com<PAYPAL%25253Aanthony.minessale@gmail.com>
> IRC: irc.freenode.net <http://irc.freenode.net> <http://irc.freenode.net> #freeswitch > > FreeSWITCH Developer Conference > sip:888@conference.freeswitch.org<sip%3A888@conference.freeswitch.org> <mailto:sip%3A888@conference.freeswitch.org<sip%253A888@conference.freeswitch.org>
> <mailto:sip%3A888@conference.freeswitch.org<sip%253A888@conference.freeswitch.org> <mailto:sip%253A888@conference.freeswitch.org<sip%25253A888@conference.freeswitch.org>
> iax:guest@conference.freeswitch.org/888 <http://iax:guest@conference.freeswitch.org/888> > <http://iax:guest@conference.freeswitch.org/888> > googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> <mailto:googletalk%3Aconf%2B888@conference.freeswitch.org<googletalk%253Aconf%252B888@conference.freeswitch.org>
> <mailto:googletalk%3Aconf%2B888@conference.freeswitch.org<googletalk%253Aconf%252B888@conference.freeswitch.org> <mailto:googletalk%253Aconf%252B888@conference.freeswitch.org<googletalk%25253Aconf%25252B888@conference.freeswitch.org>
> pstn:213-799-1400 >
------------------------------------------------------------------------
> > _______________________________________________ > Freeswitch-users mailing list > Freeswitch-users@lists.freeswitch.org <mailto:Freeswitch-users@lists.freeswitch.org> > http://lists.freeswitch.org/mailman/listinfo/freeswitch-users > UNSUBSCRIBE:
http://lists.freeswitch.org/mailman/options/freeswitch-users
_______________________________________________ Freeswitch-users mailing list Freeswitch-users@lists.freeswitch.org <mailto:Freeswitch-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:
http://lists.freeswitch.org/mailman/options/freeswitch-users
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/
AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> <mailto:MSN%3Aanthony_minessale@hotmail.com<MSN%253Aanthony_minessale@hotmail.com>
GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> <mailto:PAYPAL%3Aanthony.minessale@gmail.com<PAYPAL%253Aanthony.minessale@gmail.com>
IRC: irc.freenode.net <http://irc.freenode.net> #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> <mailto:sip%3A888@conference.freeswitch.org<sip%253A888@conference.freeswitch.org>
iax:guest@conference.freeswitch.org/888 <http://iax:guest@conference.freeswitch.org/888> googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> <mailto:googletalk%3Aconf%2B888@conference.freeswitch.org<googletalk%253Aconf%252B888@conference.freeswitch.org>
pstn:213-799-1400 ------------------------------------------------------------------------
_______________________________________________ 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
You mean the SIP TO you receive does not contain a @domain part ? Hmmm, I am sure some guys around will have some comments to do about that :) David Ponzone Direction Technique email: david.ponzone@ipeva.fr tel: 01 74 03 18 97 gsm: 06 66 98 76 34 Service Client IPeva tel: 0811 46 26 26 www.ipeva.fr - www.ipeva-studio.com Ce message et toutes les pièces jointes sont confidentiels et établis à l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisée est interdite. Tout message électronique est susceptible d'altération. IPeva décline toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié. Si vous n'êtes pas destinataire de ce message, merci de le détruire immédiatement et d'avertir l'expéditeur. Le 25/05/2010 à 21:48, RR a écrit :
Hello I want to follow up on this example from YEARS ago. I had tried using the variable "destination_number" but that didn't work, and I figured that it was because the To: header doesn't have the destination_number but has just the URI, so I thought I'd use sip_to_user instead.
We have calls coming in with the following info in the INVITE
From: "16469NNNNNN" <sip:16469NNNNNN;phone-context=+1@67.1x.xxx.xxx:5060;user=phone
;tag=SDru6fc01-gK0c10a887. To: <sip:011390NNNNNNNNNN;phone-context=+39@xxx.xxx.xxx.xxx:5060;user=phone . (N and x are obviously being masked for privacy)
I use this info in the dialplan like so
<include> <extension name="DIDtest"> <condition field="ani" expression="^(\+?|\+1?|1?)(6469NNNNNN).* $" break="never"> <action application="set" data="effective_caller_id_number= $2"/> <action application="set" data="effective_caller_id_name=$2"/> </condition> <condition field="${sip_to_user}" expression="^(\+?|\+1?|1?|011?) (390NNNNNNNNNN).$" break="never"> <action application="set" data="continue_on_fail=false"/> <action application="set" data="hangup_after_bridge=true"/> <action application="set" data="domain_name=$${domain}"/> <action application="set" data="bypass_media=true"/> <action application="bridge" data="{sip_invite_domain=$ {sip_from_host}}sofia/gateway/blade2/$2"/> </condition> </extension> </include>
However, the calls aren't passing the condition in this dialplan and thus not being forwarded to "blade2" server. In fact, even the 011 is not being stripped off.
What am I doing wrong?
Thanks \RR
On Thu, Nov 13, 2008 at 10:52 AM, Peter P GMX <Prometheus001@gmx.net> wrote: Thanks,
this works
Best regards Peter
Anthony Minessale schrieb:
here's another hint.
use field="${sip_to_user}"
On Thu, Nov 13, 2008 at 3:43 AM, Peter P GMX <Prometheus001@gmx.net <mailto:Prometheus001@gmx.net>> wrote:
I checked your hint. The variable sip_to_user has the right value - but it is evaluated as empty at the time it is parsed.
Info gives me: . . variable_sip_to_user: [xxxxxxxxx8910] variable_sip_to_uri: [xxxxxxxxx8910@my.ip.addre.ss]
Example1,: I check with condition field="destination_number" Match Result 2008-11-13 10:24:55 [DEBUG] mod_dialplan_xml.c:117 parse_exten() Regex: [Inbound QSC trunk] destination_number(xxxxxxxxx89) =~ /^(xxxxxxxxx89)$/ This works but gives only the DID of the trunk (10 is missing at the end).
Example2: I check with condition field="sip_to_user" Match Result 2008-11-13 10:30:42 [DEBUG] mod_dialplan_xml.c:117 parse_exten() Regex: [Inbound QSC trunk] sip_to_user() =~ /^(xxxxxxxxx89[0-9.])$/ 2008-11-13 10:30:42 [DEBUG] mod_dialplan_xml.c:119 parse_exten() Regex mismatch sip_to_user() is empty Example3: I check with condition field="variable_sip_to_user" Match Result 2008-11-13 10:39:53 [DEBUG] mod_dialplan_xml.c:117 parse_exten() Regex: [Inbound QSC trunk] variable_sip_to_user() =~ / ^(xxxxxxxxx89[0-9.])$/ 2008-11-13 10:39:53 [DEBUG] mod_dialplan_xml.c:119 parse_exten() Regex mismatch variable_sip_to_user() is empty
So at the time of evaluation "sip_to_user" resp. "variable_sip_to_user" is empty.
What can I do?
Best regards Peter
Anthony Minessale schrieb: > route the call to the "info" app and look for the one that has it. > > > On Wed, Nov 12, 2008 at 1:36 PM, Peter P GMX <Prometheus001@gmx.net <mailto:Prometheus001@gmx.net> > <mailto:Prometheus001@gmx.net <mailto:Prometheus001@gmx.net>>> wrote: > > Dear all, > > when I get an incoming call from my SIP provider I do receive an > invite > on the trunk number, e.g. in Germany 0xxxxx9. However I have an > extension block of 0xxxxx90 to 0xxxxx999. > In the dialplan I checked the condition field="destination_number" but > this compares to the number of the trunk 0xxxxx9, so I do not get the > direct inward dialling extensions. > > The SIP to-header contains the direct inward dialling number > 0xxxxx90 to > 0xxxxx999 but I have no success in accessing it in the dialplan. > > I tried sip_to_user, sip_to_uri, sip_req_user, sip_req_uri, but no > success. They are all empty. > > Any idea which variable to parse? > > Best regards > Peter > > > > > > > _______________________________________________ > Freeswitch-users mailing list > Freeswitch-users@lists.freeswitch.org <mailto:Freeswitch-users@lists.freeswitch.org> > <mailto:Freeswitch-users@lists.freeswitch.org <mailto: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 > > > > > -- > Anthony Minessale II > > FreeSWITCH http://www.freeswitch.org/ > ClueCon http://www.cluecon.com/ > > AIM: anthm > MSN:anthony_minessale@hotmail.com <mailto:MSN%3Aanthony_minessale@hotmail.com> > <mailto:MSN%3Aanthony_minessale@hotmail.com <mailto:MSN%253Aanthony_minessale@hotmail.com>> > GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com <mailto:PAYPAL%3Aanthony.minessale@gmail.com> > <mailto:PAYPAL%3Aanthony.minessale@gmail.com <mailto:PAYPAL%253Aanthony.minessale@gmail.com>> > IRC: irc.freenode.net <http://irc.freenode.net> <http://irc.freenode.net> #freeswitch > > FreeSWITCH Developer Conference > sip:888@conference.freeswitch.org <mailto:sip%3A888@conference.freeswitch.org> > <mailto:sip%3A888@conference.freeswitch.org <mailto:sip%253A888@conference.freeswitch.org>> > iax:guest@conference.freeswitch.org/888 <http://iax:guest@conference.freeswitch.org/888> > <http://iax:guest@conference.freeswitch.org/888> > googletalk:conf+888@conference.freeswitch.org <mailto:googletalk%3Aconf%2B888@conference.freeswitch.org> > <mailto:googletalk%3Aconf%2B888@conference.freeswitch.org <mailto:googletalk%253Aconf%252B888@conference.freeswitch.org>> > pstn:213-799-1400 >
------------------------------------------------------------------------
> > _______________________________________________ > Freeswitch-users mailing list > Freeswitch-users@lists.freeswitch.org <mailto: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 <mailto: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
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/
AIM: anthm MSN:anthony_minessale@hotmail.com <mailto:MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com <mailto:PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net <http://irc.freenode.net> #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <mailto:sip%3A888@conference.freeswitch.org> iax:guest@conference.freeswitch.org/888 <http://iax:guest@conference.freeswitch.org/888> googletalk:conf+888@conference.freeswitch.org <mailto:googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:213-799-1400
------------------------------------------------------------------------
_______________________________________________ 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
_______________________________________________ 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 Tue, May 25, 2010 at 12:48 PM, RR <ranjtech@gmail.com> wrote:
Hello I want to follow up on this example from YEARS ago. I had tried using the variable "destination_number" but that didn't work, and I figured that it was because the To: header doesn't have the destination_number but has just the URI, so I thought I'd use sip_to_user instead.
We have calls coming in with the following info in the INVITE
From: "16469NNNNNN" <sip:16469NNNNNN;phone-context=+1@67.1x.xxx.xxx :5060;user=phone>;tag=SDru6fc01-gK0c10a887. To: <sip:011390NNNNNNNNNN;phone-context=+39@xxx.xxx.xxx.xxx :5060;user=phone>. (N and x are obviously being masked for privacy)
I use this info in the dialplan like so
<include> <extension name="DIDtest"> <condition field="ani" expression="^(\+?|\+1?|1?)(6469NNNNNN).*$" break="never"> <action application="set" data="effective_caller_id_number=$2"/> <action application="set" data="effective_caller_id_name=$2"/> </condition> <condition field="${sip_to_user}" expression="^(\+?|\+1?|1?|011?)(390NNNNNNNNNN).$" break="never"> <action application="set" data="continue_on_fail=false"/> <action application="set" data="hangup_after_bridge=true"/> <action application="set" data="domain_name=$${domain}"/> <action application="set" data="bypass_media=true"/> <action application="bridge" data="{sip_invite_domain=${sip_from_host}}sofia/gateway/blade2/$2"/> </condition> </extension> </include>
However, the calls aren't passing the condition in this dialplan and thus not being forwarded to "blade2" server. In fact, even the 011 is not being stripped off.
What am I doing wrong?
Create a quick test extension that only does an info dump. (See 9992 in default.xml for an example.) Make a call, look at the info dump, and make sure that what you think you are getting is really what you are getting. :) -MC
Hi Guys, Thanks for the quick feedback David, no we're getting the full URI with the domain part intact, just nothing before the "<" braces Michael, I already tried the info app and we get variable_sip_to_user: [011390NNNNNNNNNN;phone-context=+39] variable_sip_to_uri: [011390NNNNNNNNNN;phone-context=+39@208.xx.xxx.xxx :5060] Thanks RR On Tue, May 25, 2010 at 4:12 PM, Michael Collins <msc@freeswitch.org> wrote:
On Tue, May 25, 2010 at 12:48 PM, RR <ranjtech@gmail.com> wrote:
Hello I want to follow up on this example from YEARS ago. I had tried using the variable "destination_number" but that didn't work, and I figured that it was because the To: header doesn't have the destination_number but has just the URI, so I thought I'd use sip_to_user instead.
We have calls coming in with the following info in the INVITE
From: "16469NNNNNN" <sip:16469NNNNNN;phone-context=+1@67.1x.xxx.xxx :5060;user=phone>;tag=SDru6fc01-gK0c10a887. To: <sip:011390NNNNNNNNNN;phone-context=+39@xxx.xxx.xxx.xxx :5060;user=phone>. (N and x are obviously being masked for privacy)
I use this info in the dialplan like so
<include> <extension name="DIDtest"> <condition field="ani" expression="^(\+?|\+1?|1?)(6469NNNNNN).*$" break="never"> <action application="set" data="effective_caller_id_number=$2"/> <action application="set" data="effective_caller_id_name=$2"/> </condition> <condition field="${sip_to_user}" expression="^(\+?|\+1?|1?|011?)(390NNNNNNNNNN).$" break="never"> <action application="set" data="continue_on_fail=false"/> <action application="set" data="hangup_after_bridge=true"/> <action application="set" data="domain_name=$${domain}"/> <action application="set" data="bypass_media=true"/> <action application="bridge" data="{sip_invite_domain=${sip_from_host}}sofia/gateway/blade2/$2"/> </condition> </extension> </include>
However, the calls aren't passing the condition in this dialplan and thus not being forwarded to "blade2" server. In fact, even the 011 is not being stripped off.
What am I doing wrong?
Create a quick test extension that only does an info dump. (See 9992 in default.xml for an example.) Make a call, look at the info dump, and make sure that what you think you are getting is really what you are getting. :)
-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
Which means there is no @ in the sip: part of the SIP To field. Only in the phone-context part. FS uses the @ to split the strings into pieces, and then in your case, it fails as one is missing. David Ponzone Direction Technique email: david.ponzone@ipeva.fr tel: 01 74 03 18 97 gsm: 06 66 98 76 34 Service Client IPeva tel: 0811 46 26 26 www.ipeva.fr - www.ipeva-studio.com Ce message et toutes les pièces jointes sont confidentiels et établis à l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisée est interdite. Tout message électronique est susceptible d'altération. IPeva décline toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié. Si vous n'êtes pas destinataire de ce message, merci de le détruire immédiatement et d'avertir l'expéditeur. Le 25/05/2010 à 22:28, RR a écrit :
Hi Guys,
Thanks for the quick feedback
David, no we're getting the full URI with the domain part intact, just nothing before the "<" braces
Michael, I already tried the info app and we get
variable_sip_to_user: [011390NNNNNNNNNN;phone-context=+39] variable_sip_to_uri: [011390NNNNNNNNNN;phone-context=+39@208.xx.xxx.xxx :5060]
Thanks RR
On Tue, May 25, 2010 at 4:12 PM, Michael Collins <msc@freeswitch.org> wrote:
On Tue, May 25, 2010 at 12:48 PM, RR <ranjtech@gmail.com> wrote: Hello I want to follow up on this example from YEARS ago. I had tried using the variable "destination_number" but that didn't work, and I figured that it was because the To: header doesn't have the destination_number but has just the URI, so I thought I'd use sip_to_user instead.
We have calls coming in with the following info in the INVITE
From: "16469NNNNNN" <sip:16469NNNNNN;phone-context=+1@67.1x.xxx.xxx:5060;user=phone
;tag=SDru6fc01-gK0c10a887. To: <sip:011390NNNNNNNNNN;phone-context=+39@xxx.xxx.xxx.xxx:5060;user=phone . (N and x are obviously being masked for privacy)
I use this info in the dialplan like so
<include> <extension name="DIDtest"> <condition field="ani" expression="^(\+?|\+1?|1?)(6469NNNNNN).* $" break="never"> <action application="set" data="effective_caller_id_number= $2"/> <action application="set" data="effective_caller_id_name=$2"/> </condition> <condition field="${sip_to_user}" expression="^(\+?|\+1?|1?|011?) (390NNNNNNNNNN).$" break="never"> <action application="set" data="continue_on_fail=false"/> <action application="set" data="hangup_after_bridge=true"/> <action application="set" data="domain_name=$${domain}"/> <action application="set" data="bypass_media=true"/> <action application="bridge" data="{sip_invite_domain=$ {sip_from_host}}sofia/gateway/blade2/$2"/> </condition> </extension> </include>
However, the calls aren't passing the condition in this dialplan and thus not being forwarded to "blade2" server. In fact, even the 011 is not being stripped off.
What am I doing wrong?
Create a quick test extension that only does an info dump. (See 9992 in default.xml for an example.) Make a call, look at the info dump, and make sure that what you think you are getting is really what you are getting. :)
-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
_______________________________________________ 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
did you turn up the debug (press f8 or type console loglevel debug) The debug logs will show the data being passed into the regex and the results. P.S. I hope only your example is from years ago and not your copy of FS. On Tue, May 25, 2010 at 3:40 PM, David Ponzone <david.ponzone@gmail.com>wrote:
Which means there is no @ in the sip: part of the SIP To field. Only in the phone-context part. FS uses the @ to split the strings into pieces, and then in your case, it fails as one is missing.
David Ponzone Direction Technique email: david.ponzone@ipeva.fr tel: 01 74 03 18 97 gsm: 06 66 98 76 34
Service Client IPeva tel: 0811 46 26 26 www.ipeva.fr - www.ipeva-studio.com
*Ce message et toutes les pièces jointes sont confidentiels et établis à l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisée est interdite. Tout message électronique est susceptible d'altération. **IPeva** décline toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié. Si vous n'êtes pas destinataire de ce message, merci de le détruire immédiatement et d'avertir l'expéditeur.* * *
Le 25/05/2010 à 22:28, RR a écrit :
Hi Guys,
Thanks for the quick feedback
David, no we're getting the full URI with the domain part intact, just nothing before the "<" braces
Michael, I already tried the info app and we get
variable_sip_to_user: [011390NNNNNNNNNN;phone-context=+39] variable_sip_to_uri: [011390NNNNNNNNNN;phone-context=+39@208.xx.xxx.xxx :5060]
Thanks RR
On Tue, May 25, 2010 at 4:12 PM, Michael Collins <msc@freeswitch.org>wrote:
On Tue, May 25, 2010 at 12:48 PM, RR <ranjtech@gmail.com> wrote:
Hello I want to follow up on this example from YEARS ago. I had tried using the variable "destination_number" but that didn't work, and I figured that it was because the To: header doesn't have the destination_number but has just the URI, so I thought I'd use sip_to_user instead.
We have calls coming in with the following info in the INVITE
From: "16469NNNNNN" < sip:16469NNNNNN;phone-context=+1@67.1x.xxx.xxx:5060;user=phone
;tag=SDru6fc01-gK0c10a887. To: < sip:011390NNNNNNNNNN;phone-context=+39@xxx.xxx.xxx.xxx:5060;user=phone>. (N and x are obviously being masked for privacy)
I use this info in the dialplan like so
<include> <extension name="DIDtest"> <condition field="ani" expression="^(\+?|\+1?|1?)(6469NNNNNN).*$" break="never"> <action application="set" data="effective_caller_id_number=$2"/> <action application="set" data="effective_caller_id_name=$2"/> </condition> <condition field="${sip_to_user}" expression="^(\+?|\+1?|1?|011?)(390NNNNNNNNNN).$" break="never"> <action application="set" data="continue_on_fail=false"/> <action application="set" data="hangup_after_bridge=true"/> <action application="set" data="domain_name=$${domain}"/> <action application="set" data="bypass_media=true"/> <action application="bridge" data="{sip_invite_domain=${sip_from_host}}sofia/gateway/blade2/$2"/> </condition> </extension> </include>
However, the calls aren't passing the condition in this dialplan and thus not being forwarded to "blade2" server. In fact, even the 011 is not being stripped off.
What am I doing wrong?
Create a quick test extension that only does an info dump. (See 9992 in default.xml for an example.) Make a call, look at the info dump, and make sure that what you think you are getting is really what you are getting. :)
-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
_______________________________________________ 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
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:+19193869900
Hi Anthony, this is what I see in the debug: Dialplan: sofia/external/16469NNNNNN Regex (FAIL) [DIDtest] ${sip_to_user}(011390NNNNNNNNNN;phone-context=+39) =~ /^(\+?|\+1?|1?|011?)(390NNNNNNNNNN).$/ break=on-false and then it moves on to another dialplan xml file. please note that info app shows: variable_sip_to_user: [011390NNNNNNNNNN;phone-context=+39] shouldn't this actually match?? Oh and yes, the copy of FS is pretty old but this is a production system which gets 24 / 7 traffic so the upgrade is being pushed and pushed :( you think this is simply because it's an old build? Thanks RR On Tue, May 25, 2010 at 4:49 PM, Anthony Minessale < anthony.minessale@gmail.com> wrote:
did you turn up the debug (press f8 or type console loglevel debug) The debug logs will show the data being passed into the regex and the results.
P.S. I hope only your example is from years ago and not your copy of FS.
On Tue, May 25, 2010 at 3:40 PM, David Ponzone <david.ponzone@gmail.com>wrote:
Which means there is no @ in the sip: part of the SIP To field. Only in the phone-context part. FS uses the @ to split the strings into pieces, and then in your case, it fails as one is missing.
David Ponzone Direction Technique email: david.ponzone@ipeva.fr tel: 01 74 03 18 97 gsm: 06 66 98 76 34
Service Client IPeva tel: 0811 46 26 26 www.ipeva.fr - www.ipeva-studio.com
*Ce message et toutes les pièces jointes sont confidentiels et établis à l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisée est interdite. Tout message électronique est susceptible d'altération. **IPeva** décline toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié. Si vous n'êtes pas destinataire de ce message, merci de le détruire immédiatement et d'avertir l'expéditeur.* * *
Le 25/05/2010 à 22:28, RR a écrit :
Hi Guys,
Thanks for the quick feedback
David, no we're getting the full URI with the domain part intact, just nothing before the "<" braces
Michael, I already tried the info app and we get
variable_sip_to_user: [011390NNNNNNNNNN;phone-context=+39] variable_sip_to_uri: [011390NNNNNNNNNN;phone-context=+39@208.xx.xxx.xxx :5060]
Thanks RR
On Tue, May 25, 2010 at 4:12 PM, Michael Collins <msc@freeswitch.org>wrote:
On Tue, May 25, 2010 at 12:48 PM, RR <ranjtech@gmail.com> wrote:
Hello I want to follow up on this example from YEARS ago. I had tried using the variable "destination_number" but that didn't work, and I figured that it was because the To: header doesn't have the destination_number but has just the URI, so I thought I'd use sip_to_user instead.
We have calls coming in with the following info in the INVITE
From: "16469NNNNNN" < sip:16469NNNNNN;phone-context=+1@67.1x.xxx.xxx:5060;user=phone
;tag=SDru6fc01-gK0c10a887. To: < sip:011390NNNNNNNNNN;phone-context=+39@xxx.xxx.xxx.xxx:5060;user=phone . (N and x are obviously being masked for privacy)
I use this info in the dialplan like so
<include> <extension name="DIDtest"> <condition field="ani" expression="^(\+?|\+1?|1?)(6469NNNNNN).*$" break="never"> <action application="set" data="effective_caller_id_number=$2"/> <action application="set" data="effective_caller_id_name=$2"/> </condition> <condition field="${sip_to_user}" expression="^(\+?|\+1?|1?|011?)(390NNNNNNNNNN).$" break="never"> <action application="set" data="continue_on_fail=false"/> <action application="set" data="hangup_after_bridge=true"/> <action application="set" data="domain_name=$${domain}"/> <action application="set" data="bypass_media=true"/> <action application="bridge" data="{sip_invite_domain=${sip_from_host}}sofia/gateway/blade2/$2"/> </condition> </extension> </include>
However, the calls aren't passing the condition in this dialplan and thus not being forwarded to "blade2" server. In fact, even the 011 is not being stripped off.
What am I doing wrong?
Create a quick test extension that only does an info dump. (See 9992 in default.xml for an example.) Make a call, look at the info dump, and make sure that what you think you are getting is really what you are getting. :)
-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
_______________________________________________ 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
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire
AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:+19193869900
_______________________________________________ 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
you probably have to remove the $ at the end to allow for the ;params On Tue, May 25, 2010 at 4:43 PM, RR <ranjtech@gmail.com> wrote:
Hi Anthony,
this is what I see in the debug:
Dialplan: sofia/external/16469NNNNNN Regex (FAIL) [DIDtest] ${sip_to_user}(011390NNNNNNNNNN;phone-context=+39) =~ /^(\+?|\+1?|1?|011?)(390NNNNNNNNNN).$/ break=on-false
and then it moves on to another dialplan xml file.
please note that info app shows:
variable_sip_to_user: [011390NNNNNNNNNN;phone-context=+39]
shouldn't this actually match??
Oh and yes, the copy of FS is pretty old but this is a production system which gets 24 / 7 traffic so the upgrade is being pushed and pushed :(
you think this is simply because it's an old build?
Thanks RR
On Tue, May 25, 2010 at 4:49 PM, Anthony Minessale < anthony.minessale@gmail.com> wrote:
did you turn up the debug (press f8 or type console loglevel debug) The debug logs will show the data being passed into the regex and the results.
P.S. I hope only your example is from years ago and not your copy of FS.
On Tue, May 25, 2010 at 3:40 PM, David Ponzone <david.ponzone@gmail.com>wrote:
Which means there is no @ in the sip: part of the SIP To field. Only in the phone-context part. FS uses the @ to split the strings into pieces, and then in your case, it fails as one is missing.
David Ponzone Direction Technique email: david.ponzone@ipeva.fr tel: 01 74 03 18 97 gsm: 06 66 98 76 34
Service Client IPeva tel: 0811 46 26 26 www.ipeva.fr - www.ipeva-studio.com
*Ce message et toutes les pièces jointes sont confidentiels et établis à l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisée est interdite. Tout message électronique est susceptible d'altération. **IPeva** décline toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié. Si vous n'êtes pas destinataire de ce message, merci de le détruire immédiatement et d'avertir l'expéditeur.* * *
Le 25/05/2010 à 22:28, RR a écrit :
Hi Guys,
Thanks for the quick feedback
David, no we're getting the full URI with the domain part intact, just nothing before the "<" braces
Michael, I already tried the info app and we get
variable_sip_to_user: [011390NNNNNNNNNN;phone-context=+39] variable_sip_to_uri: [011390NNNNNNNNNN;phone-context=+39@208.xx.xxx.xxx :5060]
Thanks RR
On Tue, May 25, 2010 at 4:12 PM, Michael Collins <msc@freeswitch.org>wrote:
On Tue, May 25, 2010 at 12:48 PM, RR <ranjtech@gmail.com> wrote:
Hello I want to follow up on this example from YEARS ago. I had tried using the variable "destination_number" but that didn't work, and I figured that it was because the To: header doesn't have the destination_number but has just the URI, so I thought I'd use sip_to_user instead.
We have calls coming in with the following info in the INVITE
From: "16469NNNNNN" < sip:16469NNNNNN;phone-context=+1@67.1x.xxx.xxx:5060;user=phone
;tag=SDru6fc01-gK0c10a887. To: < sip:011390NNNNNNNNNN;phone-context=+39@xxx.xxx.xxx.xxx:5060;user=phone . (N and x are obviously being masked for privacy)
I use this info in the dialplan like so
<include> <extension name="DIDtest"> <condition field="ani" expression="^(\+?|\+1?|1?)(6469NNNNNN).*$" break="never"> <action application="set" data="effective_caller_id_number=$2"/> <action application="set" data="effective_caller_id_name=$2"/> </condition> <condition field="${sip_to_user}" expression="^(\+?|\+1?|1?|011?)(390NNNNNNNNNN).$" break="never"> <action application="set" data="continue_on_fail=false"/> <action application="set" data="hangup_after_bridge=true"/> <action application="set" data="domain_name=$${domain}"/> <action application="set" data="bypass_media=true"/> <action application="bridge" data="{sip_invite_domain=${sip_from_host}}sofia/gateway/blade2/$2"/> </condition> </extension> </include>
However, the calls aren't passing the condition in this dialplan and thus not being forwarded to "blade2" server. In fact, even the 011 is not being stripped off.
What am I doing wrong?
Create a quick test extension that only does an info dump. (See 9992 in default.xml for an example.) Make a call, look at the info dump, and make sure that what you think you are getting is really what you are getting. :)
-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
_______________________________________________ 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
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire
AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:+19193869900
_______________________________________________ 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
-- Anthony Minessale II FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:+19193869900
Thanks for pointing me in the right direction. What fixed it was adding a '*' which I used to have before but with all these changes I was making I forgot to add it back in. So doing this: <condition field="${sip_to_user}" expression="^(\+?|\+1?|1?|011?)(390NNNNNNNNNN).*$" break="never"> works Thanks for the help \RR On Tue, May 25, 2010 at 6:10 PM, Anthony Minessale < anthony.minessale@gmail.com> wrote:
you probably have to remove the $ at the end to allow for the ;params
On Tue, May 25, 2010 at 4:43 PM, RR <ranjtech@gmail.com> wrote:
Hi Anthony,
this is what I see in the debug:
Dialplan: sofia/external/16469NNNNNN Regex (FAIL) [DIDtest] ${sip_to_user}(011390NNNNNNNNNN;phone-context=+39) =~ /^(\+?|\+1?|1?|011?)(390NNNNNNNNNN).$/ break=on-false
and then it moves on to another dialplan xml file.
please note that info app shows:
variable_sip_to_user: [011390NNNNNNNNNN;phone-context=+39]
shouldn't this actually match??
Oh and yes, the copy of FS is pretty old but this is a production system which gets 24 / 7 traffic so the upgrade is being pushed and pushed :(
you think this is simply because it's an old build?
Thanks RR
On Tue, May 25, 2010 at 4:49 PM, Anthony Minessale < anthony.minessale@gmail.com> wrote:
did you turn up the debug (press f8 or type console loglevel debug) The debug logs will show the data being passed into the regex and the results.
P.S. I hope only your example is from years ago and not your copy of FS.
On Tue, May 25, 2010 at 3:40 PM, David Ponzone <david.ponzone@gmail.com>wrote:
Which means there is no @ in the sip: part of the SIP To field. Only in the phone-context part. FS uses the @ to split the strings into pieces, and then in your case, it fails as one is missing.
David Ponzone Direction Technique email: david.ponzone@ipeva.fr tel: 01 74 03 18 97 gsm: 06 66 98 76 34
Service Client IPeva tel: 0811 46 26 26 www.ipeva.fr - www.ipeva-studio.com
*Ce message et toutes les pièces jointes sont confidentiels et établis à l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisée est interdite. Tout message électronique est susceptible d'altération. **IPeva** décline toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié. Si vous n'êtes pas destinataire de ce message, merci de le détruire immédiatement et d'avertir l'expéditeur.* * *
Le 25/05/2010 à 22:28, RR a écrit :
Hi Guys,
Thanks for the quick feedback
David, no we're getting the full URI with the domain part intact, just nothing before the "<" braces
Michael, I already tried the info app and we get
variable_sip_to_user: [011390NNNNNNNNNN;phone-context=+39] variable_sip_to_uri: [011390NNNNNNNNNN;phone-context=+39@208.xx.xxx.xxx :5060]
Thanks RR
On Tue, May 25, 2010 at 4:12 PM, Michael Collins <msc@freeswitch.org>wrote:
On Tue, May 25, 2010 at 12:48 PM, RR <ranjtech@gmail.com> wrote:
Hello I want to follow up on this example from YEARS ago. I had tried using the variable "destination_number" but that didn't work, and I figured that it was because the To: header doesn't have the destination_number but has just the URI, so I thought I'd use sip_to_user instead.
We have calls coming in with the following info in the INVITE
From: "16469NNNNNN" < sip:16469NNNNNN;phone-context=+1@67.1x.xxx.xxx:5060;user=phone >;tag=SDru6fc01-gK0c10a887. To: < sip:011390NNNNNNNNNN;phone-context=+39@xxx.xxx.xxx.xxx:5060;user=phone >. (N and x are obviously being masked for privacy)
I use this info in the dialplan like so
<include> <extension name="DIDtest"> <condition field="ani" expression="^(\+?|\+1?|1?)(6469NNNNNN).*$" break="never"> <action application="set" data="effective_caller_id_number=$2"/> <action application="set" data="effective_caller_id_name=$2"/> </condition> <condition field="${sip_to_user}" expression="^(\+?|\+1?|1?|011?)(390NNNNNNNNNN).$" break="never"> <action application="set" data="continue_on_fail=false"/> <action application="set" data="hangup_after_bridge=true"/> <action application="set" data="domain_name=$${domain}"/> <action application="set" data="bypass_media=true"/> <action application="bridge" data="{sip_invite_domain=${sip_from_host}}sofia/gateway/blade2/$2"/> </condition> </extension> </include>
However, the calls aren't passing the condition in this dialplan and thus not being forwarded to "blade2" server. In fact, even the 011 is not being stripped off.
What am I doing wrong?
Create a quick test extension that only does an info dump. (See 9992 in default.xml for an example.) Make a call, look at the info dump, and make sure that what you think you are getting is really what you are getting. :)
-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
_______________________________________________ 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
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire
AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:+19193869900
_______________________________________________ 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
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire
AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:+19193869900
_______________________________________________ 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
Ok, so I take that back. This seems to only work when the dialplan has a specific ANI and DNIS / destination_number / sip_to_user defined. If this is more general like <include> <extension name="public_did"> <condition field="ani" expression="^(\+?|\+1?|1?)(\d+).*$" break="never"> <action application="set" data="effective_caller_id_number=$2"/> <action application="set" data="effective_caller_id_name=$2"/> </condition> <condition field="${sip_to_user}" expression="^(\+1?|\+|1?|011?)(\d+).*$" break="never"> <action application="set" data="continue_on_fail=false"/> <action application="set" data="hangup_after_bridge=true"/> <action application="set" data="domain_name=$${domain}"/> <action application="set" data="bypass_media=true"/> <action application="limit_hash" data="in cc_blades 4200 !USER_BUSY"/> <action application="bridge" data="{sip_invite_domain=${sip_from_host}}sofia/gateway/${distributor(cc_blades)}/$2"/> </condition> </extension> </include> then even though the expression/conditions seem to match, none of the digits are being stripped off. Shouldn't this be stripping off digits?? Here's the debug output: Dialplan: sofia/external/16469NNNNNN Regex (PASS) [public_did] ani(16469NNNNNN;phone-context=+1) =~ /^(\+?|\+1?|1?)(\d+).*$/ break=never Dialplan: sofia/external/16469NNNNNN Action set(effective_caller_id_number=16469NNNNNN) Dialplan: sofia/external/16469NNNNNN Action set(effective_caller_id_name=16469NNNNNN) Dialplan: sofia/external/16469NNNNNN Regex (PASS) [public_did] ${sip_to_user}(011390NNNNNNNNNN;phone-context=+39) =~ /^(\+1?|\+|1?|011?)(\d+).*$/ break=never Dialplan: sofia/external/16469NNNNNN Action set(continue_on_fail=false) Dialplan: sofia/external/16469NNNNNN Action set(hangup_after_bridge=true) Dialplan: sofia/external/16469NNNNNN Action set(domain_name=208.72.186.166) Dialplan: sofia/external/16469NNNNNN Action set(bypass_media=true) Dialplan: sofia/external/16469NNNNNN Action limit_hash(in cc_blades 4200 !USER_BUSY) Dialplan: sofia/external/16469NNNNNN Action bridge({sip_invite_domain=${sip_from_host}}sofia/gateway/${distributor(cc_blades)}/011390NNNNNNNNNN) why're the '1' in the ANI and '011' in the DNIS/sip_to_user being stripped off??? Thanks in Advance, RR On Tue, May 25, 2010 at 6:34 PM, RR <ranjtech@gmail.com> wrote:
Thanks for pointing me in the right direction. What fixed it was adding a '*' which I used to have before but with all these changes I was making I forgot to add it back in. So doing this:
<condition field="${sip_to_user}" expression="^(\+?|\+1?|1?|011?)(390NNNNNNNNNN).*$" break="never">
works Thanks for the help \RR
On Tue, May 25, 2010 at 6:10 PM, Anthony Minessale < anthony.minessale@gmail.com> wrote:
you probably have to remove the $ at the end to allow for the ;params
On Tue, May 25, 2010 at 4:43 PM, RR <ranjtech@gmail.com> wrote:
Hi Anthony,
this is what I see in the debug:
Dialplan: sofia/external/16469NNNNNN Regex (FAIL) [DIDtest] ${sip_to_user}(011390NNNNNNNNNN;phone-context=+39) =~ /^(\+?|\+1?|1?|011?)(390NNNNNNNNNN).$/ break=on-false
and then it moves on to another dialplan xml file.
please note that info app shows:
variable_sip_to_user: [011390NNNNNNNNNN;phone-context=+39]
shouldn't this actually match??
Oh and yes, the copy of FS is pretty old but this is a production system which gets 24 / 7 traffic so the upgrade is being pushed and pushed :(
you think this is simply because it's an old build?
Thanks RR
On Tue, May 25, 2010 at 4:49 PM, Anthony Minessale < anthony.minessale@gmail.com> wrote:
did you turn up the debug (press f8 or type console loglevel debug) The debug logs will show the data being passed into the regex and the results.
P.S. I hope only your example is from years ago and not your copy of FS.
On Tue, May 25, 2010 at 3:40 PM, David Ponzone <david.ponzone@gmail.com
wrote:
Which means there is no @ in the sip: part of the SIP To field. Only in the phone-context part. FS uses the @ to split the strings into pieces, and then in your case, it fails as one is missing.
David Ponzone Direction Technique email: david.ponzone@ipeva.fr tel: 01 74 03 18 97 gsm: 06 66 98 76 34
Service Client IPeva tel: 0811 46 26 26 www.ipeva.fr - www.ipeva-studio.com
*Ce message et toutes les pièces jointes sont confidentiels et établis à l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisée est interdite. Tout message électronique est susceptible d'altération. **IPeva** décline toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié. Si vous n'êtes pas destinataire de ce message, merci de le détruire immédiatement et d'avertir l'expéditeur.* * *
Le 25/05/2010 à 22:28, RR a écrit :
Hi Guys,
Thanks for the quick feedback
David, no we're getting the full URI with the domain part intact, just nothing before the "<" braces
Michael, I already tried the info app and we get
variable_sip_to_user: [011390NNNNNNNNNN;phone-context=+39] variable_sip_to_uri: [011390NNNNNNNNNN; phone-context=+39@208.xx.xxx.xxx:5060]
Thanks RR
On Tue, May 25, 2010 at 4:12 PM, Michael Collins <msc@freeswitch.org>wrote:
On Tue, May 25, 2010 at 12:48 PM, RR <ranjtech@gmail.com> wrote:
> Hello I want to follow up on this example from YEARS ago. I had tried > using the variable "destination_number" but that didn't work, and I figured > that it was because the To: header doesn't have the destination_number but > has just the URI, so I thought I'd use sip_to_user instead. > > We have calls coming in with the following info in the INVITE > > From: "16469NNNNNN" < > sip:16469NNNNNN;phone-context=+1@67.1x.xxx.xxx:5060;user=phone > >;tag=SDru6fc01-gK0c10a887. > To: < > sip:011390NNNNNNNNNN;phone-context=+39@xxx.xxx.xxx.xxx:5060;user=phone > >. > (N and x are obviously being masked for privacy) > > I use this info in the dialplan like so > > <include> > <extension name="DIDtest"> > <condition field="ani" expression="^(\+?|\+1?|1?)(6469NNNNNN).*$" > break="never"> > <action application="set" > data="effective_caller_id_number=$2"/> > <action application="set" > data="effective_caller_id_name=$2"/> > </condition> > <condition field="${sip_to_user}" > expression="^(\+?|\+1?|1?|011?)(390NNNNNNNNNN).$" break="never"> > <action application="set" data="continue_on_fail=false"/> > <action application="set" data="hangup_after_bridge=true"/> > <action application="set" data="domain_name=$${domain}"/> > <action application="set" data="bypass_media=true"/> > <action application="bridge" > data="{sip_invite_domain=${sip_from_host}}sofia/gateway/blade2/$2"/> > </condition> > </extension> > </include> > > However, the calls aren't passing the condition in this dialplan and > thus not being forwarded to "blade2" server. In fact, even the 011 is not > being stripped off. > > What am I doing wrong? >
Create a quick test extension that only does an info dump. (See 9992 in default.xml for an example.) Make a call, look at the info dump, and make sure that what you think you are getting is really what you are getting. :)
-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
_______________________________________________ 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
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire
AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:+19193869900
_______________________________________________ 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
-- Anthony Minessale II
FreeSWITCH http://www.freeswitch.org/ ClueCon http://www.cluecon.com/ Twitter: http://twitter.com/FreeSWITCH_wire
AIM: anthm MSN:anthony_minessale@hotmail.com <MSN%3Aanthony_minessale@hotmail.com> GTALK/JABBER/PAYPAL:anthony.minessale@gmail.com<PAYPAL%3Aanthony.minessale@gmail.com> IRC: irc.freenode.net #freeswitch
FreeSWITCH Developer Conference sip:888@conference.freeswitch.org <sip%3A888@conference.freeswitch.org> googletalk:conf+888@conference.freeswitch.org<googletalk%3Aconf%2B888@conference.freeswitch.org> pstn:+19193869900
_______________________________________________ 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 Tue, May 25, 2010 at 5:27 PM, RR <ranjtech@gmail.com> wrote:
Ok, so I take that back. This seems to only work when the dialplan has a specific ANI and DNIS / destination_number / sip_to_user defined. If this is more general
like
<include> <extension name="public_did"> <condition field="ani" expression="^(\+?|\+1?|1?)(\d+).*$" break="never"> <action application="set" data="effective_caller_id_number=$2"/> <action application="set" data="effective_caller_id_name=$2"/> </condition> <condition field="${sip_to_user}" expression="^(\+1?|\+|1?|011?)(\d+).*$" break="never"> <action application="set" data="continue_on_fail=false"/> <action application="set" data="hangup_after_bridge=true"/> <action application="set" data="domain_name=$${domain}"/> <action application="set" data="bypass_media=true"/> <action application="limit_hash" data="in cc_blades 4200 !USER_BUSY"/> <action application="bridge" data="{sip_invite_domain=${sip_from_host}}sofia/gateway/${distributor(cc_blades)}/$2"/> </condition> </extension> </include>
then even though the expression/conditions seem to match, none of the digits are being stripped off. Shouldn't this be stripping off digits??
Here's the debug output:
Dialplan: sofia/external/16469NNNNNN Regex (PASS) [public_did] ani(16469NNNNNN;phone-context=+1) =~ /^(\+?|\+1?|1?)(\d+).*$/ break=never Dialplan: sofia/external/16469NNNNNN Action set(effective_caller_id_number=16469NNNNNN) Dialplan: sofia/external/16469NNNNNN Action set(effective_caller_id_name=16469NNNNNN) Dialplan: sofia/external/16469NNNNNN Regex (PASS) [public_did] ${sip_to_user}(011390NNNNNNNNNN;phone-context=+39) =~ /^(\+1?|\+|1?|011?)(\d+).*$/ break=never Dialplan: sofia/external/16469NNNNNN Action set(continue_on_fail=false) Dialplan: sofia/external/16469NNNNNN Action set(hangup_after_bridge=true) Dialplan: sofia/external/16469NNNNNN Action set(domain_name=208.72.186.166) Dialplan: sofia/external/16469NNNNNN Action set(bypass_media=true) Dialplan: sofia/external/16469NNNNNN Action limit_hash(in cc_blades 4200 !USER_BUSY) Dialplan: sofia/external/16469NNNNNN Action bridge({sip_invite_domain=${sip_from_host}}sofia/gateway/${distributor(cc_blades)}/011390NNNNNNNNNN)
why're the '1' in the ANI and '011' in the DNIS/sip_to_user being stripped off???
Regex 101 :) The 1 or the 011 are in $1 -MC
Michael, haha, yeah they indeed are. That's why I'm routing based on $2, but I still see the 1 and/or the 011 going through to the "bridge" application. Why?? On Tue, May 25, 2010 at 8:34 PM, Michael Collins <msc@freeswitch.org> wrote:
On Tue, May 25, 2010 at 5:27 PM, RR <ranjtech@gmail.com> wrote:
Ok, so I take that back. This seems to only work when the dialplan has a specific ANI and DNIS / destination_number / sip_to_user defined. If this is more general
like
<include> <extension name="public_did"> <condition field="ani" expression="^(\+?|\+1?|1?)(\d+).*$" break="never"> <action application="set" data="effective_caller_id_number=$2"/> <action application="set" data="effective_caller_id_name=$2"/> </condition> <condition field="${sip_to_user}" expression="^(\+1?|\+|1?|011?)(\d+).*$" break="never"> <action application="set" data="continue_on_fail=false"/> <action application="set" data="hangup_after_bridge=true"/> <action application="set" data="domain_name=$${domain}"/> <action application="set" data="bypass_media=true"/> <action application="limit_hash" data="in cc_blades 4200 !USER_BUSY"/> <action application="bridge" data="{sip_invite_domain=${sip_from_host}}sofia/gateway/${distributor(cc_blades)}/$2"/> </condition> </extension> </include>
then even though the expression/conditions seem to match, none of the digits are being stripped off. Shouldn't this be stripping off digits??
Here's the debug output:
Dialplan: sofia/external/16469NNNNNN Regex (PASS) [public_did] ani(16469NNNNNN;phone-context=+1) =~ /^(\+?|\+1?|1?)(\d+).*$/ break=never Dialplan: sofia/external/16469NNNNNN Action set(effective_caller_id_number=16469NNNNNN) Dialplan: sofia/external/16469NNNNNN Action set(effective_caller_id_name=16469NNNNNN) Dialplan: sofia/external/16469NNNNNN Regex (PASS) [public_did] ${sip_to_user}(011390NNNNNNNNNN;phone-context=+39) =~ /^(\+1?|\+|1?|011?)(\d+).*$/ break=never Dialplan: sofia/external/16469NNNNNN Action set(continue_on_fail=false) Dialplan: sofia/external/16469NNNNNN Action set(hangup_after_bridge=true) Dialplan: sofia/external/16469NNNNNN Action set(domain_name=208.72.186.166) Dialplan: sofia/external/16469NNNNNN Action set(bypass_media=true) Dialplan: sofia/external/16469NNNNNN Action limit_hash(in cc_blades 4200 !USER_BUSY) Dialplan: sofia/external/16469NNNNNN Action bridge({sip_invite_domain=${sip_from_host}}sofia/gateway/${distributor(cc_blades)}/011390NNNNNNNNNN)
why're the '1' in the ANI and '011' in the DNIS/sip_to_user being stripped off???
Regex 101 :)
The 1 or the 011 are in $1 -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
On Tue, May 25, 2010 at 5:44 PM, RR <ranjtech@gmail.com> wrote:
Michael, haha, yeah they indeed are. That's why I'm routing based on $2, but I still see the 1 and/or the 011 going through to the "bridge" application. Why??
Because your regex is wrong. :) It took me a while to figure it out. I'm surprised it worked at all. All the stuff you have inside the first set of parens is not behaving the way you think it should be. If I read your intentions correctly you're trying to strip off leading: + OR +1 OR 1 In the first regex. Correct? If ANI is NANPA-ish then try this in your first regex: ^\+?1?([2-9]\d+).*$ That should strip off leading + and/or 1 and capture just the 10-digit phone number in $1. (Be sure to use $1 and not $2, unless you had your heart set on using $2 in which case wrap the first part of the regex in parens) The other regex is also tricky. I assume you are trying to strip off the same as above as well as 011? Try this: ^\+?1?(011)?([2-9]\d+).*$ Again, if the phone number in question is NANPA then $2 should contain just the 10 digits you want. Play around with that and let us know what happens. Also, don't forget what I said about using regex from the fs_cli. You can test all this stuff yourself. :) -MC
On Tue, May 25, 2010 at 8:34 PM, Michael Collins <msc@freeswitch.org>wrote:
On Tue, May 25, 2010 at 5:27 PM, RR <ranjtech@gmail.com> wrote:
Ok, so I take that back. This seems to only work when the dialplan has a specific ANI and DNIS / destination_number / sip_to_user defined. If this is more general
like
<include> <extension name="public_did"> <condition field="ani" expression="^(\+?|\+1?|1?)(\d+).*$" break="never"> <action application="set" data="effective_caller_id_number=$2"/> <action application="set" data="effective_caller_id_name=$2"/> </condition> <condition field="${sip_to_user}" expression="^(\+1?|\+|1?|011?)(\d+).*$" break="never"> <action application="set" data="continue_on_fail=false"/> <action application="set" data="hangup_after_bridge=true"/> <action application="set" data="domain_name=$${domain}"/> <action application="set" data="bypass_media=true"/> <action application="limit_hash" data="in cc_blades 4200 !USER_BUSY"/> <action application="bridge" data="{sip_invite_domain=${sip_from_host}}sofia/gateway/${distributor(cc_blades)}/$2"/> </condition> </extension> </include>
then even though the expression/conditions seem to match, none of the digits are being stripped off. Shouldn't this be stripping off digits??
Here's the debug output:
Dialplan: sofia/external/16469NNNNNN Regex (PASS) [public_did] ani(16469NNNNNN;phone-context=+1) =~ /^(\+?|\+1?|1?)(\d+).*$/ break=never Dialplan: sofia/external/16469NNNNNN Action set(effective_caller_id_number=16469NNNNNN) Dialplan: sofia/external/16469NNNNNN Action set(effective_caller_id_name=16469NNNNNN) Dialplan: sofia/external/16469NNNNNN Regex (PASS) [public_did] ${sip_to_user}(011390NNNNNNNNNN;phone-context=+39) =~ /^(\+1?|\+|1?|011?)(\d+).*$/ break=never Dialplan: sofia/external/16469NNNNNN Action set(continue_on_fail=false) Dialplan: sofia/external/16469NNNNNN Action set(hangup_after_bridge=true) Dialplan: sofia/external/16469NNNNNN Action set(domain_name=208.72.186.166) Dialplan: sofia/external/16469NNNNNN Action set(bypass_media=true) Dialplan: sofia/external/16469NNNNNN Action limit_hash(in cc_blades 4200 !USER_BUSY) Dialplan: sofia/external/16469NNNNNN Action bridge({sip_invite_domain=${sip_from_host}}sofia/gateway/${distributor(cc_blades)}/011390NNNNNNNNNN)
why're the '1' in the ANI and '011' in the DNIS/sip_to_user being stripped off???
Regex 101 :)
The 1 or the 011 are in $1 -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
_______________________________________________ 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
Michael, Thank you SO SO much for the help. Your regex work perfectly as desired. I had tried what you suggested earlier but I think I might've made a mistake somewhere because I wasn't getting the right results so I resorted to doing the "|" between the prefixes to strip them out thinking maybe FS works by going if it begins + OR +1 OR 011 then remove them but I guess it doesn't as when "\" appears it uses / matches against only the first one of the those as opposed to all of those. Thanks again and sorry for wasting your time ;) Cheers RR On Tue, May 25, 2010 at 9:19 PM, Michael Collins <msc@freeswitch.org> wrote:
On Tue, May 25, 2010 at 5:44 PM, RR <ranjtech@gmail.com> wrote:
Michael, haha, yeah they indeed are. That's why I'm routing based on $2, but I still see the 1 and/or the 011 going through to the "bridge" application. Why??
Because your regex is wrong. :) It took me a while to figure it out. I'm surprised it worked at all. All the stuff you have inside the first set of parens is not behaving the way you think it should be. If I read your intentions correctly you're trying to strip off leading: + OR +1 OR 1
In the first regex. Correct? If ANI is NANPA-ish then try this in your first regex: ^\+?1?([2-9]\d+).*$
That should strip off leading + and/or 1 and capture just the 10-digit phone number in $1. (Be sure to use $1 and not $2, unless you had your heart set on using $2 in which case wrap the first part of the regex in parens)
The other regex is also tricky. I assume you are trying to strip off the same as above as well as 011? Try this: ^\+?1?(011)?([2-9]\d+).*$
Again, if the phone number in question is NANPA then $2 should contain just the 10 digits you want. Play around with that and let us know what happens. Also, don't forget what I said about using regex from the fs_cli. You can test all this stuff yourself. :)
-MC
On Tue, May 25, 2010 at 8:34 PM, Michael Collins <msc@freeswitch.org>wrote:
On Tue, May 25, 2010 at 5:27 PM, RR <ranjtech@gmail.com> wrote:
Ok, so I take that back. This seems to only work when the dialplan has a specific ANI and DNIS / destination_number / sip_to_user defined. If this is more general
like
<include> <extension name="public_did"> <condition field="ani" expression="^(\+?|\+1?|1?)(\d+).*$" break="never"> <action application="set" data="effective_caller_id_number=$2"/> <action application="set" data="effective_caller_id_name=$2"/> </condition> <condition field="${sip_to_user}" expression="^(\+1?|\+|1?|011?)(\d+).*$" break="never"> <action application="set" data="continue_on_fail=false"/> <action application="set" data="hangup_after_bridge=true"/> <action application="set" data="domain_name=$${domain}"/> <action application="set" data="bypass_media=true"/> <action application="limit_hash" data="in cc_blades 4200 !USER_BUSY"/> <action application="bridge" data="{sip_invite_domain=${sip_from_host}}sofia/gateway/${distributor(cc_blades)}/$2"/> </condition> </extension> </include>
then even though the expression/conditions seem to match, none of the digits are being stripped off. Shouldn't this be stripping off digits??
Here's the debug output:
Dialplan: sofia/external/16469NNNNNN Regex (PASS) [public_did] ani(16469NNNNNN;phone-context=+1) =~ /^(\+?|\+1?|1?)(\d+).*$/ break=never Dialplan: sofia/external/16469NNNNNN Action set(effective_caller_id_number=16469NNNNNN) Dialplan: sofia/external/16469NNNNNN Action set(effective_caller_id_name=16469NNNNNN) Dialplan: sofia/external/16469NNNNNN Regex (PASS) [public_did] ${sip_to_user}(011390NNNNNNNNNN;phone-context=+39) =~ /^(\+1?|\+|1?|011?)(\d+).*$/ break=never Dialplan: sofia/external/16469NNNNNN Action set(continue_on_fail=false) Dialplan: sofia/external/16469NNNNNN Action set(hangup_after_bridge=true) Dialplan: sofia/external/16469NNNNNN Action set(domain_name=208.72.186.166) Dialplan: sofia/external/16469NNNNNN Action set(bypass_media=true) Dialplan: sofia/external/16469NNNNNN Action limit_hash(in cc_blades 4200 !USER_BUSY) Dialplan: sofia/external/16469NNNNNN Action bridge({sip_invite_domain=${sip_from_host}}sofia/gateway/${distributor(cc_blades)}/011390NNNNNNNNNN)
why're the '1' in the ANI and '011' in the DNIS/sip_to_user being stripped off???
Regex 101 :)
The 1 or the 011 are in $1 -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
_______________________________________________ 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
It's all good. Now you have to pay it forward. :) -MC Sent from my iPhone On May 25, 2010, at 9:34 PM, RR <ranjtech@gmail.com> wrote:
Michael,
Thank you SO SO much for the help. Your regex work perfectly as desired. I had tried what you suggested earlier but I think I might've made a mistake somewhere because I wasn't getting the right results so I resorted to doing the "|" between the prefixes to strip them out thinking maybe FS works by going if it begins + OR +1 OR 011 then remove them but I guess it doesn't as when "\" appears it uses / matches against only the first one of the those as opposed to all of those.
Thanks again and sorry for wasting your time ;)
Cheers RR
On Tue, May 25, 2010 at 9:19 PM, Michael Collins <msc@freeswitch.org> wrote:
On Tue, May 25, 2010 at 5:44 PM, RR <ranjtech@gmail.com> wrote: Michael, haha, yeah they indeed are. That's why I'm routing based on $2, but I still see the 1 and/or the 011 going through to the "bridge" application. Why?? Because your regex is wrong. :) It took me a while to figure it out. I'm surprised it worked at all. All the stuff you have inside the first set of parens is not behaving the way you think it should be. If I read your intentions correctly you're trying to strip off leading: + OR +1 OR 1
In the first regex. Correct? If ANI is NANPA-ish then try this in your first regex: ^\+?1?([2-9]\d+).*$
That should strip off leading + and/or 1 and capture just the 10- digit phone number in $1. (Be sure to use $1 and not $2, unless you had your heart set on using $2 in which case wrap the first part of the regex in parens)
The other regex is also tricky. I assume you are trying to strip off the same as above as well as 011? Try this: ^\+?1?(011)?([2-9]\d+).*$
Again, if the phone number in question is NANPA then $2 should contain just the 10 digits you want. Play around with that and let us know what happens. Also, don't forget what I said about using regex from the fs_cli. You can test all this stuff yourself. :)
-MC
On Tue, May 25, 2010 at 8:34 PM, Michael Collins <msc@freeswitch.org> wrote:
On Tue, May 25, 2010 at 5:27 PM, RR <ranjtech@gmail.com> wrote: Ok, so I take that back. This seems to only work when the dialplan has a specific ANI and DNIS / destination_number / sip_to_user defined. If this is more general
like
<include> <extension name="public_did"> <condition field="ani" expression="^(\+?|\+1?|1?)(\d+).*$" break="never"> <action application="set" data="effective_caller_id_number= $2"/> <action application="set" data="effective_caller_id_name=$2"/> </condition> <condition field="${sip_to_user}" expression="^(\+1?|\+|1?|011?) (\d+).*$" break="never"> <action application="set" data="continue_on_fail=false"/> <action application="set" data="hangup_after_bridge=true"/> <action application="set" data="domain_name=$${domain}"/> <action application="set" data="bypass_media=true"/> <action application="limit_hash" data="in cc_blades 4200 ! USER_BUSY"/> <action application="bridge" data="{sip_invite_domain=$ {sip_from_host}}sofia/gateway/${distributor(cc_blades)}/$2"/> </condition> </extension> </include>
then even though the expression/conditions seem to match, none of the digits are being stripped off. Shouldn't this be stripping off digits??
Here's the debug output:
Dialplan: sofia/external/16469NNNNNN Regex (PASS) [public_did] ani (16469NNNNNN;phone-context=+1) =~ /^(\+?|\+1?|1?)(\d+).*$/ break=never Dialplan: sofia/external/16469NNNNNN Action set (effective_caller_id_number=16469NNNNNN) Dialplan: sofia/external/16469NNNNNN Action set (effective_caller_id_name=16469NNNNNN) Dialplan: sofia/external/16469NNNNNN Regex (PASS) [public_did] $ {sip_to_user}(011390NNNNNNNNNN;phone-context=+39) =~ /^(\+1?|\+|1?| 011?)(\d+).*$/ break=never Dialplan: sofia/external/16469NNNNNN Action set (continue_on_fail=false) Dialplan: sofia/external/16469NNNNNN Action set (hangup_after_bridge=true) Dialplan: sofia/external/16469NNNNNN Action set(domain_name=208.72.186.166 ) Dialplan: sofia/external/16469NNNNNN Action set(bypass_media=true) Dialplan: sofia/external/16469NNNNNN Action limit_hash(in cc_blades 4200 !USER_BUSY) Dialplan: sofia/external/16469NNNNNN Action bridge ({sip_invite_domain=${sip_from_host}}sofia/gateway/${distributor (cc_blades)}/011390NNNNNNNNNN)
why're the '1' in the ANI and '011' in the DNIS/sip_to_user being stripped off???
Regex 101 :)
The 1 or the 011 are in $1 -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
_______________________________________________ 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
_______________________________________________ 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
are these calls to a registering gateway? On May 26, 2010, at 1:40 AM, Michael S Collins wrote:
It's all good. Now you have to pay it forward. :) -MC
Sent from my iPhone
On May 25, 2010, at 9:34 PM, RR <ranjtech@gmail.com> wrote:
Michael,
Thank you SO SO much for the help. Your regex work perfectly as desired. I had tried what you suggested earlier but I think I might've made a mistake somewhere because I wasn't getting the right results so I resorted to doing the "|" between the prefixes to strip them out thinking maybe FS works by going if it begins + OR +1 OR 011 then remove them but I guess it doesn't as when "\" appears it uses / matches against only the first one of the those as opposed to all of those.
Thanks again and sorry for wasting your time ;)
Cheers RR
On Tue, May 25, 2010 at 9:19 PM, Michael Collins <msc@freeswitch.org> wrote:
On Tue, May 25, 2010 at 5:44 PM, RR <ranjtech@gmail.com> wrote: Michael, haha, yeah they indeed are. That's why I'm routing based on $2, but I still see the 1 and/or the 011 going through to the "bridge" application. Why?? Because your regex is wrong. :) It took me a while to figure it out. I'm surprised it worked at all. All the stuff you have inside the first set of parens is not behaving the way you think it should be. If I read your intentions correctly you're trying to strip off leading: + OR +1 OR 1
In the first regex. Correct? If ANI is NANPA-ish then try this in your first regex: ^\+?1?([2-9]\d+).*$
That should strip off leading + and/or 1 and capture just the 10-digit phone number in $1. (Be sure to use $1 and not $2, unless you had your heart set on using $2 in which case wrap the first part of the regex in parens)
The other regex is also tricky. I assume you are trying to strip off the same as above as well as 011? Try this: ^\+?1?(011)?([2-9]\d+).*$
Again, if the phone number in question is NANPA then $2 should contain just the 10 digits you want. Play around with that and let us know what happens. Also, don't forget what I said about using regex from the fs_cli. You can test all this stuff yourself. :)
-MC
On Tue, May 25, 2010 at 8:34 PM, Michael Collins <msc@freeswitch.org> wrote:
On Tue, May 25, 2010 at 5:27 PM, RR <ranjtech@gmail.com> wrote: Ok, so I take that back. This seems to only work when the dialplan has a specific ANI and DNIS / destination_number / sip_to_user defined. If this is more general
like
<include> <extension name="public_did"> <condition field="ani" expression="^(\+?|\+1?|1?)(\d+).*$" break="never"> <action application="set" data="effective_caller_id_number=$2"/> <action application="set" data="effective_caller_id_name=$2"/> </condition> <condition field="${sip_to_user}" expression="^(\+1?|\+|1?|011?)(\d+).*$" break="never"> <action application="set" data="continue_on_fail=false"/> <action application="set" data="hangup_after_bridge=true"/> <action application="set" data="domain_name=$${domain}"/> <action application="set" data="bypass_media=true"/> <action application="limit_hash" data="in cc_blades 4200 !USER_BUSY"/> <action application="bridge" data="{sip_invite_domain=${sip_from_host}}sofia/gateway/${distributor(cc_blades)}/$2"/> </condition> </extension> </include>
then even though the expression/conditions seem to match, none of the digits are being stripped off. Shouldn't this be stripping off digits??
Here's the debug output:
Dialplan: sofia/external/16469NNNNNN Regex (PASS) [public_did] ani(16469NNNNNN;phone-context=+1) =~ /^(\+?|\+1?|1?)(\d+).*$/ break=never Dialplan: sofia/external/16469NNNNNN Action set(effective_caller_id_number=16469NNNNNN) Dialplan: sofia/external/16469NNNNNN Action set(effective_caller_id_name=16469NNNNNN) Dialplan: sofia/external/16469NNNNNN Regex (PASS) [public_did] ${sip_to_user}(011390NNNNNNNNNN;phone-context=+39) =~ /^(\+1?|\+|1?|011?)(\d+).*$/ break=never Dialplan: sofia/external/16469NNNNNN Action set(continue_on_fail=false) Dialplan: sofia/external/16469NNNNNN Action set(hangup_after_bridge=true) Dialplan: sofia/external/16469NNNNNN Action set(domain_name=208.72.186.166) Dialplan: sofia/external/16469NNNNNN Action set(bypass_media=true) Dialplan: sofia/external/16469NNNNNN Action limit_hash(in cc_blades 4200 !USER_BUSY) Dialplan: sofia/external/16469NNNNNN Action bridge({sip_invite_domain=${sip_from_host}}sofia/gateway/${distributor(cc_blades)}/011390NNNNNNNNNN)
why're the '1' in the ANI and '011' in the DNIS/sip_to_user being stripped off???
Regex 101 :)
The 1 or the 011 are in $1 -MC
hi Mike, no these are calls coming into our network as a result of people calling the DIDs we own and they all terminate into the FS serving as a call distributor. Since a lot of these DIDs are International, we get the numbers come to us in all sorts of weird formats so I needed to normalise them all by removing all sorts of weird stuff and prefixes from them Cheers RR On Wed, May 26, 2010 at 5:41 PM, Michael Jerris <mike@jerris.com> wrote:
are these calls to a registering gateway?
On May 26, 2010, at 1:40 AM, Michael S Collins wrote:
It's all good. Now you have to pay it forward. :) -MC
Sent from my iPhone
On May 25, 2010, at 9:34 PM, RR <ranjtech@gmail.com> wrote:
Michael,
Thank you SO SO much for the help. Your regex work perfectly as desired. I had tried what you suggested earlier but I think I might've made a mistake somewhere because I wasn't getting the right results so I resorted to doing the "|" between the prefixes to strip them out thinking maybe FS works by going if it begins + OR +1 OR 011 then remove them but I guess it doesn't as when "\" appears it uses / matches against only the first one of the those as opposed to all of those.
Thanks again and sorry for wasting your time ;)
Cheers RR
On Tue, May 25, 2010 at 9:19 PM, Michael Collins < <msc@freeswitch.org> msc@freeswitch.org> wrote:
On Tue, May 25, 2010 at 5:44 PM, RR < <ranjtech@gmail.com> ranjtech@gmail.com> wrote:
Michael, haha, yeah they indeed are. That's why I'm routing based on $2, but I still see the 1 and/or the 011 going through to the "bridge" application. Why??
Because your regex is wrong. :) It took me a while to figure it out. I'm surprised it worked at all. All the stuff you have inside the first set of parens is not behaving the way you think it should be. If I read your intentions correctly you're trying to strip off leading: + OR +1 OR 1
In the first regex. Correct? If ANI is NANPA-ish then try this in your first regex: ^\+?1?([2-9]\d+).*$
That should strip off leading + and/or 1 and capture just the 10-digit phone number in $1. (Be sure to use $1 and not $2, unless you had your heart set on using $2 in which case wrap the first part of the regex in parens)
The other regex is also tricky. I assume you are trying to strip off the same as above as well as 011? Try this: ^\+?1?(011)?([2-9]\d+).*$
Again, if the phone number in question is NANPA then $2 should contain just the 10 digits you want. Play around with that and let us know what happens. Also, don't forget what I said about using regex from the fs_cli. You can test all this stuff yourself. :)
-MC
On Tue, May 25, 2010 at 8:34 PM, Michael Collins < <msc@freeswitch.org> msc@freeswitch.org> wrote:
On Tue, May 25, 2010 at 5:27 PM, RR < <ranjtech@gmail.com> ranjtech@gmail.com> wrote:
Ok, so I take that back. This seems to only work when the dialplan has a specific ANI and DNIS / destination_number / sip_to_user defined. If this is more general
like
<include> <extension name="public_did"> <condition field="ani" expression="^(\+?|\+1?|1?)(\d+).*$" break="never"> <action application="set" data="effective_caller_id_number=$2"/> <action application="set" data="effective_caller_id_name=$2"/> </condition> <condition field="${sip_to_user}" expression="^(\+1?|\+|1?|011?)(\d+).*$" break="never"> <action application="set" data="continue_on_fail=false"/> <action application="set" data="hangup_after_bridge=true"/> <action application="set" data="domain_name=$${domain}"/> <action application="set" data="bypass_media=true"/> <action application="limit_hash" data="in cc_blades 4200 !USER_BUSY"/> <action application="bridge" data="{sip_invite_domain=${sip_from_host}}sofia/gateway/${distributor(cc_blades)}/$2"/> </condition> </extension> </include>
then even though the expression/conditions seem to match, none of the digits are being stripped off. Shouldn't this be stripping off digits??
Here's the debug output:
Dialplan: sofia/external/16469NNNNNN Regex (PASS) [public_did] ani(16469NNNNNN;phone-context=+1) =~ /^(\+?|\+1?|1?)(\d+).*$/ break=never Dialplan: sofia/external/16469NNNNNN Action set(effective_caller_id_number=16469NNNNNN) Dialplan: sofia/external/16469NNNNNN Action set(effective_caller_id_name=16469NNNNNN) Dialplan: sofia/external/16469NNNNNN Regex (PASS) [public_did] ${sip_to_user}(011390NNNNNNNNNN;phone-context=+39) =~ /^(\+1?|\+|1?|011?)(\d+).*$/ break=never Dialplan: sofia/external/16469NNNNNN Action set(continue_on_fail=false) Dialplan: sofia/external/16469NNNNNN Action set(hangup_after_bridge=true) Dialplan: sofia/external/16469NNNNNN Action set(domain_name=208.72.186.166) Dialplan: sofia/external/16469NNNNNN Action set(bypass_media=true) Dialplan: sofia/external/16469NNNNNN Action limit_hash(in cc_blades 4200 !USER_BUSY) Dialplan: sofia/external/16469NNNNNN Action bridge({sip_invite_domain=${sip_from_host}}sofia/gateway/${distributor(cc_blades)}/011390NNNNNNNNNN)
why're the '1' in the ANI and '011' in the DNIS/sip_to_user being stripped off???
Regex 101 :)
The 1 or the 011 are in $1 -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
Hi Michael, I have another question for you and I REALLY REALLY apologise for abusing you as a Regex teacher but I have spent 2 hrs on this and can't figure out why this isn't working and believe me I have tried SEVERAL combinations but I can't make this work. the question is, why does the regex ^\+?1?(0[0-1]+)?([32|48|54|55|65]\d+)\;?(phone-context=)?\+?(\d+)?$ match 414xxxxxxxx;phone-context=+41 The intention is to ONLY match numbers that may be +32xxxxxxxxxxxxx, 032xxxxxxxxxxx,01132xxxxxxxxxxxxxx,+01132xxxxxxxxxxxx +48xxxxxxxxxxxxx, 048xxxxxxxxxxx,01148xxxxxxxxxxxxxx,+01148xxxxxxxxxxxx +54xxxxxxxxxxxxx, 054xxxxxxxxxxx,01154xxxxxxxxxxxxxx,+01154xxxxxxxxxxxx etc. why's it matching a number starting with 41? Is this incorrect RegEx implementation in FS or do I not get Regex? Sorry, I'll understand if you don't want to respond or help :) Thanks RR On Wed, May 26, 2010 at 1:40 AM, Michael S Collins <msc@freeswitch.org>wrote:
It's all good. Now you have to pay it forward. :) -MC
Sent from my iPhone
On May 25, 2010, at 9:34 PM, RR <ranjtech@gmail.com> wrote:
Michael,
Thank you SO SO much for the help. Your regex work perfectly as desired. I had tried what you suggested earlier but I think I might've made a mistake somewhere because I wasn't getting the right results so I resorted to doing the "|" between the prefixes to strip them out thinking maybe FS works by going if it begins + OR +1 OR 011 then remove them but I guess it doesn't as when "\" appears it uses / matches against only the first one of the those as opposed to all of those.
Thanks again and sorry for wasting your time ;)
Cheers RR
On Tue, May 25, 2010 at 9:19 PM, Michael Collins < <msc@freeswitch.org> msc@freeswitch.org> wrote:
On Tue, May 25, 2010 at 5:44 PM, RR < <ranjtech@gmail.com> ranjtech@gmail.com> wrote:
Michael, haha, yeah they indeed are. That's why I'm routing based on $2, but I still see the 1 and/or the 011 going through to the "bridge" application. Why??
Because your regex is wrong. :) It took me a while to figure it out. I'm surprised it worked at all. All the stuff you have inside the first set of parens is not behaving the way you think it should be. If I read your intentions correctly you're trying to strip off leading: + OR +1 OR 1
In the first regex. Correct? If ANI is NANPA-ish then try this in your first regex: ^\+?1?([2-9]\d+).*$
That should strip off leading + and/or 1 and capture just the 10-digit phone number in $1. (Be sure to use $1 and not $2, unless you had your heart set on using $2 in which case wrap the first part of the regex in parens)
The other regex is also tricky. I assume you are trying to strip off the same as above as well as 011? Try this: ^\+?1?(011)?([2-9]\d+).*$
Again, if the phone number in question is NANPA then $2 should contain just the 10 digits you want. Play around with that and let us know what happens. Also, don't forget what I said about using regex from the fs_cli. You can test all this stuff yourself. :)
-MC
On Tue, May 25, 2010 at 8:34 PM, Michael Collins < <msc@freeswitch.org> msc@freeswitch.org> wrote:
On Tue, May 25, 2010 at 5:27 PM, RR < <ranjtech@gmail.com> ranjtech@gmail.com> wrote:
Ok, so I take that back. This seems to only work when the dialplan has a specific ANI and DNIS / destination_number / sip_to_user defined. If this is more general
like
<include> <extension name="public_did"> <condition field="ani" expression="^(\+?|\+1?|1?)(\d+).*$" break="never"> <action application="set" data="effective_caller_id_number=$2"/> <action application="set" data="effective_caller_id_name=$2"/> </condition> <condition field="${sip_to_user}" expression="^(\+1?|\+|1?|011?)(\d+).*$" break="never"> <action application="set" data="continue_on_fail=false"/> <action application="set" data="hangup_after_bridge=true"/> <action application="set" data="domain_name=$${domain}"/> <action application="set" data="bypass_media=true"/> <action application="limit_hash" data="in cc_blades 4200 !USER_BUSY"/> <action application="bridge" data="{sip_invite_domain=${sip_from_host}}sofia/gateway/${distributor(cc_blades)}/$2"/> </condition> </extension> </include>
then even though the expression/conditions seem to match, none of the digits are being stripped off. Shouldn't this be stripping off digits??
Here's the debug output:
Dialplan: sofia/external/16469NNNNNN Regex (PASS) [public_did] ani(16469NNNNNN;phone-context=+1) =~ /^(\+?|\+1?|1?)(\d+).*$/ break=never Dialplan: sofia/external/16469NNNNNN Action set(effective_caller_id_number=16469NNNNNN) Dialplan: sofia/external/16469NNNNNN Action set(effective_caller_id_name=16469NNNNNN) Dialplan: sofia/external/16469NNNNNN Regex (PASS) [public_did] ${sip_to_user}(011390NNNNNNNNNN;phone-context=+39) =~ /^(\+1?|\+|1?|011?)(\d+).*$/ break=never Dialplan: sofia/external/16469NNNNNN Action set(continue_on_fail=false) Dialplan: sofia/external/16469NNNNNN Action set(hangup_after_bridge=true) Dialplan: sofia/external/16469NNNNNN Action set(domain_name=208.72.186.166) Dialplan: sofia/external/16469NNNNNN Action set(bypass_media=true) Dialplan: sofia/external/16469NNNNNN Action limit_hash(in cc_blades 4200 !USER_BUSY) Dialplan: sofia/external/16469NNNNNN Action bridge({sip_invite_domain=${sip_from_host}}sofia/gateway/${distributor(cc_blades)}/011390NNNNNNNNNN)
why're the '1' in the ANI and '011' in the DNIS/sip_to_user being stripped off???
Regex 101 :)
The 1 or the 011 are in $1 -MC
_______________________________________________ FreeSWITCH-users mailing list <FreeSWITCH-users@lists.freeswitch.org> FreeSWITCH-users@lists.freeswitch.org <http://lists.freeswitch.org/mailman/listinfo/freeswitch-users> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:<http://lists.freeswitch.org/mailman/options/freeswitch-users> http://lists.freeswitch.org/mailman/options/freeswitch-users <http://www.freeswitch.org>http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list <FreeSWITCH-users@lists.freeswitch.org> FreeSWITCH-users@lists.freeswitch.org <http://lists.freeswitch.org/mailman/listinfo/freeswitch-users> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:<http://lists.freeswitch.org/mailman/options/freeswitch-users> http://lists.freeswitch.org/mailman/options/freeswitch-users <http://www.freeswitch.org>http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list <FreeSWITCH-users@lists.freeswitch.org> FreeSWITCH-users@lists.freeswitch.org <http://lists.freeswitch.org/mailman/listinfo/freeswitch-users> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:<http://lists.freeswitch.org/mailman/options/freeswitch-users> http://lists.freeswitch.org/mailman/options/freeswitch-users <http://www.freeswitch.org>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
_______________________________________________ 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
Is [32|48|54|55|65] correct? Shouldn't it be (32|48|54|55|65) instead? ^\+?1?(0[0-1]+)?((32|48|54|55|65)\d+)\;?(phone-context=)?\+?(\d+)?$ Ron _____ From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of RR Sent: Tuesday, June 01, 2010 6:54 PM To: freeswitch-users@lists.freeswitch.org Subject: Re: [Freeswitch-users] Direct inward dialling Hi Michael, I have another question for you and I REALLY REALLY apologise for abusing you as a Regex teacher but I have spent 2 hrs on this and can't figure out why this isn't working and believe me I have tried SEVERAL combinations but I can't make this work. the question is, why does the regex ^\+?1?(0[0-1]+)?([32|48|54|55|65]\d+)\;?(phone-context=)?\+?(\d+)?$ match 414xxxxxxxx;phone-context=+41 The intention is to ONLY match numbers that may be +32xxxxxxxxxxxxx, 032xxxxxxxxxxx,01132xxxxxxxxxxxxxx,+01132xxxxxxxxxxxx +48xxxxxxxxxxxxx, 048xxxxxxxxxxx,01148xxxxxxxxxxxxxx,+01148xxxxxxxxxxxx +54xxxxxxxxxxxxx, 054xxxxxxxxxxx,01154xxxxxxxxxxxxxx,+01154xxxxxxxxxxxx etc. why's it matching a number starting with 41? Is this incorrect RegEx implementation in FS or do I not get Regex? Sorry, I'll understand if you don't want to respond or help :) Thanks RR On Wed, May 26, 2010 at 1:40 AM, Michael S Collins <msc@freeswitch.org> wrote: It's all good. Now you have to pay it forward. :) -MC Sent from my iPhone On May 25, 2010, at 9:34 PM, RR <ranjtech@gmail.com> wrote: Michael, Thank you SO SO much for the help. Your regex work perfectly as desired. I had tried what you suggested earlier but I think I might've made a mistake somewhere because I wasn't getting the right results so I resorted to doing the "|" between the prefixes to strip them out thinking maybe FS works by going if it begins + OR +1 OR 011 then remove them but I guess it doesn't as when "\" appears it uses / matches against only the first one of the those as opposed to all of those. Thanks again and sorry for wasting your time ;) Cheers RR On Tue, May 25, 2010 at 9:19 PM, Michael Collins < <mailto:msc@freeswitch.org> msc@freeswitch.org> wrote: On Tue, May 25, 2010 at 5:44 PM, RR < <mailto:ranjtech@gmail.com> ranjtech@gmail.com> wrote: Michael, haha, yeah they indeed are. That's why I'm routing based on $2, but I still see the 1 and/or the 011 going through to the "bridge" application. Why?? Because your regex is wrong. :) It took me a while to figure it out. I'm surprised it worked at all. All the stuff you have inside the first set of parens is not behaving the way you think it should be. If I read your intentions correctly you're trying to strip off leading: + OR +1 OR 1 In the first regex. Correct? If ANI is NANPA-ish then try this in your first regex: ^\+?1?([2-9]\d+).*$ That should strip off leading + and/or 1 and capture just the 10-digit phone number in $1. (Be sure to use $1 and not $2, unless you had your heart set on using $2 in which case wrap the first part of the regex in parens) The other regex is also tricky. I assume you are trying to strip off the same as above as well as 011? Try this: ^\+?1?(011)?([2-9]\d+).*$ Again, if the phone number in question is NANPA then $2 should contain just the 10 digits you want. Play around with that and let us know what happens. Also, don't forget what I said about using regex from the fs_cli. You can test all this stuff yourself. :) -MC On Tue, May 25, 2010 at 8:34 PM, Michael Collins < <mailto:msc@freeswitch.org> msc@freeswitch.org> wrote: On Tue, May 25, 2010 at 5:27 PM, RR < <mailto:ranjtech@gmail.com> ranjtech@gmail.com> wrote: Ok, so I take that back. This seems to only work when the dialplan has a specific ANI and DNIS / destination_number / sip_to_user defined. If this is more general like <include> <extension name="public_did"> <condition field="ani" expression="^(\+?|\+1?|1?)(\d+).*$" break="never"> <action application="set" data="effective_caller_id_number=$2"/> <action application="set" data="effective_caller_id_name=$2"/> </condition> <condition field="${sip_to_user}" expression="^(\+1?|\+|1?|011?)(\d+).*$" break="never"> <action application="set" data="continue_on_fail=false"/> <action application="set" data="hangup_after_bridge=true"/> <action application="set" data="domain_name=$${domain}"/> <action application="set" data="bypass_media=true"/> <action application="limit_hash" data="in cc_blades 4200 !USER_BUSY"/> <action application="bridge" data="{sip_invite_domain=${sip_from_host}}sofia/gateway/${distributor(cc_bla des)}/$2"/> </condition> </extension> </include> then even though the expression/conditions seem to match, none of the digits are being stripped off. Shouldn't this be stripping off digits?? Here's the debug output: Dialplan: sofia/external/16469NNNNNN Regex (PASS) [public_did] ani(16469NNNNNN;phone-context=+1) =~ /^(\+?|\+1?|1?)(\d+).*$/ break=never Dialplan: sofia/external/16469NNNNNN Action set(effective_caller_id_number=16469NNNNNN) Dialplan: sofia/external/16469NNNNNN Action set(effective_caller_id_name=16469NNNNNN) Dialplan: sofia/external/16469NNNNNN Regex (PASS) [public_did] ${sip_to_user}(011390NNNNNNNNNN;phone-context=+39) =~ /^(\+1?|\+|1?|011?)(\d+).*$/ break=never Dialplan: sofia/external/16469NNNNNN Action set(continue_on_fail=false) Dialplan: sofia/external/16469NNNNNN Action set(hangup_after_bridge=true) Dialplan: sofia/external/16469NNNNNN Action set(domain_name=208.72.186.166) Dialplan: sofia/external/16469NNNNNN Action set(bypass_media=true) Dialplan: sofia/external/16469NNNNNN Action limit_hash(in cc_blades 4200 !USER_BUSY) Dialplan: sofia/external/16469NNNNNN Action bridge({sip_invite_domain=${sip_from_host}}sofia/gateway/${distributor(cc_bl ades)}/011390NNNNNNNNNN) why're the '1' in the ANI and '011' in the DNIS/sip_to_user being stripped off??? Regex 101 :) The 1 or the 011 are in $1 -MC _______________________________________________ FreeSWITCH-users mailing list <mailto:FreeSWITCH-users@lists.freeswitch.org> FreeSWITCH-users@lists.freeswitch.org <http://lists.freeswitch.org/mailman/listinfo/freeswitch-users> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: <http://lists.freeswitch.org/mailman/options/freeswitch-users> http://lists.freeswitch.org/mailman/options/freeswitch-users <http://www.freeswitch.org> http://www.freeswitch.org _______________________________________________ FreeSWITCH-users mailing list <mailto:FreeSWITCH-users@lists.freeswitch.org> FreeSWITCH-users@lists.freeswitch.org <http://lists.freeswitch.org/mailman/listinfo/freeswitch-users> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: <http://lists.freeswitch.org/mailman/options/freeswitch-users> http://lists.freeswitch.org/mailman/options/freeswitch-users <http://www.freeswitch.org> http://www.freeswitch.org _______________________________________________ FreeSWITCH-users mailing list <mailto:FreeSWITCH-users@lists.freeswitch.org> FreeSWITCH-users@lists.freeswitch.org <http://lists.freeswitch.org/mailman/listinfo/freeswitch-users> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: <http://lists.freeswitch.org/mailman/options/freeswitch-users> http://lists.freeswitch.org/mailman/options/freeswitch-users <http://www.freeswitch.org> 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 _______________________________________________ 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
Hi Ron, Thanks so much for that...I think you may be right. I'm testing this and it seems to be working as expected but will do further testing and let you know. Thanks again, RR On Tue, Jun 1, 2010 at 10:57 PM, Ron McLeod <ron.freeswitch@mcleodnet.com>wrote:
Is [32|48|54|55|65] correct? Shouldn’t it be (32|48|54|55|65) instead?
^\+?1?(0[0-1]+)?((32|48|54|55|65)\d+)\;?(phone-context=)?\+?(\d+)?$
Ron
------------------------------
*From:* freeswitch-users-bounces@lists.freeswitch.org [mailto: freeswitch-users-bounces@lists.freeswitch.org] *On Behalf Of *RR *Sent:* Tuesday, June 01, 2010 6:54 PM *To:* freeswitch-users@lists.freeswitch.org *Subject:* Re: [Freeswitch-users] Direct inward dialling
Hi Michael,
I have another question for you and I REALLY REALLY apologise for abusing you as a Regex teacher but I have spent 2 hrs on this and can't figure out why this isn't working and believe me I have tried SEVERAL combinations but I can't make this work.
the question is, why does the regex
^\+?1?(0[0-1]+)?([32|48|54|55|65]\d+)\;?(phone-context=)?\+?(\d+)?$
match
414xxxxxxxx;phone-context=+41
The intention is to ONLY match numbers that may be
+32xxxxxxxxxxxxx, 032xxxxxxxxxxx,01132xxxxxxxxxxxxxx,+01132xxxxxxxxxxxx
+48xxxxxxxxxxxxx, 048xxxxxxxxxxx,01148xxxxxxxxxxxxxx,+01148xxxxxxxxxxxx
+54xxxxxxxxxxxxx, 054xxxxxxxxxxx,01154xxxxxxxxxxxxxx,+01154xxxxxxxxxxxx
etc.
why's it matching a number starting with 41?
Is this incorrect RegEx implementation in FS or do I not get Regex?
Sorry, I'll understand if you don't want to respond or help :)
Thanks
RR
On Wed, May 26, 2010 at 1:40 AM, Michael S Collins <msc@freeswitch.org> wrote:
It's all good. Now you have to pay it forward. :)
-MC
Sent from my iPhone
On May 25, 2010, at 9:34 PM, RR <ranjtech@gmail.com> wrote:
Michael,
Thank you SO SO much for the help. Your regex work perfectly as desired. I had tried what you suggested earlier but I think I might've made a mistake somewhere because I wasn't getting the right results so I resorted to doing the "|" between the prefixes to strip them out thinking maybe FS works by going if it begins + OR +1 OR 011 then remove them but I guess it doesn't as when "\" appears it uses / matches against only the first one of the those as opposed to all of those.
Thanks again and sorry for wasting your time ;)
Cheers
RR
On Tue, May 25, 2010 at 9:19 PM, Michael Collins < <msc@freeswitch.org> msc@freeswitch.org> wrote:
On Tue, May 25, 2010 at 5:44 PM, RR < <ranjtech@gmail.com> ranjtech@gmail.com> wrote:
Michael, haha, yeah they indeed are. That's why I'm routing based on $2, but I still see the 1 and/or the 011 going through to the "bridge" application. Why??
Because your regex is wrong. :) It took me a while to figure it out. I'm surprised it worked at all. All the stuff you have inside the first set of parens is not behaving the way you think it should be. If I read your intentions correctly you're trying to strip off leading: + OR +1 OR 1
In the first regex. Correct? If ANI is NANPA-ish then try this in your first regex: ^\+?1?([2-9]\d+).*$
That should strip off leading + and/or 1 and capture just the 10-digit phone number in $1. (Be sure to use $1 and not $2, unless you had your heart set on using $2 in which case wrap the first part of the regex in parens)
The other regex is also tricky. I assume you are trying to strip off the same as above as well as 011? Try this: ^\+?1?(011)?([2-9]\d+).*$
Again, if the phone number in question is NANPA then $2 should contain just the 10 digits you want. Play around with that and let us know what happens. Also, don't forget what I said about using regex from the fs_cli. You can test all this stuff yourself. :)
-MC
On Tue, May 25, 2010 at 8:34 PM, Michael Collins < <msc@freeswitch.org> msc@freeswitch.org> wrote:
On Tue, May 25, 2010 at 5:27 PM, RR < <ranjtech@gmail.com> ranjtech@gmail.com> wrote:
Ok, so I take that back. This seems to only work when the dialplan has a specific ANI and DNIS / destination_number / sip_to_user defined. If this is more general
like
<include>
<extension name="public_did">
<condition field="ani" expression="^(\+?|\+1?|1?)(\d+).*$" break="never">
<action application="set" data="effective_caller_id_number=$2"/>
<action application="set" data="effective_caller_id_name=$2"/>
</condition>
<condition field="${sip_to_user}" expression="^(\+1?|\+|1?|011?)(\d+).*$" break="never">
<action application="set" data="continue_on_fail=false"/>
<action application="set" data="hangup_after_bridge=true"/>
<action application="set" data="domain_name=$${domain}"/>
<action application="set" data="bypass_media=true"/>
<action application="limit_hash" data="in cc_blades 4200 !USER_BUSY"/>
<action application="bridge" data="{sip_invite_domain=${sip_from_host}}sofia/gateway/${distributor(cc_blades)}/$2"/>
</condition>
</extension>
</include>
then even though the expression/conditions seem to match, none of the digits are being stripped off. Shouldn't this be stripping off digits??
Here's the debug output:
Dialplan: sofia/external/16469NNNNNN Regex (PASS) [public_did] ani(16469NNNNNN;phone-context=+1) =~ /^(\+?|\+1?|1?)(\d+).*$/ break=never
Dialplan: sofia/external/16469NNNNNN Action set(effective_caller_id_number=16469NNNNNN)
Dialplan: sofia/external/16469NNNNNN Action set(effective_caller_id_name=16469NNNNNN)
Dialplan: sofia/external/16469NNNNNN Regex (PASS) [public_did] ${sip_to_user}(011390NNNNNNNNNN;phone-context=+39) =~ /^(\+1?|\+|1?|011?)(\d+).*$/ break=never
Dialplan: sofia/external/16469NNNNNN Action set(continue_on_fail=false)
Dialplan: sofia/external/16469NNNNNN Action set(hangup_after_bridge=true)
Dialplan: sofia/external/16469NNNNNN Action set(domain_name=208.72.186.166)
Dialplan: sofia/external/16469NNNNNN Action set(bypass_media=true)
Dialplan: sofia/external/16469NNNNNN Action limit_hash(in cc_blades 4200 !USER_BUSY)
Dialplan: sofia/external/16469NNNNNN Action bridge({sip_invite_domain=${sip_from_host}}sofia/gateway/${distributor(cc_blades)}/011390NNNNNNNNNN)
why're the '1' in the ANI and '011' in the DNIS/sip_to_user being stripped off???
Regex 101 :)
The 1 or the 011 are in $1 -MC
_______________________________________________ FreeSWITCH-users mailing list <FreeSWITCH-users@lists.freeswitch.org> FreeSWITCH-users@lists.freeswitch.org <http://lists.freeswitch.org/mailman/listinfo/freeswitch-users> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:<http://lists.freeswitch.org/mailman/options/freeswitch-users> http://lists.freeswitch.org/mailman/options/freeswitch-users <http://www.freeswitch.org>http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list <FreeSWITCH-users@lists.freeswitch.org> FreeSWITCH-users@lists.freeswitch.org <http://lists.freeswitch.org/mailman/listinfo/freeswitch-users> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:<http://lists.freeswitch.org/mailman/options/freeswitch-users> http://lists.freeswitch.org/mailman/options/freeswitch-users <http://www.freeswitch.org>http://www.freeswitch.org
_______________________________________________ FreeSWITCH-users mailing list <FreeSWITCH-users@lists.freeswitch.org> FreeSWITCH-users@lists.freeswitch.org <http://lists.freeswitch.org/mailman/listinfo/freeswitch-users> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:<http://lists.freeswitch.org/mailman/options/freeswitch-users> http://lists.freeswitch.org/mailman/options/freeswitch-users <http://www.freeswitch.org>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
_______________________________________________ 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 Tue, Jun 1, 2010 at 7:57 PM, Ron McLeod <ron.freeswitch@mcleodnet.com>wrote:
Is [32|48|54|55|65] correct? Shouldn’t it be (32|48|54|55|65) instead?
^\+?1?(0[0-1]+)?((32|48|54|55|65)\d+)\;?(phone-context=)?\+?(\d+)?$
Also, you really don't need the dash in [0-1], just do [01] which means "match a 0 or a 1" -MC
On Wed, Jun 2, 2010 at 2:17 PM, Michael Collins <msc@freeswitch.org> wrote:
On Tue, Jun 1, 2010 at 7:57 PM, Ron McLeod <ron.freeswitch@mcleodnet.com>wrote:
Is [32|48|54|55|65] correct? Shouldn’t it be (32|48|54|55|65) instead?
^\+?1?(0[0-1]+)?((32|48|54|55|65)\d+)\;?(phone-context=)?\+?(\d+)?$
Also, you really don't need the dash in [0-1], just do [01] which means "match a 0 or a 1" -MC
Ok cool. Thanks for that. BTW, I've noticed that the regex CLI command doesn't always behave the same way as the core FS engine. A lot of tests that display a different result when testing using the regex command yield different behaviour when one makes a call and how FS behaves/treats the call. Maybe it's a bug in the old version. We're using a very old version of FS
Perhaps you could use an online tool to test your regexes? If I understand correctly, the regexes in FS are all Perl-style regexes and there are a number of online or downloadable tools that will allow you to see the effect of your developing regex on a sample set of data. If this is the case, could anyone recommend a tool? Tom On 2 June 2010 22:17, RR <ranjtech@gmail.com> wrote:
On Wed, Jun 2, 2010 at 2:17 PM, Michael Collins <msc@freeswitch.org>wrote:
On Tue, Jun 1, 2010 at 7:57 PM, Ron McLeod <ron.freeswitch@mcleodnet.com>wrote:
Is [32|48|54|55|65] correct? Shouldn’t it be (32|48|54|55|65) instead?
^\+?1?(0[0-1]+)?((32|48|54|55|65)\d+)\;?(phone-context=)?\+?(\d+)?$
Also, you really don't need the dash in [0-1], just do [01] which means "match a 0 or a 1" -MC
Ok cool. Thanks for that. BTW, I've noticed that the regex CLI command doesn't always behave the same way as the core FS engine. A lot of tests that display a different result when testing using the regex command yield different behaviour when one makes a call and how FS behaves/treats the call. Maybe it's a bug in the old version. We're using a very old version of FS
_______________________________________________ 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
i use this tool http://www.gskinner.com/RegExr/desktop/ Thanks, Stephen C -All of my email addresses go to the same place -Save Paper, think before you print On Mon, Jun 7, 2010 at 10:02 AM, tom strickland <mr.tom.strickland@gmail.com
wrote:
Perhaps you could use an online tool to test your regexes? If I understand correctly, the regexes in FS are all Perl-style regexes and there are a number of online or downloadable tools that will allow you to see the effect of your developing regex on a sample set of data. If this is the case, could anyone recommend a tool?
Tom
On 2 June 2010 22:17, RR <ranjtech@gmail.com> wrote:
On Wed, Jun 2, 2010 at 2:17 PM, Michael Collins <msc@freeswitch.org>wrote:
On Tue, Jun 1, 2010 at 7:57 PM, Ron McLeod <ron.freeswitch@mcleodnet.com
wrote:
Is [32|48|54|55|65] correct? Shouldn’t it be (32|48|54|55|65) instead?
^\+?1?(0[0-1]+)?((32|48|54|55|65)\d+)\;?(phone-context=)?\+?(\d+)?$
Also, you really don't need the dash in [0-1], just do [01] which means "match a 0 or a 1" -MC
Ok cool. Thanks for that. BTW, I've noticed that the regex CLI command doesn't always behave the same way as the core FS engine. A lot of tests that display a different result when testing using the regex command yield different behaviour when one makes a call and how FS behaves/treats the call. Maybe it's a bug in the old version. We're using a very old version of FS
_______________________________________________ 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 Mon, Jun 7, 2010 at 10:17 AM, stephen at stephenjc <stephen@stephenjc.com
wrote:
i use this tool
http://www.gskinner.com/RegExr/desktop/
I use these tools: fs_cli + regex command. ;) -MC
participants (10)
-
Anthony Minessale
-
David Ponzone
-
Michael Collins
-
Michael Jerris
-
Michael S Collins
-
Peter P GMX
-
Ron McLeod
-
RR
-
stephen at stephenjc
-
tom strickland