OK, couple more questions regarding my two options. So far I can potentially use to_gw_grp("1") OR I can use the flags AVP to store a flag which dictates what my send_socket will be. Here are my challenges with each:<br>
<br>1 - to_gw_grp("1"). How would I ensure that subsequent in-dialog requests are sent from the same socket as the original INVITE to my ITSP. <br><br>Asterisk --> INVITE --> KAMAILIO --> (next_gw()/to_gw_grp("1")/force_send_socket() --> INVITE --> ITSP<br>
Asterisk --> BYE --> KAMAILIO --> (if(loose_route(){t_relay();}) -- BYE --> ITSP<br><br>How would I call the to_gw_grp("1") in this scenario? Would I just call it after calling loose_route(), but before calling t_relay()?<br>
<br><br>2 - using AVP flags. The AVP is only set after the initial call to next_gw(), how would I have access to this flag for in-dialog requests? I could perhaps store it in a htable with call-id as the key and overwrite the value each time we call next_gw() (in the event there are failures)... just not sure this is the best idea.<br>
<br>Thanks to everyone for your time and effort here.<br><br>Much appreciated!<br><br>-Geoff<br><br><br><div class="gmail_quote">On Fri, Jun 25, 2010 at 7:45 PM, Iņaki Baz Castillo <span dir="ltr"><<a href="mailto:ibc@aliax.net">ibc@aliax.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">2010/6/25 Geoffrey Mina <<a href="mailto:geoffreymina@gmail.com">geoffreymina@gmail.com</a>>:<br>
<div class="im">> OK, I am running into some errors when starting my script:<br>
><br>
> if(to_gw("1")){<br>
> force_send_socket(X.X.X.180:5060);<br>
> }else if(to_gw("3")){<br>
> force_send_socket(X.X.X.179:5060);<br>
> }else if(to_gw("4")){<br>
> force_send_socket(X.X.X.189:5060);<br>
> }<br>
><br>
> Jun 25 16:45:14 atl-sipgateway1 /usr/local/sbin/kamailio[15942]:<br>
> ERROR:core:pv_parse_spec: bad parameters<br>
> Jun 25 16:45:14 atl-sipgateway1 /usr/local/sbin/kamailio[15942]:<br>
> ERROR:core:fixup_pvar: parsing of pseudo variable 1 failed!<br>
> Jun 25 16:45:14 atl-sipgateway1 /usr/local/sbin/kamailio[15942]:<br>
> ERROR:core:fix_actions: fixing failed (code=-1) at cfg line 348<br>
> Jun 25 16:45:14 atl-sipgateway1 /usr/local/sbin/kamailio[15942]:<br>
> CRITICAL:core:fix_expr: fix_actions error<br>
> Jun 25 16:45:14 atl-sipgateway1 /usr/local/sbin/kamailio[15942]:<br>
> ERROR:core:main: failed to fix configuration with err code -1<br>
><br>
><br>
> Perhaps I an confused about how the to_gw() function of the LCR module is to<br>
> be used. In my "gw" table, I have gateways with grp_id 1, 3, and 4. I am<br>
> assuming that is the value I should be checking for in the to_gw() function,<br>
> but it seems to be expecting a pseudo variable or something.<br>
<br>
</div>Theorically (according to the LCR documentation), "to_gw()" must be<br>
used when processing in-dialog requests. However I'm not sure of the<br>
cause of your error, which is exactly the line 384 in your script?<br>
<br>
Anyhow I suggest you a different approach:<br>
<br>
- Set a different flag for each gw (in LCR 'gw' table) depending on<br>
the sending socket that must be used.<br>
- After calling 'next_gw()' inspect the value of the gw flags (stored<br>
in a configured AVP) and choose which 'force_send_socket()' to use.<br>
<font color="#888888"><br>
<br>
--<br>
Iņaki Baz Castillo<br>
<<a href="mailto:ibc@aliax.net">ibc@aliax.net</a>><br>
</font></blockquote></div><br>