If you/someone could point me to a document as to how to manipulate the SIP header programatically, I really appreciate it. All the documents I read show to set things with static values, for example, for send or forward it shows forward("UDP:1.2.3.4:5060"), what if the decision making of what protocol/dst/port should be used is a variable that should be determined during the processing of the message itself. Let me give a concrete example:
I get a message destined for user@somedoamin.com, I need to be able to determine the host for that domain, depending on what the host is I need to use either TCP or UDP, besides let's say, somedomain.com resolves to two IP addresses, I also need to try the first IP and if it fails (IP connectivity-wise) then I try the second one.
I really appreciate any pointer/assistance.
Ramin
On 9/20/06, Daniel-Constantin Mierla daniel@voice-system.ro wrote:
On 09/19/06 23:21, Ramin Dousti wrote:
Thanks, Daniel.
So according to the document forward_<proto>(host:port) becomes foward(proto:host:port).
But how should I then create a string which replaces the argument of forward_tcp(uri:host):
uri:host, uri:port have been eliminated, because when you give no parameter to forward(), same behavior happen. You can play with rewriteuri() or setdsturi() to make combinations of how to forward the request (or you can use avp_pushto() to achive similar results but with more flexible parameters).
Cheers, Daniel
Ramin Dousti writes:
I get a message destined for user@somedoamin.com, I need to be able to determine the host for that domain, depending on what the host is I need to use either TCP or UDP, besides let's say, somedomain.com resolves to two IP addresses, I also need to try the first IP and if it fails (IP connectivity-wise) then I try the second one.
try configuring your dns (srv records) accordingly. that should be all you need to do.
-- juha
On 9/20/06, Juha Heinanen jh@tutpro.com wrote:
Ramin Dousti writes:
I get a message destined for user@somedoamin.com, I need to be able to determine the host for that domain, depending on what the host is I need to use either TCP or UDP, besides let's say, somedomain.com resolves to two IP addresses, I also need to try the first IP and if it fails (IP connectivity-wise) then I try the second one.
try configuring your dns (srv records) accordingly. that should be all you need to do.
OK, I'll give that a try but from one of the messages I read, I sounded like the auto-failover was not being done. But I'll give that a try and let the list know.
Thank you. Ramin
-- juha
On 9/20/06, Juha Heinanen jh@tutpro.com wrote:
Ramin Dousti writes:
I get a message destined for user@somedoamin.com, I need to be able to determine the host for that domain, depending on what the host is I need to use either TCP or UDP, besides let's say, somedomain.com resolves to two IP addresses, I also need to try the first IP and if it fails (IP connectivity-wise) then I try the second one.
try configuring your dns (srv records) accordingly. that should be all you need to do.
Hi Juha,
Well, I set up NAPTR and SRV records for two proxy hosts with the same weight. What I'm seeing is that the resolution of the NAPTR/SRV/A records is hapening correctly, meaning that it recognizes the protocol that I want it to use, it recognizes the port that I want it to use and it correctly finds the correct IP address; but there is no failover at all. If IP1 is inaccessible the transaction terminates with a failure. What knobs should I be adjusting for it to try the second IP during the original transaction?
Thanks for the help.
Ramin
-- juha
Hi Ramin,
there is no failover based on DNS yet. Is still work on progress.
Regards, bogdan
Ramin Dousti wrote:
On 9/20/06, Juha Heinanen jh@tutpro.com wrote:
Ramin Dousti writes:
I get a message destined for user@somedoamin.com, I need to be
able to
determine the host for that domain, depending on what the host is
I need to
use either TCP or UDP, besides let's say, somedomain.com resolves to two IP addresses, I also need to try the first IP and if it fails (IP connectivity-wise) then I try the second one.
try configuring your dns (srv records) accordingly. that should be all you need to do.
Hi Juha,
Well, I set up NAPTR and SRV records for two proxy hosts with the same weight. What I'm seeing is that the resolution of the NAPTR/SRV/A records is hapening correctly, meaning that it recognizes the protocol that I want it to use, it recognizes the port that I want it to use and it correctly finds the correct IP address; but there is no failover at all. If IP1 is inaccessible the transaction terminates with a failure. What knobs should I be adjusting for it to try the second IP during the original transaction?
Thanks for the help.
Ramin
OK, thanks. I'll wait for the failover and in the meanwhile I'll take a look at the code and see if I can contribute...
On 9/20/06, Bogdan-Andrei Iancu bogdan@voice-system.ro wrote:
Hi Ramin,
there is no failover based on DNS yet. Is still work on progress.
Regards, bogdan
Well, I set up NAPTR and SRV records for two proxy hosts with the same weight. What I'm seeing is that the resolution of the NAPTR/SRV/A records is hapening correctly, meaning that it recognizes the protocol that I want it to use, it recognizes the port that I want it to use and it correctly finds the correct IP address; but there is no failover at all. If IP1 is inaccessible the transaction terminates with a failure. What knobs should I be adjusting for it to try the second IP during the original transaction?
Thanks for the help.
Ramin