Let me ask this question... Does the RURI get consumed when a message is sucessfully delivered, or when a message is attempted to be delivered, but fails?
-----Original Message-----
From: Klaus Darilion [mailto:klaus.mailinglists@pernau.at]
Sent: Wednesday, December 14, 2005 9:48 AM
To: Douglas Garstang
Cc: users(a)openser.org
Subject: Re: [Users] More Routing....
I do not know if it also works this way. I always used the version I
sent in the previous email and it always worked. Thus I never had the
need to change it.
klaus
Douglas Garstang wrote:
> Ok...so... why not just call append_branch("192.168.10.8:5060") without first calling rewritehostport("192.168.10.8")? It seems like redundant information.
>
> -----Original Message-----
> From: Klaus Darilion [mailto:klaus.mailinglists@pernau.at]
> Sent: Wednesday, December 14, 2005 9:01 AM
> To: Douglas Garstang
> Cc: users(a)openser.org
> Subject: Re: [Users] More Routing....
>
>
> Where's the problem? in route[1] or in the failure route?
>
> You need append branch in failure route
>
> klaus
>
> Douglas Garstang wrote:
>
>>Can someone please tell me why the following extremely simple example doesn't first attempt to relay to 192.168.10.7, and then if that fails, try 192.168.10.8? What am I missing here? The documentation says that t_relay() simple sends statefully to the current URI.... seems to be what I am doing. What am I missing? Please help!
>>
>>route(1);
>>
>>route[1] {
>> rewritehostport("192.168.10.7:5060");
>> t_on_failure("2");
>> t_relay();
>>}
>>
>>failure_route[2] {
>> rewritehostport('192.168.10.8:5060");
>> t_relay();
>>}
>>
>>Doug.
>>
>>
>>
>>_______________________________________________
>>Users mailing list
>>Users(a)openser.org
>>http://openser.org/cgi-bin/mailman/listinfo/users
>>
>>
>
>
>
Ok...so... why not just call append_branch("192.168.10.8:5060") without first calling rewritehostport("192.168.10.8")? It seems like redundant information.
-----Original Message-----
From: Klaus Darilion [mailto:klaus.mailinglists@pernau.at]
Sent: Wednesday, December 14, 2005 9:01 AM
To: Douglas Garstang
Cc: users(a)openser.org
Subject: Re: [Users] More Routing....
Where's the problem? in route[1] or in the failure route?
You need append branch in failure route
klaus
Douglas Garstang wrote:
> Can someone please tell me why the following extremely simple example doesn't first attempt to relay to 192.168.10.7, and then if that fails, try 192.168.10.8? What am I missing here? The documentation says that t_relay() simple sends statefully to the current URI.... seems to be what I am doing. What am I missing? Please help!
>
> route(1);
>
> route[1] {
> rewritehostport("192.168.10.7:5060");
> t_on_failure("2");
> t_relay();
> }
>
> failure_route[2] {
> rewritehostport('192.168.10.8:5060");
> t_relay();
> }
>
> Doug.
>
>
>
> _______________________________________________
> Users mailing list
> Users(a)openser.org
> http://openser.org/cgi-bin/mailman/listinfo/users
>
>
Klaus,
Yes. It's necessary to replicate 4 times. We're implementing a 'farm' of Asterisk hosts. Asterisk has a serious limitation where there's no way to share contact info for phones between them. OpenSER seemed like it may be able to address this issue, by accepting registrations from the phones and then 'fanning' them out to ALL the Asterisk boxes. In this way, each Asterisk box knows where every phone is. Up to this point I had just been calling forward() multiple times, once to each Asterisk system and it seemed to work well. With the addition of extra ethernet ports in each Asterisk box (for extra redundancy), it got more complicated as I didn't want to register twice to the same Asterisk system. While I don't think that would cause a problem, I was just trying to make it as bullet-proof as I could.
Doug.
-----Original Message-----
From: Klaus Darilion [mailto:klaus.mailinglists@pernau.at]
Sent: Wednesday, December 14, 2005 9:06 AM
To: Douglas Garstang
Cc: users(a)openser.org
Subject: Re: [Users] RE: failure_route.... I could cry...
That's a difficult setup. I've never did this yet and do not know if it
is possible at all. you can use t_replicate but this works only with 1
host. I think someone solved this using forward_tcp.
is it really necessary to replicate 4 times?
regards
klaus
Douglas Garstang wrote:
> Oh dear... it's failing because as far as t_relay() is concerned, the packet has been delivered, and the transaction is complete, right? If that's the case, how can I also send the REGISTRATION packet to another destination? Can I use forward() with failure_route? Arrgh!.
>
>
>> -----Original Message-----
>>From: Douglas Garstang
>>Sent: Tuesday, December 13, 2005 6:01 PM
>>To: 'users(a)openser.org'
>>Subject: failure_route.... I could cry...
>>
>>I am trying to have OpenSER forward registration requests to multiple Asterisk boxes with failover. Each Asterisk box has two ip addresses. My logic tries to relay to the first IP on the first Asterisk box (192.168.10.100). If that fails, it tries to relay to the second IP on the first Asterisk box (192.168.10.17). It then goes on and repeats the process with another Asterisk box who's IP's are 192.168.10.10.101 and 192.168.10.8.
>>
>>Actually the first IP address on each Asterisk system is fake (100 and 101)... that's how I am testing that it will fail to the second one.
>>
>>The openser.cfg below is causing this to be logged to messages:
>>Dec 13 17:50:08 bil-pdev-3 openser[22318]: route10: Asterisk-1, NIC-1
>>Dec 13 17:50:08 bil-pdev-3 openser[22318]: route20: Asterisk-2, NIC-1
>>Dec 13 17:50:08 bil-pdev-3 openser[22318]: ERROR: t_newtran: transaction already in process 0xb6126560 < --- Why?
>>Dec 13 17:50:08 bil-pdev-3 openser[22318]: route20: t_relay returned error <--- Why?
>>Dec 13 17:50:09 bil-pdev-3 openser[22328]: failure21: Failed to register with Asterisk-2, NIC-1
>>Dec 13 17:50:09 bil-pdev-3 openser[22328]: route22: Asterisk-2, NIC-2
>>Dec 13 17:50:09 bil-pdev-3 openser[22328]: route22: End of routine
>>Dec 13 17:50:10 bil-pdev-3 openser[22322]: User local found
>>Dec 13 17:50:10 bil-pdev-3 openser[22320]: User local found
>>
>>Why am I getting the t_newtran and t_relay errors in there? What am I doing wrong? I'm just calling rewritehostport(next-ip), followed by append_branch() and t_relay. In fact something really weird happens. When I have the code there for route[20], failure_route[21] and route[22], it causes the code for the first three routing blocks, route[10], failure_route[11] and route[12] to act differently. It seems to make route20 fail to connect eventhough it comes AFTER it in the code.
>>
>>I'd really appreciate some help! Am I doing something wrong with rewritehostport and append_branch, because quite frankly the docs are terrible.
>>
>>
>> if ( method == REGISTER ) {
>> if ( !www_authorize("voip.com", "subscriber") ) {
>> www_challenge("voip.com", "0");
>> };
>> save("location");
>> route(10);
>> route(20);
>>
>>#
>># First Asterisk System.
>>#
>>
>># Try first IP on this system (fake - will fail)
>>route[10] {
>> xlog ("L_INFO","route10: Asterisk-1, NIC-1");
>> t_on_failure("11");
>> rewritehostport("192.168.10.100:5060");
>> append_branch();
>> if ( !t_relay() ) {
>> xlog ("L_INFO","route10: t_relay returned error");
>> }
>>}
>>
>>failure_route[11] {
>> xlog ("L_INFO","failure11: Failed to register with Asterisk-1, NIC-1");
>> route(12);
>>}
>>
>># Try second IP on this system (real - should work)
>>route[12] {
>> xlog ("L_INFO","route12: Asterisk-1, NIC-2");
>> t_on_failure("13");
>> rewritehostport("192.168.10.17:5060");
>> append_branch();
>> if ( !t_relay() ) {
>> xlog ("L_INFO","route12: t_relay returned error");
>> }
>> xlog ("L_INFO","route12: End of routine");
>> return;
>>}
>>
>>#
>># Second Asterisk System
>>#
>>
>># Try first IP on this system (fake - will fail)
>>route[20] {
>> xlog ("L_INFO","route20: Asterisk-2, NIC-1");
>> t_on_failure("21");
>> rewritehostport("192.168.10.101:5060");
>> append_branch();
>> if ( !t_relay() ) {
>> xlog ("L_INFO","route20: t_relay returned error");>
>> }
>>}
>>
>>failure_route[21] {
>> xlog ("L_INFO","failure21: Failed to register with Asterisk-2, NIC-1");
>> route(22);
>>}
>>
>># Try second IP on this system (real - should work)
>>route[22] {
>> xlog ("L_INFO","route22: Asterisk-2, NIC-2");
>> t_on_failure("23");
>> rewritehostport("192.168.10.8:5060");
>> append_branch();
>> if ( !t_relay() ) {
>> xlog ("L_INFO","route22: t_relay returned error");
>> }
>> xlog ("L_INFO","route22: End of routine");
>> return;
>>}
>>
>>Doug
>>
>>
>
>
> _______________________________________________
> Users mailing list
> Users(a)openser.org
> http://openser.org/cgi-bin/mailman/listinfo/users
>
>
And you need to call append_branch().... why? The RURI is consumed? Correct? Not sure I understand when it gets consumed.
-----Original Message-----
From: Klaus Darilion [mailto:klaus.mailinglists@pernau.at]
Sent: Wednesday, December 14, 2005 9:32 AM
To: Douglas Garstang
Cc: users(a)openser.org
Subject: Re: [Users] Routing Examples
Then try the same without AVPs - no difference in the basic prinicples:
failure_route[1] {
sethostport("1.2.3.4:5061");
append_branch();
t_relay();
}
Douglas Garstang wrote:
> Ugh... avps....I absolutely can't follow the docs on avp's. I have -no idea- what that's all about.
>
> -----Original Message-----
> From: Klaus Darilion [mailto:klaus.mailinglists@pernau.at]
> Sent: Wednesday, December 14, 2005 8:58 AM
> To: Douglas Garstang
> Cc: users(a)openser.org
> Subject: Re: [Users] Routing Examples
>
>
> Douglas Garstang wrote:
>
>>I'm having a terrible time trying to get failure routes to work. Can someone point me to some USEFUL examples please? The examples that come with OpenSER are trivial. They all use append_branch("sip:user@domain") which in the real world is barely useful. I need to try sending messages to a specified host with the current user's URI.
>>
>>For example, is this the correct usage for trying to connect in sequence to multple destinations?
>>
>>rewritehostport("192.168.10.7:5060");
>>append_branch();
>>t_on_failure("2");
>>t_relay();
>>
>>failure_route[2] {
>> rewritehostport("192.168.10.7:5060");
>> append_branch();
>> t_relay();
>>}
>>
>>The second route is never tried. In general, what should I be doing here?
>>Which is correct?
>
>
>
> I use:
>
> failure_route[1] {
>
> # send to voicemail in format sip:<extension>@1.2.3.4:5061
> avp_pushto("$ruri/username","$extension");
> sethostport("1.2.3.4:5061");
> append_branch();
> t_relay();
> }
>
> klaus
>
>
>>rewritehostport(ip-addr)
>>append_branch()
>>t_relay()
>>
>>or maybe...
>>append_branch(ip-addr)
>>t_relay()
>>
>>or maybe...
>>append_branch(ip-addr1)
>>append_branch(ip-addr2)
>>t_relay()
>>
>>Do you get my point? The docs are really bad and don't cover exactly how this stuff is supposed to be implemented! if I do a google search on this stuff, I get almost no matches. There's no books either. I'm out of ideas.
>>
>>I'm just trying to connect to multiple destinations in sequence....
>>
>>
>>
>>
>>_______________________________________________
>>Users mailing list
>>Users(a)openser.org
>>http://openser.org/cgi-bin/mailman/listinfo/users
>>
>>
>
>
>
Ok, I'm very confused about this. Bogdan mentioned that the RURI is consumed? When is it consumed?
-----Original Message-----
From: Klaus Darilion [mailto:klaus.mailinglists@pernau.at]
Sent: Wednesday, December 14, 2005 9:31 AM
To: Douglas Garstang
Cc: users(a)openser.org
Subject: Re: [Users] More Routing....
append_branch will add a new branch. But the t_relay in failure route
only uses the new branch, as the previous branch is alreaddy terminated.
klaus
Douglas Garstang wrote:
> Klaus,
>
> But, doesn't append_branch cause parallel forking? I don't want parallel forking. If I do parallel forking, the same registration may get delivered to the same Asterisk box twice, and that's not what I want.
>
> Doug.
>
> -----Original Message-----
> From: Klaus Darilion [mailto:klaus.mailinglists@pernau.at]
> Sent: Wednesday, December 14, 2005 9:01 AM
> To: Douglas Garstang
> Cc: users(a)openser.org
> Subject: Re: [Users] More Routing....
>
>
> Where's the problem? in route[1] or in the failure route?
>
> You need append branch in failure route
>
> klaus
>
> Douglas Garstang wrote:
>
>>Can someone please tell me why the following extremely simple example doesn't first attempt to relay to 192.168.10.7, and then if that fails, try 192.168.10.8? What am I missing here? The documentation says that t_relay() simple sends statefully to the current URI.... seems to be what I am doing. What am I missing? Please help!
>>
>>route(1);
>>
>>route[1] {
>> rewritehostport("192.168.10.7:5060");
>> t_on_failure("2");
>> t_relay();
>>}
>>
>>failure_route[2] {
>> rewritehostport('192.168.10.8:5060");
>> t_relay();
>>}
>>
>>Doug.
>>
>>
>>
>>_______________________________________________
>>Users mailing list
>>Users(a)openser.org
>>http://openser.org/cgi-bin/mailman/listinfo/users
>>
>>
>
>
>
Ugh... avps....I absolutely can't follow the docs on avp's. I have -no idea- what that's all about.
-----Original Message-----
From: Klaus Darilion [mailto:klaus.mailinglists@pernau.at]
Sent: Wednesday, December 14, 2005 8:58 AM
To: Douglas Garstang
Cc: users(a)openser.org
Subject: Re: [Users] Routing Examples
Douglas Garstang wrote:
> I'm having a terrible time trying to get failure routes to work. Can someone point me to some USEFUL examples please? The examples that come with OpenSER are trivial. They all use append_branch("sip:user@domain") which in the real world is barely useful. I need to try sending messages to a specified host with the current user's URI.
>
> For example, is this the correct usage for trying to connect in sequence to multple destinations?
>
> rewritehostport("192.168.10.7:5060");
> append_branch();
> t_on_failure("2");
> t_relay();
>
> failure_route[2] {
> rewritehostport("192.168.10.7:5060");
> append_branch();
> t_relay();
> }
>
> The second route is never tried. In general, what should I be doing here?
> Which is correct?
I use:
failure_route[1] {
# send to voicemail in format sip:<extension>@1.2.3.4:5061
avp_pushto("$ruri/username","$extension");
sethostport("1.2.3.4:5061");
append_branch();
t_relay();
}
klaus
>
> rewritehostport(ip-addr)
> append_branch()
> t_relay()
>
> or maybe...
> append_branch(ip-addr)
> t_relay()
>
> or maybe...
> append_branch(ip-addr1)
> append_branch(ip-addr2)
> t_relay()
>
> Do you get my point? The docs are really bad and don't cover exactly how this stuff is supposed to be implemented! if I do a google search on this stuff, I get almost no matches. There's no books either. I'm out of ideas.
>
> I'm just trying to connect to multiple destinations in sequence....
>
>
>
>
> _______________________________________________
> Users mailing list
> Users(a)openser.org
> http://openser.org/cgi-bin/mailman/listinfo/users
>
>
Klaus,
But, doesn't append_branch cause parallel forking? I don't want parallel forking. If I do parallel forking, the same registration may get delivered to the same Asterisk box twice, and that's not what I want.
Doug.
-----Original Message-----
From: Klaus Darilion [mailto:klaus.mailinglists@pernau.at]
Sent: Wednesday, December 14, 2005 9:01 AM
To: Douglas Garstang
Cc: users(a)openser.org
Subject: Re: [Users] More Routing....
Where's the problem? in route[1] or in the failure route?
You need append branch in failure route
klaus
Douglas Garstang wrote:
> Can someone please tell me why the following extremely simple example doesn't first attempt to relay to 192.168.10.7, and then if that fails, try 192.168.10.8? What am I missing here? The documentation says that t_relay() simple sends statefully to the current URI.... seems to be what I am doing. What am I missing? Please help!
>
> route(1);
>
> route[1] {
> rewritehostport("192.168.10.7:5060");
> t_on_failure("2");
> t_relay();
> }
>
> failure_route[2] {
> rewritehostport('192.168.10.8:5060");
> t_relay();
> }
>
> Doug.
>
>
>
> _______________________________________________
> Users mailing list
> Users(a)openser.org
> http://openser.org/cgi-bin/mailman/listinfo/users
>
>
have you tried
http://openser.org/docs/pseudo-variables-1.0.x.html#pv_ds
klaus
Douglas Garstang wrote:
> Is there a pseudo variable that will print all the members of the current destination set? A keyword search for 'destination' in the pseudo variables doc didn't find anything, so I'm guessing not.
>
> -----Original Message-----
> From: Klaus Darilion [mailto:klaus.mailinglists@pernau.at]
> Sent: Wednesday, December 14, 2005 8:54 AM
> To: Douglas Garstang
> Cc: users(a)openser.org
> Subject: Re: [Users] Debug Destionation Set
>
>
> Douglas Garstang wrote:
>
>>Is there a way to see what's in the current destionation set? Either by a command or debug output from OpenSER. It doesn't seem to display anything in debug about the destination set at all.
>
>
> use xlog and pseudo variables
>
> klaus
>
>
>>Doug.
>>
>>
>>_______________________________________________
>>Users mailing list
>>Users(a)openser.org
>>http://openser.org/cgi-bin/mailman/listinfo/users
>>
>>
>
>
>
I compile mysql.so with the following command.
make modules=modules/mysql modules
I have followed the document to configure openuser to use SQL. When I
start openser, the error message below is shown. What does it mean the
module compile flags? Any clue?
openser: ERROR: module compile flags mismatch for
/usr/local/lib/openser/modules/mysql.so core: STATS: Off, EXTRA_DEBUG,
USE_IPV6, USE_TCP, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM,
SHM_MMAP, PKG_MALLOC, F_MALLOC, FAST_LOCK-ADAPTIVE_WAIT module: STATS:
Off, USE_IPV6, USE_TCP, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM,
SHM_MMAP, PKG_MALLOC, F_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
<mailto:users@openser.org>
Bogdan...
Thanks for the info. Ok... well I think I need to do serial forking. I don't want to have a situation where the registration gets delivered to two IP's on the same host because both happen to be available. I don't think Asterisk will have a problem with it, but to be safe I'd like to avoid that. So, back to my original logic of trying first ip on first Asterisk box, if that fails try second ip on first Asterisk box. Then, move onto the next and repeat the process.
With pareallel forking, what happens with failures? Does a failure of any single host in destination set cause an error that can be handled with failure_route? Or, do all hosts have to fail before you can detect an error? How can you determine which one failed?
I don't think parallel forking is what I need, but thanks for clearing that up for me.
Doug.
-----Original Message-----
From: Bogdan-Andrei Iancu [mailto:bogdan@voice-system.ro]
Sent: Wednesday, December 14, 2005 8:55 AM
To: Douglas Garstang
Cc: users(a)openser.org
Subject: Re: [Users] Routing Examples
Hi Doug,
if you have:
rewritehostport("192.168.10.7:5060");
t_on_failure("2");
t_relay();
failure_route[2] {
rewritehostport("192.168.10.7:5060");
append_branch();
t_relay();
}
you do serial forking - try first destination and if fails, o for the
second one.
for:
rewritehostport("192.168.10.7:5060");
append_branch("192.168.10.7:5060");
t_relay()
you do parallel forking - the request will be sent in the same time to
all destinations.
regards,
bogdan
Douglas Garstang wrote:
>I'm having a terrible time trying to get failure routes to work. Can someone point me to some USEFUL examples please? The examples that come with OpenSER are trivial. They all use append_branch("sip:user@domain") which in the real world is barely useful. I need to try sending messages to a specified host with the current user's URI.
>
>For example, is this the correct usage for trying to connect in sequence to multple destinations?
>
>rewritehostport("192.168.10.7:5060");
>append_branch();
>t_on_failure("2");
>t_relay();
>
>failure_route[2] {
> rewritehostport("192.168.10.7:5060");
> append_branch();
> t_relay();
>}
>
>The second route is never tried. In general, what should I be doing here?
>Which is correct?
>
>rewritehostport(ip-addr)
>append_branch()
>t_relay()
>
>or maybe...
>append_branch(ip-addr)
>t_relay()
>
>or maybe...
>append_branch(ip-addr1)
>append_branch(ip-addr2)
>t_relay()
>
>Do you get my point? The docs are really bad and don't cover exactly how this stuff is supposed to be implemented! if I do a google search on this stuff, I get almost no matches. There's no books either. I'm out of ideas.
>
>I'm just trying to connect to multiple destinations in sequence....
>
>
>
>
>_______________________________________________
>Users mailing list
>Users(a)openser.org
>http://openser.org/cgi-bin/mailman/listinfo/users
>
>
>