[SR-Users] Re: Randomize calling number

2023-07-06 Thread Henning Westerholt
Hello Ali,

you can just build the new From URI the way you like it, e.g.:

uac_replace_from("$var(from_user)", sip:$var(from_user)@$fd);

Cheers,

Henning

--
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com

From: Ali Taher 
Sent: Donnerstag, 6. Juli 2023 18:12
To: Henning Westerholt ; Kamailio (SER) - Users Mailing List 

Subject: RE: Randomize calling number

Hi Henning,

Is there a way to change From URI user part without touching the domain ? As I 
can see in uac_replace_from there is an option to either change the display 
part or the whole URI part.

Regards,


From: Henning Westerholt mailto:h...@gilawa.com>>
Sent: Thursday, July 6, 2023 6:42 PM
To: Kamailio (SER) - Users Mailing List 
mailto:sr-users@lists.kamailio.org>>
Cc: Ali Taher mailto:ata...@vanrise.com>>
Subject: RE: Randomize calling number

Hello,

ah, you want to change the From URI user. Yes, uac_replace_from is a common 
approach for that.

This function will change the From URI when you send out the message, you will 
not see it with a xlog in the cfg.
https://www.kamailio.org/wikidocs/tutorials/faq/main/#why-changes-made-to-headers-or-body-are-not-visible-immediately

Regarding sending out the SIP message, a common approach is to use rewrite the 
request URI to the new destination and then use “t_relay” to send it.

Cheers,

Henning

--
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com

From: Ali Taher mailto:ata...@vanrise.com>>
Sent: Donnerstag, 6. Juli 2023 17:02
To: Henning Westerholt mailto:h...@gilawa.com>>
Cc: Kamailio (SER) - Users Mailing List 
mailto:sr-users@lists.kamailio.org>>
Subject: Re: Randomize calling number

Hi Henning,

I used the uac_replace_from() function to replace the fU, but the value is 
still the same when i printed it using xlog.

I also dont know how to send the invite back to the switch. What function to 
use?

Thanks,

Sent from my iPhone

On Jul 6, 2023, at 5:31 PM, Henning Westerholt 
mailto:h...@gilawa.com>> wrote:

Hello,

Not 100% sure if I understood your question correctly.

There are probably many ways. One option is to use the $RANDOM pseudo-variable 
that can generate (pseudo-)random numbers. You can get it to the pattern you 
like with some script operations in the cfg.

Just rewrite the request URI user of the INVITE in Kamailio to the new 
generated number and send it out again.

Cheers,

Henning

--
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com

From: Ali Taher mailto:ata...@vanrise.com>>
Sent: Donnerstag, 6. Juli 2023 15:15
To: sr-users@lists.kamailio.org
Subject: [SR-Users] Randomize calling number

Hello,

What is the best way to change the calling number to a random number (based on 
specific pattern, like number of digits for example) in an invite packet 
without using a database.

So the scenario is :

  1.  receive an invite packet from certain source
  2.  change the calling number
  3.  send back the invite packet including the new calling number to the 
original source.

Regards,
Ali Taher
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Randomize calling number

2023-07-06 Thread Ali Taher
Hi Henning,

Is there a way to change From URI user part without touching the domain ? As I 
can see in uac_replace_from there is an option to either change the display 
part or the whole URI part.

Regards,


From: Henning Westerholt 
Sent: Thursday, July 6, 2023 6:42 PM
To: Kamailio (SER) - Users Mailing List 
Cc: Ali Taher 
Subject: RE: Randomize calling number

Hello,

ah, you want to change the From URI user. Yes, uac_replace_from is a common 
approach for that.

This function will change the From URI when you send out the message, you will 
not see it with a xlog in the cfg.
https://www.kamailio.org/wikidocs/tutorials/faq/main/#why-changes-made-to-headers-or-body-are-not-visible-immediately

Regarding sending out the SIP message, a common approach is to use rewrite the 
request URI to the new destination and then use “t_relay” to send it.

Cheers,

Henning

--
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com

From: Ali Taher mailto:ata...@vanrise.com>>
Sent: Donnerstag, 6. Juli 2023 17:02
To: Henning Westerholt mailto:h...@gilawa.com>>
Cc: Kamailio (SER) - Users Mailing List 
mailto:sr-users@lists.kamailio.org>>
Subject: Re: Randomize calling number

Hi Henning,

I used the uac_replace_from() function to replace the fU, but the value is 
still the same when i printed it using xlog.

I also dont know how to send the invite back to the switch. What function to 
use?

Thanks,

Sent from my iPhone

On Jul 6, 2023, at 5:31 PM, Henning Westerholt 
mailto:h...@gilawa.com>> wrote:

Hello,

Not 100% sure if I understood your question correctly.

There are probably many ways. One option is to use the $RANDOM pseudo-variable 
that can generate (pseudo-)random numbers. You can get it to the pattern you 
like with some script operations in the cfg.

Just rewrite the request URI user of the INVITE in Kamailio to the new 
generated number and send it out again.

Cheers,

Henning

--
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com

From: Ali Taher mailto:ata...@vanrise.com>>
Sent: Donnerstag, 6. Juli 2023 15:15
To: sr-users@lists.kamailio.org
Subject: [SR-Users] Randomize calling number

Hello,

What is the best way to change the calling number to a random number (based on 
specific pattern, like number of digits for example) in an invite packet 
without using a database.

So the scenario is :

  1.  receive an invite packet from certain source
  2.  change the calling number
  3.  send back the invite packet including the new calling number to the 
original source.

Regards,
Ali Taher
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Randomize calling number

2023-07-06 Thread Ali Taher
Thanks Alex,

Yes I'm aware of that, this is just for testing purposes.

Regards,

-Original Message-
From: Alex Balashov  
Sent: Thursday, July 6, 2023 6:37 PM
To: Kamailio (SER) - Users Mailing List 
Subject: [SR-Users] Re: Randomize calling number

You can just modify the domain portion of the RURI, i.e. by manipulating $rd. 
For example, $rd = "some.ip"; Then, t_relay().

However, beware that sending the call back to the same gateway from which it 
came is likely to cause call loops. Proxies don't create new call legs, they 
are just part of the same logical call leg; call leg "A" comes in, and call leg 
"A" goes back out, with the same Call-ID, CSeq, etc. If you send the INVITE 
back to the same gateway that originated the request, it will likely reject it 
since it is literally the same request it itself created.

-- Alex

> On Jul 6, 2023, at 11:02 AM, Ali Taher  wrote:
> 
> Hi Henning,
> 
> I used the uac_replace_from() function to replace the fU, but the value is 
> still the same when i printed it using xlog.
> 
> I also dont know how to send the invite back to the switch. What function to 
> use?
> 
> Thanks,
> 
> Sent from my iPhone
> 
>> On Jul 6, 2023, at 5:31 PM, Henning Westerholt  wrote:
>> 
>> Hello,
>>  Not 100% sure if I understood your question correctly.
>>  There are probably many ways. One option is to use the $RANDOM 
>> pseudo-variable that can generate (pseudo-)random numbers. You can get it to 
>> the pattern you like with some script operations in the cfg.
>>  Just rewrite the request URI user of the INVITE in Kamailio to the new 
>> generated number and send it out again.
>>  Cheers,
>>  Henning
>>  -- Henning Westerholt – https://skalatan.de/blog/ Kamailio services 
>> – https://gilawa.com
>>  From: Ali Taher 
>> Sent: Donnerstag, 6. Juli 2023 15:15
>> To: sr-users@lists.kamailio.org
>> Subject: [SR-Users] Randomize calling number  Hello,  What is the 
>> best way to change the calling number to a random number (based on specific 
>> pattern, like number of digits for example) in an invite packet without 
>> using a database.
>>  So the scenario is :
>> • receive an invite packet from certain source
>> • change the calling number
>> • send back the invite packet including the new calling number to the 
>> original source.
>>  Regards,
>> Ali Taher
> 
> __
> Kamailio - Users Mailing List - Non Commercial Discussions To 
> unsubscribe send an email to sr-users-le...@lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the 
> sender!
> Edit mailing list options or unsubscribe:


--
Alex Balashov
Principal Consultant
Evariste Systems LLC
Web: https://evaristesys.com
Tel: +1-706-510-6800

__
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send 
an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Randomize calling number

2023-07-06 Thread Henning Westerholt
Hello,

ah, you want to change the From URI user. Yes, uac_replace_from is a common 
approach for that.

This function will change the From URI when you send out the message, you will 
not see it with a xlog in the cfg.
https://www.kamailio.org/wikidocs/tutorials/faq/main/#why-changes-made-to-headers-or-body-are-not-visible-immediately

Regarding sending out the SIP message, a common approach is to use rewrite the 
request URI to the new destination and then use “t_relay” to send it.

Cheers,

Henning

--
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com

From: Ali Taher 
Sent: Donnerstag, 6. Juli 2023 17:02
To: Henning Westerholt 
Cc: Kamailio (SER) - Users Mailing List 
Subject: Re: Randomize calling number

Hi Henning,

I used the uac_replace_from() function to replace the fU, but the value is 
still the same when i printed it using xlog.

I also dont know how to send the invite back to the switch. What function to 
use?

Thanks,

Sent from my iPhone


On Jul 6, 2023, at 5:31 PM, Henning Westerholt 
mailto:h...@gilawa.com>> wrote:

Hello,

Not 100% sure if I understood your question correctly.

There are probably many ways. One option is to use the $RANDOM pseudo-variable 
that can generate (pseudo-)random numbers. You can get it to the pattern you 
like with some script operations in the cfg.

Just rewrite the request URI user of the INVITE in Kamailio to the new 
generated number and send it out again.

Cheers,

Henning

--
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com

From: Ali Taher mailto:ata...@vanrise.com>>
Sent: Donnerstag, 6. Juli 2023 15:15
To: sr-users@lists.kamailio.org
Subject: [SR-Users] Randomize calling number

Hello,

What is the best way to change the calling number to a random number (based on 
specific pattern, like number of digits for example) in an invite packet 
without using a database.

So the scenario is :

  1.  receive an invite packet from certain source
  2.  change the calling number
  3.  send back the invite packet including the new calling number to the 
original source.

Regards,
Ali Taher
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Randomize calling number

2023-07-06 Thread Alex Balashov
You can just modify the domain portion of the RURI, i.e. by manipulating $rd. 
For example, $rd = "some.ip"; Then, t_relay().

However, beware that sending the call back to the same gateway from which it 
came is likely to cause call loops. Proxies don't create new call legs, they 
are just part of the same logical call leg; call leg "A" comes in, and call leg 
"A" goes back out, with the same Call-ID, CSeq, etc. If you send the INVITE 
back to the same gateway that originated the request, it will likely reject it 
since it is literally the same request it itself created.

-- Alex

> On Jul 6, 2023, at 11:02 AM, Ali Taher  wrote:
> 
> Hi Henning,
> 
> I used the uac_replace_from() function to replace the fU, but the value is 
> still the same when i printed it using xlog.
> 
> I also dont know how to send the invite back to the switch. What function to 
> use?
> 
> Thanks,
> 
> Sent from my iPhone
> 
>> On Jul 6, 2023, at 5:31 PM, Henning Westerholt  wrote:
>> 
>> Hello,
>>  Not 100% sure if I understood your question correctly.
>>  There are probably many ways. One option is to use the $RANDOM 
>> pseudo-variable that can generate (pseudo-)random numbers. You can get it to 
>> the pattern you like with some script operations in the cfg.
>>  Just rewrite the request URI user of the INVITE in Kamailio to the new 
>> generated number and send it out again.
>>  Cheers,
>>  Henning
>>  -- Henning Westerholt – https://skalatan.de/blog/
>> Kamailio services – https://gilawa.com
>>  From: Ali Taher  
>> Sent: Donnerstag, 6. Juli 2023 15:15
>> To: sr-users@lists.kamailio.org
>> Subject: [SR-Users] Randomize calling number
>>  Hello,
>>  What is the best way to change the calling number to a random number (based 
>> on specific pattern, like number of digits for example) in an invite packet 
>> without using a database.
>>  So the scenario is :
>> • receive an invite packet from certain source
>> • change the calling number
>> • send back the invite packet including the new calling number to the 
>> original source.
>>  Regards,
>> Ali Taher
> 
> __
> Kamailio - Users Mailing List - Non Commercial Discussions
> To unsubscribe send an email to sr-users-le...@lists.kamailio.org
> Important: keep the mailing list in the recipients, do not reply only to the 
> sender!
> Edit mailing list options or unsubscribe:


-- 
Alex Balashov
Principal Consultant
Evariste Systems LLC
Web: https://evaristesys.com
Tel: +1-706-510-6800

__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Randomize calling number

2023-07-06 Thread Ali Taher
Hi Henning,

I used the uac_replace_from() function to replace the fU, but the value is 
still the same when i printed it using xlog.

I also dont know how to send the invite back to the switch. What function to 
use?

Thanks,

Sent from my iPhone

On Jul 6, 2023, at 5:31 PM, Henning Westerholt  wrote:


Hello,

Not 100% sure if I understood your question correctly.

There are probably many ways. One option is to use the $RANDOM pseudo-variable 
that can generate (pseudo-)random numbers. You can get it to the pattern you 
like with some script operations in the cfg.

Just rewrite the request URI user of the INVITE in Kamailio to the new 
generated number and send it out again.

Cheers,

Henning

--
Henning Westerholt – https://skalatan.de/blog/
Kamailio services – https://gilawa.com

From: Ali Taher 
Sent: Donnerstag, 6. Juli 2023 15:15
To: sr-users@lists.kamailio.org
Subject: [SR-Users] Randomize calling number

Hello,

What is the best way to change the calling number to a random number (based on 
specific pattern, like number of digits for example) in an invite packet 
without using a database.

So the scenario is :

  *   receive an invite packet from certain source
  *   change the calling number
  *   send back the invite packet including the new calling number to the 
original source.

Regards,
Ali Taher
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Re: Randomize calling number

2023-07-06 Thread Henning Westerholt
Hello,

Not 100% sure if I understood your question correctly.

There are probably many ways. One option is to use the $RANDOM pseudo-variable 
that can generate (pseudo-)random numbers. You can get it to the pattern you 
like with some script operations in the cfg.

Just rewrite the request URI user of the INVITE in Kamailio to the new 
generated number and send it out again.

Cheers,

Henning

--
Henning Westerholt - https://skalatan.de/blog/
Kamailio services - https://gilawa.com

From: Ali Taher 
Sent: Donnerstag, 6. Juli 2023 15:15
To: sr-users@lists.kamailio.org
Subject: [SR-Users] Randomize calling number

Hello,

What is the best way to change the calling number to a random number (based on 
specific pattern, like number of digits for example) in an invite packet 
without using a database.

So the scenario is :

  *   receive an invite packet from certain source
  *   change the calling number
  *   send back the invite packet including the new calling number to the 
original source.

Regards,
Ali Taher
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:


[SR-Users] Randomize calling number

2023-07-06 Thread Ali Taher
Hello,

What is the best way to change the calling number to a random number (based on 
specific pattern, like number of digits for example) in an invite packet 
without using a database.

So the scenario is :

  *   receive an invite packet from certain source
  *   change the calling number
  *   send back the invite packet including the new calling number to the 
original source.

Regards,
Ali Taher
__
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to sr-users-le...@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe: