Hi All,
I am trying get the 10digit number called in on using the following $var(caller) = $(fu{re.subst,[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]});
I thought I could use a regular expression for the expression in re.subst,expression
Thank you, -Steve
Why not just use $fU?
On Sat, Aug 25, 2018 at 10:46:36PM +0000, Wilkins, Steve wrote:
Hi All,
I am trying get the 10digit number called in on using the following $var(caller) = $(fu{re.subst,[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]});
I thought I could use a regular expression for the expression in re.subst,expression
Thank you, -Steve
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
Hi Alex,
I was thinking that would also give me the IP or FQDN. I should not have assumed that. I will go try it now.
Thank you! -Steve -----Original Message----- From: sr-users sr-users-bounces@lists.kamailio.org On Behalf Of Alex Balashov Sent: Saturday, August 25, 2018 6:51 PM To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org Subject: Re: [SR-Users] regular expression in kamailio
Why not just use $fU?
On Sat, Aug 25, 2018 at 10:46:36PM +0000, Wilkins, Steve wrote:
Hi All,
I am trying get the 10digit number called in on using the following $var(caller) = $(fu{re.subst,[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]});
I thought I could use a regular expression for the expression in re.subst,expression
Thank you, -Steve
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
On Sat, Aug 25, 2018 at 11:07:26PM +0000, Wilkins, Steve wrote:
I was thinking that would also give me the IP or FQDN. I should not have assumed that. I will go try it now.
Ah, no, that's $fu. :-)
Another option: $(fu{nameaddr.uri}{uri.user})
Now, of course, if you are not entirely sure what the format of $fU will be in any given scenario, there are a variety of things you can do to normalise it...
-- Alex
Oh, but I want the 10 digit number. If from is like sip://10000@2223334444, I want 2223334444, not 10000
-----Original Message----- From: sr-users sr-users-bounces@lists.kamailio.org On Behalf Of Alex Balashov Sent: Saturday, August 25, 2018 7:11 PM To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org Subject: Re: [SR-Users] regular expression in kamailio
On Sat, Aug 25, 2018 at 11:07:26PM +0000, Wilkins, Steve wrote:
I was thinking that would also give me the IP or FQDN. I should not have assumed that. I will go try it now.
Ah, no, that's $fu. :-)
Another option: $(fu{nameaddr.uri}{uri.user})
Now, of course, if you are not entirely sure what the format of $fU will be in any given scenario, there are a variety of things you can do to normalise it...
-- Alex
-- Alex Balashov | Principal | Evariste Systems LLC
Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
_______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
On Sat, Aug 25, 2018 at 11:16:29PM +0000, Wilkins, Steve wrote:
Oh, but I want the 10 digit number. If from is like sip://10000@2223334444, I want 2223334444, not 10000
The (abridged) grammar of a SIP URI is:
sip:user@domain[:port]
The calling party number would be in the user part, ordinarily.
If you really want the domain, you're going to get a host/IP address of the calling UAC most likely. That can be accessed via @fd.
Perhaps you can provide an example of the exact From header you see and the portion of it you would like to extract? Because your example makes no sense. :-)
-- Alex
Sorry, bad habit of adding // to everything after :, and it was just example of wanting to get the 10d number out of a string. I will be more concise.
But here is what I am talking about. This is from a tcpdump trace.
From: "Test" sip:2223334444@srv1.phones.com;user=phone;tag=1c993qq2-j4d1-411f-a7c9-11065fce48a2
Thanks Alex, -Steve
-----Original Message----- From: sr-users sr-users-bounces@lists.kamailio.org On Behalf Of Alex Balashov Sent: Saturday, August 25, 2018 7:22 PM To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org Subject: Re: [SR-Users] regular expression in kamailio
On Sat, Aug 25, 2018 at 11:16:29PM +0000, Wilkins, Steve wrote:
Oh, but I want the 10 digit number. If from is like sip://10000@2223334444, I want 2223334444, not 10000
The (abridged) grammar of a SIP URI is:
sip:user@domain[:port]
The calling party number would be in the user part, ordinarily.
If you really want the domain, you're going to get a host/IP address of the calling UAC most likely. That can be accessed via @fd.
Perhaps you can provide an example of the exact From header you see and the portion of it you would like to extract? Because your example makes no sense. :-)
-- Alex
-- Alex Balashov | Principal | Evariste Systems LLC
Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
_______________________________________________ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
On Sat, Aug 25, 2018 at 11:32:21PM +0000, Wilkins, Steve wrote:
Sorry, bad habit of adding // to everything after :, and it was just example of wanting to get the 10d number out of a string. I will be more concise.
But here is what I am talking about. This is from a tcpdump trace.
From: "Test" sip:2223334444@srv1.phones.com;user=phone;tag=1c993qq2-j4d1-411f-a7c9-11065fce48a2
$fU should work for this...
Okay, I will work with it some more. been working since 6AM, maybe I just need to pick it up tomorrow.
Thanks again for your patience and help! -Steve
-----Original Message----- From: sr-users sr-users-bounces@lists.kamailio.org On Behalf Of Alex Balashov Sent: Saturday, August 25, 2018 7:34 PM To: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org Subject: Re: [SR-Users] regular expression in kamailio
On Sat, Aug 25, 2018 at 11:32:21PM +0000, Wilkins, Steve wrote:
Sorry, bad habit of adding // to everything after :, and it was just example of wanting to get the 10d number out of a string. I will be more concise.
But here is what I am talking about. This is from a tcpdump trace.
From: "Test" sip:2223334444@srv1.phones.com;user=phone;tag=1c993qq2-j4d1-411f-a7c9-11065fce48a2
$fU should work for this...