Re: [OpenSIPS-Users] B2BUA Transfers Intermittently Working/Not Working (Bug?)

2010-10-28 Thread Anca Vamanu

Hi Brett,

You should have used the script in  scripts/mysql/b2b_create.sql . What 
you have missed is inserting in version table the version number for the 
new tables

INSERT INTO version (table_name, table_version) values ('b2b_entities','1');
INSERT INTO version (table_name, table_version) values ('b2b_logic','1');

Regards,
--

Anca Vamanu
www.voice-system.ro


On 10/28/2010 01:46 AM, Brett Woollum wrote:

Hi Anca,

I tried to install from the 1.6 branch and I am getting errors about 
the database version for b2b_entities:
Oct 27 15:45:30 sip01 /usr/local/sbin/opensips[15672]: 
ERROR:core:db_check_table_version: invalid version 0 for table 
b2b_entities found, expected 1
Oct 27 15:45:30 sip01 /usr/local/sbin/opensips[15672]: 
ERROR:b2b_entities:mod_init: error during table version check
Oct 27 15:45:30 sip01 /usr/local/sbin/opensips[15672]: 
ERROR:core:init_mod: failed to initialize module b2b_entities
Oct 27 15:45:30 sip01 /usr/local/sbin/opensips[15672]: 
ERROR:core:main: error while initializing modules
Oct 27 15:45:30 sip01 /usr/local/sbin/opensips[15672]: 
NOTICE:presence:destroy: destroy module ...


I used /usr/local/sbin/opensipsdbctl create to make the tables.

Is there information available that would tell me what modifications I 
need to make to the b2b_entities table for it to work properly?


Brett Woollum
br...@woollum.com


- Original Message -
From: "Anca Vamanu" 
To: users@lists.opensips.org
Sent: Tuesday, October 26, 2010 4:06:16 AM GMT -08:00 US/Canada Pacific
Subject: Re: [OpenSIPS-Users] B2BUA Transfers Intermittently 
Working/Not Working (Bug?)


Hi Brett,

Sorry, I was mistaken, I tested wrongly with 1.6 the first time. It 
does work with 1.6 also, you can update from the 1.6 branch and check.


Regards,
--
Anca Vamanu
www.voice-system.ro

On 10/26/2010 01:41 PM, Anca Vamanu wrote:

Hi Brett,

I have just tried your scenario with trunk and I see the 200 OK
reply. I have checked with 1.6 and indeed it seems to be a
problem. I think I will backport the changes in these two modules
- even though they are quite a lot, but there is no point in
debugging on old code when this problem is fixed.
So, I suggest for you to update from trunk, at least these two
modules - b2b_entities and b2b_logic.
Be aware that you will have to install the database tables also.

Regards,

-- 
Anca Vamanu

www.voice-system.ro




___ Users mailing list 
Users@lists.opensips.org 
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
   
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] B2BUA Implementation for Transfer

2010-10-28 Thread Anca Vamanu
Hi,

Do you exit the script after calling b2b_init_request? When calling this 
function you should have the following conditions:
- it Invite - is_method("INVITE")
- it initial - !has_totag()
- does not come from the same machine ( in case you have the proxy on 
the same machine and the request generated by the B2BUA will get looped 
back into the script) !(src_ip=="MY_IP" && src_port=="MY_PORT").
Then if you have this you can call the b2b_init_request either at the 
start of the script, as you did, or somewhere lower after 
lookup("location"). You can call it after if you don't want to do any 
other change on the request generated - and it will be sent directly to 
the IP discovered in location.

Regards,

-- 
Anca Vamanu
www.voice-system.ro




On 10/26/2010 09:12 PM, osiris123d wrote:
> I have seen there are a couple of posts about this so I apologize if this
> seems redundant.
>
> I am starting to mess with the B2BUA and am having some issues.  I am trying
> to solve the transfer issue when a local OpenSIPS subcriber is on the phone
> with a PSTN user and wants to transfer the PSTN user to another OpenSIPS
> user.  I have created the refer.xml file and set up the module parameters,
> so all that is fine.  The issue I am seeing are the invites getting sent out
> from OpenSIPS.
>
> If I place my
> b2b_init_request("refer");
> at the very beginning of my route logic before consume_credentials(),
> location() and all that other junk I see that two Invites are sent
>
> Say the user is 4...@irock.com
> The B2B CALL-ID generated message gets sent to the actual IP address of
> irock.com, which it shouldn't.
> Then a correct invite gets sent to 4...@7x.45.x.44 which is the correct info
> that is pulled from the location table, but this invite does not have the
> B2B CALL-ID info in it.  So it seems I have placed the b2b_init_request in
> the wrong spot on my script.
>
>
> Then when I place the b2b_init_request after I execute the location() in my
> route logic I see the following
> two invites
>
> The first invite is the B2B invite with the B2B CALL-ID.  It gets sent
> correctly to 4...@7x.45.x.44 instead of to the actually IP of irock.com.  The
> only problem here is that within the actual TO: field of the sip message it
> is 4...@7x.45.x.44 instead of 4...@irock.com.  So the phone rejects this
> invite with a "SIP/2.0 404 Not Found" since the phone only knows itself as
> 4...@irock.com.
>
> The second invite is as usual the normal invite without the B2B CALL-ID.
>
> So I guess the issue I am having is that dual invites are being sent and the
> B2B is either sending it to the wrong IP address or it is placing the wrong
> domain in the invite for the user.
>

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] [OpenSIPS-Devel] New OpenXCAP release 2.0.0 with support for OMA XDM SIP SIMPLE specifications

2010-10-28 Thread Juha Heinanen
Iñaki Baz Castillo writes:

> So such PUT will be rejected, but the existing document (containing
> external references) will remain *active*.

perhaps you can write an external script so remove the external
references when you change configuration of xcap server.  changing the
config file is an external action too with regards to the running
server.

-- juha

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] OpenSIPS 1.6.3 MySQL Issues

2010-10-28 Thread Dennis Lundstrom
Hi Randall. 
Please verify your my.cnf, so that your MySQL installation create the 
unix-socket, and that the socket-file has the correct attributes, so that the 
OpenSIPS process can read/write.
We are using IP instead of a hostname in the host-part, so Maybe you will omit 
the use of the unix-socket. If you change localhost to 127.0.0.1 ? 

Best regards.

--Dennis Lundström
  

On Oct 20, 2010, at 10:06 AM, Randall Degges wrote:

> Hi everyone,
> 
> This is my first post on the mailing list.
> 
> I'm currently walking through a new OpenSIPS 1.6.3 install on a ubuntu-server 
> 10.04 (64-bit) box. I've purchased Flavio's book (OpenSIPS 1.6) from PacktPub 
> which I was originally following, but it seemed to have some incomplete 
> installation instructions, so I've been using a variety of sources (which 
> I've cited at the end of this email).
> 
> My problem is: I can't get OpenSIPS to start at boot because some part of my 
> MySQL configuration is messed up. Below are links to the appropriate error 
> messages, as well as configuration files, so that you can get a sense of what 
> I'm trying to do here. Also, just as additional information: I'm running 
> MySQL on localhost (the same server that is running OpenSIPS), and I 
> eventually plan to add in radius support for call accounting purposes.
> 
> My error messages from /var/log/syslog: http://pastie.org/1234861
> My /etc/init.d/opensips file: http://pastie.org/1234862
> My /etc/default/opensips file: http://pastie.org/1234863
> My /etc/opensips/opensips.cfg file: http://pastie.org/1234864
> My /etc/opensips/opensipsctlrc file: http://pastie.org/1234869
> 
> The main error (if you don't want to look through the entire startup log) is:
> 
> Oct 20 07:55:09 OS01 /sbin/opensips[2372]: DBG:db_mysql:db_mysql_connect: 
> opening connection: mysql://:x...@localhost/opensips
> Oct 20 07:55:09 OS01 /sbin/opensips[2372]: ERROR:db_mysql:db_mysql_connect: 
> driver error(2002): Can't connect to local MySQL server through socket 
> '/var/run/mysqld/mysqld.sock' (2)
> Oct 20 07:55:09 OS01 /sbin/opensips[2372]: 
> ERROR:db_mysql:db_mysql_new_connection: initial connect failed
> Oct 20 07:55:09 OS01 /sbin/opensips[2372]: ERROR:core:db_do_init: could not 
> add connection to the pool
> Oct 20 07:55:09 OS01 /sbin/opensips[2372]: ERROR:usrloc:register_udomain: 
> failed to open database connection
> Oct 20 07:55:09 OS01 /sbin/opensips[2372]: ERROR:registrar:domain_fixup: 
> failed to register domain
> Oct 20 07:55:09 OS01 /sbin/opensips[2372]: ERROR:core:fix_actions: fixing 
> failed (code=-1) at cfg line 330
> Oct 20 07:55:09 OS01 /sbin/opensips[2372]: CRITICAL:core:fix_expr: 
> fix_actions error
> Oct 20 07:55:09 OS01 /sbin/opensips[2372]: ERROR:core:main: failed to fix 
> configuration with err code -1
> 
> I've already created the appropriate database (opensips) using the command: 
> 'opensipsdbctl create', which I'm assuming set the proper permissions and 
> user passwords for the users 'opensips' and 'opensipsro'.
> 
> As another quick bit of debugging information, here is the following MySQL 
> statement ran on my database:
> 
> mysql> SELECT user, host FROM mysql.user;
> +--+---+
> | user | host  |
> +--+---+
> | root | 127.0.0.1 |
> | debian-sys-maint | localhost |
> | opensips | localhost |
> | opensipsro   | localhost |
> | root | localhost |
> +--+---+
> 5 rows in set (0.00 sec)
> 
> I'm at a loss of what to do to get OpenSIPS to connect to MySQL. I've read 
> through both the official book by Flavio, as well as numerous guides on the 
> websites, and on VoIP-info, but I've still had no luck.
> 
> If anyone can give me some advice or point out a mistake I've made, I'd be 
> extremely grateful!
> 
> Here are some of the references I've used to help me configure my system so 
> far:
> 
> http://www.amazon.com/Building-Telephony-Systems-OpenSIPS-1-6/dp/1849510741/ref=sr_1_1?ie=UTF8&qid=1287561923&sr=8-1
> http://www.voip-info.org/wiki/view/Opensips+Installation,+How+to.
> http://www.mail-archive.com/users@lists.opensips.org/
> 
> Thanks SO much for your time.
> 
> -Randall
> 
> -- 
> Randall Degges
> http://rdegges.com/
> 
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] How much of the normal PBX Functions can be implemented using OpenSIPS, Mediaproxy and maybe SEMS

2010-10-28 Thread Flavio Goncalves
Hi Mike,

It is possible to implement all PBX functions using OpenSIPS. It is not
easy, it depends on your phones and gateways. They have to support several
RFCs such as RFC3515, RFC3891, RFC3892. Check RFC5359 (
http://tools.ietf.org/html/rfc5359) for more details about call flows. I
have successfully implemented most of them including Call Pickup, Call
Forward, Attended and Unattended Transfers. Asterisk is an excellent gateway
when you want to implement all these features. A good phone is also
important. Don't try this with X-Lite.

Best Regards,

Flavio E. Goncalves
CEO - V.Office
Fone: +554830258590/+554884085000
OpenSIPS Bootcamp (New Jersey, NY  Nov. 15-19)



2010/10/24 Mike O'Connor 

> Hi Guys
>
> I've been using OpenSIPS now for about 9 month (after upgrading from
> OpenSER 1.2 used that for about 2 years) for my core SIP routing and
> billing.
>
> I'm now getting questions from customers about Virtual PBX functionality
> and I would like the opinion of the group about how well this could be
> done using OpenSIPS, Mediaproxy and maybe SEMS.
>
> My current core system has voicemail, call forwarding and T38 fax using
> sip forwards to asterisk, but as normal with Asterisk I do get
> occasional calls issues, mostly related to codec negotiation.
>
> I want to be able to have all the normal PBX functions like Auto
> attendant, Call forwarding on busy or absence, Call Park, Call pickup,
> Call transfer, Call waiting, Conference Call, Custom Greeting, Voice
> Mall, Public Addressing, DND, Direct Inward Dial, Busy Lamp. ETC
>
> So your comments requested.
>
> Thanks
> Mike
>
>
>
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Using b2bua top hiding plus dispatcher module

2010-10-28 Thread David Santiago
... the code explained in my previous email...


# Debugging mode:
debug=9
memlog=6
fork=yes
auto_aliases=no
log_stderror=no

disable_dns_blacklist=yes

listen=10.122.54.163:5060
# alias=OSIPS_REALM
#port=OSIPS_PORT


sip_warning=0
#server_header="SRV_SIGNATURE"
#user_agent_header="PP_USER_AGENT"

#mhomed=yes
#memlog=2
check_via=no
dns=off
rev_dns=off
children=8
disable_tcp=yes
log_facility=LOG_LOCAL0
# for more info: opensips -h

# -- module loading --

mpath="/opt/opensipsnotls/lib/opensips/modules/"

#loadmodule "db_mysql.so"
#loadmodule "xlog.so"
loadmodule "textops.so"
loadmodule "maxfwd.so"
loadmodule "rr.so"
loadmodule "sl.so"
loadmodule "tm.so"
loadmodule "signaling.so"
loadmodule "b2b_entities.so"
loadmodule "b2b_logic.so"
loadmodule "usrloc.so"
loadmodule "registrar.so"
loadmodule "mi_fifo.so"
loadmodule "dispatcher.so"
loadmodule "uri.so"

# - setting module-specific parameters ---
modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")


#modparam("usrloc", "db_url", "mysql://opensips:opensip...@localhost
/opensips")
#modparam("usrloc", "db_mode", 2)

modparam("tm", "pass_provisional_replies", 1)

modparam("dispatcher", "list_file",
"/opt/opensipsnotls/etc/opensips/dispatcher.list")

modparam("b2b_entities", "server_address", "sip:10.122.54.163:5060")

#modparam("b2b_logic", "script_scenario",
"/home/anca/work/opensips/modules/b2b_logic/scenario_script.xml")
#modparam("b2b_logic", "extern_scenario",
"/home/anca/work/opensips/modules/b2b_logic/scenario_extern.xml")
modparam("b2b_entities", "script_req_route", "b2b_request")
modparam("b2b_entities", "script_reply_route", "b2b_reply")

route[b2b_request] {
  xlog("b2b_request ($ci)\n");
}


route[b2b_reply] {
  xlog("b2b_reply ($ci)\n");
}


route {

  xlog("mozaa - Here we go...");

  if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
  };

  if (msg:len >= 2380 ) {
sl_send_reply("513", "Message too big");
exit;
  };

  if (!method=="REGISTER")
record_route();

  # subsequent messages withing a dialog should take the
  # path determined by record-routing
  if (loose_route()) {
# mark routing logic in request
xlog("mozaa - Is loose...");
append_hf("P-hint: rr-enforced\r\n");
route(1);
  };

  xlog("mozaa ft - [$ft]");
  xlog("mozaa fu - [$fu]");
  xlog("mozaa tt - [$tt]");
  xlog("mozaa tu - [$tu]");
  xlog("mozaa du - [$du]");
  xlog("mozaa si - [$si]");
  xlog("mozaa src_ip - [$src_ip]");
  if(has_totag()) {
xlog("mozaa - has to tag");
  }

  if(is_method("INVITE") &&  !has_totag() &&
  !(src_ip == "10.122.54.163" && src_port ==5060)) /* skip Invite
messages generated by the server*/
  {
$var(to) = $tu;
$var(to) = $(var(to){s.substr,4,0});
$var(to) = $(var(to){s.select,0,@});
$var(proxy_public_addr) = $(var(to){s.select,1,@});

xlog("mozaa to - [$var(to)]");
xlog("mozaa contact - $hdr(Contact)");

$var(from) = $fu;
$var(from) = $(var(from){s.substr,4,0});

if($var(to)=="VOIP_PROVIDER_PHONE_NUMBER") {
xlog("mozaa x - SPAIN");
if (
subst('/^From:(.*)sip:[...@]*@[a-zA-Z0-9.]+(.*)$/From:\1sip:34$var(from)\2/ig')
) {
   xlog("mozaa from modified!");
};
} else {
xlog("mozaa x - USA");
}

#ds_select_dst("1", "0");

xlog("mozaa - Launching top hiding scenario");

b2b_init_request("top hiding");
exit;
  };

#  route(1);
}


route[1] {
  # send it out now; use stateful forwarding as it works reliably
  # even for UDP2TCP

  xlog("mozaa - In route 1");
  if (!t_relay()) {
sl_reply_error();
  };
  exit;
}

local_route {

$var(to) = $tu;
$var(to) = $(var(to){s.substr,4,0});
$var(to) = $(var(to){s.select,0,@});

xlog("mozaa ft - local_route - [$ft]");
xlog("mozaa fu - local_route - [$fu]");
xlog("mozaa tt - local_route - [$tt]");
xlog("mozaa tu - local_route - [$tu]");
xlog("mozaa du - local_route - [$du]");
xlog("mozaa - local_route - to - [$var(to)]");

if (is_method("INVITE")) {

  if($var(to)=="VOIP_PROVIDER_PHONE_NUMBER") {
xlog("mozaa x - local_route - SPAIN");
if (
subst('/^From:(.*)sip:[...@]*@[a-zA-Z0-9.]+(.*)$/From:\1sip:34$var(from)\2/ig')
) {
  xlog("mozaa - local_route - from modified!");
};
append_hf("P-Preferred-Service: app1\r\n");
  } else {
xlog("mozaa x - local_route - USA");
append_hf("P-Preferred-Service: app2\r\n");
  }

  ## THIS IS WHERE I TRY TO ESTABLISH THE DESTINATION OF THE INVITE
REQUEST SENT BY THE B2BUA MODULE
  ## TO THE INTERNAL IP OF MY JAIN SLEE SERVER (THE CALLEE IN THE TOP
HIDING SCENARIO EXAMPLE)

  xlog("mozaa - local_route - du before update = $du");
  ##ds_select_dst("1", "0");
  ##$du = "sip:10.253.22.143:5060";
  rewriteuri("sip:10.253.22.143:5060");
  xlog("moz

Re: [OpenSIPS-Users] load_balance debugging

2010-10-28 Thread Саша Александров
Hi Razvan!

Looks like it is working as expected, thank you so much!
I did not have a chance to perform extensive testing, though - will give
more feedback later.

Regards,
Alexandr A. Alexandrov

2010/10/25 Razvan Crainea 

> Hi,
>
> I have just committed a patch that allows load_balance to receive a
> pseudo-variable resource argument. Please update from trunk and try this
> out.
>
> Regards,
> Razvan
>
> On 10/25/2010 01:47 PM, Bogdan-Andrei Iancu wrote:
> > See
> >
> http://sourceforge.net/tracker/?func=detail&aid=2999345&group_id=232389&atid=1086413
> >
> > Regards,
> > Bogdan
> >
> >
> > Alexandr A. Alexandrov wrote:
> >> Hi Bogdan!
> >>
> >> That sounds really great!
> >> Does that request have any link/traking number so I could check its
> >> state from time to time? :-)
> >> I would use it immediately when it is available.
> >> Too bad I'm not a C programmer and can't help here...
> >>
> >> Regards,
> >> Alexandr A. Alexandrov
> >>
> >>
> >> 25.10.2010 14:24, Bogdan-Andrei Iancu:
> >>
> >>> Hi Alexandr,
> >>>
> >>> We have a feature request for adding variable support there - it will
> be
> >>> added in the next weeks.
> >>>
> >>> Regards,
> >>> Bogdan
> >>>
> >>> Саша Александров wrote:
> >>>
> >>>
>  Hi Anca,
> 
>  That sounds bad... :-(
>  Is there any other way to achieve what I'm trying to do?
>  Basically, as long as normal load balancing goes, I also need to
>  select specific destinations for certain numbers.
>  Moreover, the list is quite big. Moreover, the list is changing.
>  Moreover, destinations for certain numbers are changing also. :-)
>  Right now I have an ugly long if-elseif sheet... And the worst thing
>  is that I have to restart opensips to chenge something. :-(
> 
>  Regards,
>  Alexandr
> 
>  2010/10/22 Anca Vamanumailto:a...@opensips.org>>
> 
>    Hi Alexandr,
> 
>    The second parameter of load_balance() function can not be a
>    pseudovariable, but only string.
> 
>    Regards,
> 
>    --
>    Anca Vamanu
>    www.voice-system.ro
> 
> 
> 
> 
>    On 10/22/2010 03:53 PM, Alexandr A. Alexandrov wrote:
>    >   Hi!
>    >
>    >   I have a strange problem with trying to use avps in
> load_balance
>    function.
>    >
>    >   I'm trying to do balancing like this:
>    >
>    >   avp_db_query("select phone, resource from phone_resource
> where
>    >   phone like '%$fU%'", "$avp(i:111);$avp(i:112)");
>    >   avp_print();
>    >   xlog("L_INFO","$fu = $avp(i:111)");
>    >   if ($fu=~$avp(i:111)) {
>    >   xlog("L_INFO", "AAA detected!\n");
>    >   load_balance("1", "$avp(i:112)");
>    >
>    >   Here is what I get in logs:
>    >
>    >   Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>    >   INFO:avpops:ops_print_avp: #011#011#011id=<112>
>    >   Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>    >   INFO:avpops:ops_print_avp: #011#011#011val_str=
>    >   Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>    >   INFO:avpops:ops_print_avp: p=0x7f73f6b251e8, flags=0x0002
>    >   Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>    >   INFO:avpops:ops_print_avp: #011#011#011id=<111>
>    >   Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>    >   INFO:avpops:ops_print_avp: #011#011#011val_str=<1234565677 /
> 10>
>    >   Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>    >   sip:1234565...@xx.xxx.xxx.xxx;user=phone = 1234565677
>    >   Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]: AAA
> detected!
>    >   Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>    >   ERROR:load_balancer:do_load_balance: unknown resource in
> input
>    string
>    >   Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>    >   DBG:core:comp_scriptvar: int 26 : -1 / 0
>    >
>    >   If I write the resource directly, like
>    >   load_balance("1", "aaa");
>    >   everything works fine.
>    >   In the above log you can see that $avp(i:112) contains
> exactly
>    the same
>    >   resource string.
>    >   What is the correct way to do this, or is there a way to
> debug
>    how load
>    >   balancer searches for resources defined in database?
>    >
>    >   Thanks in advance,
>    >   Alexandr A. Alexandrov
>    >
> 
>    ___
>    Users mailing list
>    Users@lists.opensips.org
>    http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> 
> 
> 

Re: [OpenSIPS-Users] B2BUA Implementation for Transfer

2010-10-28 Thread Duane Larson
I am missing a alot of that.  Now I see why I am getting the duplicate
INVITES since I am not exiting after the B2B_INIT

So I need to do something like this

if(is_method("INVITE") && !(src_ip == "OPENSIPS_IP") && !has_totag() ) {
{
location();
b2b_init_request("refer");
exit;
}


I will test that out.



On Thu, Oct 28, 2010 at 3:39 AM, Anca Vamanu  wrote:

> Hi,
>
> Do you exit the script after calling b2b_init_request? When calling this
> function you should have the following conditions:
> - it Invite - is_method("INVITE")
> - it initial - !has_totag()
> - does not come from the same machine ( in case you have the proxy on
> the same machine and the request generated by the B2BUA will get looped
> back into the script) !(src_ip=="MY_IP" && src_port=="MY_PORT").
> Then if you have this you can call the b2b_init_request either at the
> start of the script, as you did, or somewhere lower after
> lookup("location"). You can call it after if you don't want to do any
> other change on the request generated - and it will be sent directly to
> the IP discovered in location.
>
> Regards,
>
> --
> Anca Vamanu
> www.voice-system.ro
>
>
>
>
> On 10/26/2010 09:12 PM, osiris123d wrote:
> > I have seen there are a couple of posts about this so I apologize if this
> > seems redundant.
> >
> > I am starting to mess with the B2BUA and am having some issues.  I am
> trying
> > to solve the transfer issue when a local OpenSIPS subcriber is on the
> phone
> > with a PSTN user and wants to transfer the PSTN user to another OpenSIPS
> > user.  I have created the refer.xml file and set up the module
> parameters,
> > so all that is fine.  The issue I am seeing are the invites getting sent
> out
> > from OpenSIPS.
> >
> > If I place my
> > b2b_init_request("refer");
> > at the very beginning of my route logic before consume_credentials(),
> > location() and all that other junk I see that two Invites are sent
> >
> > Say the user is 4...@irock.com
> > The B2B CALL-ID generated message gets sent to the actual IP address of
> > irock.com, which it shouldn't.
> > Then a correct invite gets sent to 4...@7x.45.x.44 which is the correct
> info
> > that is pulled from the location table, but this invite does not have the
> > B2B CALL-ID info in it.  So it seems I have placed the b2b_init_request
> in
> > the wrong spot on my script.
> >
> >
> > Then when I place the b2b_init_request after I execute the location() in
> my
> > route logic I see the following
> > two invites
> >
> > The first invite is the B2B invite with the B2B CALL-ID.  It gets sent
> > correctly to 4...@7x.45.x.44 instead of to the actually IP of irock.com.
>  The
> > only problem here is that within the actual TO: field of the sip message
> it
> > is 4...@7x.45.x.44 instead of 4...@irock.com.  So the phone rejects this
> > invite with a "SIP/2.0 404 Not Found" since the phone only knows itself
> as
> > 4...@irock.com.
> >
> > The second invite is as usual the normal invite without the B2B CALL-ID.
> >
> > So I guess the issue I am having is that dual invites are being sent and
> the
> > B2B is either sending it to the wrong IP address or it is placing the
> wrong
> > domain in the invite for the user.
> >
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>



-- 
--
*--*--*--*--*--*
Duane
*--*--*--*--*--*
--
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] B2BUA Transfers Intermittently Working/Not Working (Bug?)

2010-10-28 Thread Brett Woollum

Got it. 

I've updated the MySQL table and started OpenSIPS (which is version 1.6 from 
the SVN head). I tried the calling again (with 2 transfers) and I now see the 
202 Accepted message which is correct, but the second transfer is still failing 
with the same error: 

Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: ERROR:core:parse_to: 
unexpected char [<] in status 5: <<<>> . 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: 
ERROR:core:parse_from_header: bad from header 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: 
ERROR:b2b_entities:b2b_prescript_f: cannot parse From header 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: ERROR:core:parse_to: 
unexpected char [<] in status 5: <<<>> . 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: 
ERROR:core:parse_from_header: bad from header 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: 
ERROR:core:pv_get_from_attr: cannot parse From header 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: ERROR:core:parse_to: 
unexpected char [<] in status 5: <<<>> . 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: 
ERROR:core:parse_from_header: bad from header 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: 
ERROR:core:pv_get_from_attr: cannot parse From header 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: ERROR:core:do_assign: no 
value in right expression 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: ERROR:core:do_assign: 
error at line: 314 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: ERROR:core:parse_to: 
unexpected char [<] in status 5: <<<>> . 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: 
ERROR:core:parse_from_header: bad from header 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: ERROR:siptrace:sip_trace: 
cannot parse FROM header 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: ERROR:core:parse_to: 
unexpected char [<] in status 5: <<<>> . 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: 
ERROR:core:parse_from_header: bad from header 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: 
ERROR:core:pv_get_from_attr: cannot parse From header 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: ERROR:core:parse_to: 
unexpected char [<] in status 5: <<<>> . 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: 
ERROR:core:parse_from_header: bad from header 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: ERROR:rr:record_route: 
From parsing failed 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: ERROR:core:parse_to: 
unexpected char [<] in status 5: <<<>> . 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: 
ERROR:core:parse_from_header: bad from header 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: ERROR:tm:new_t: no valid 
From in INVITE 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: ERROR:tm:t_newtran: new_t 
failed 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: ERROR:core:parse_to: 
unexpected char [<] in status 5: <<<>> . 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: 
ERROR:core:parse_from_header: bad from header 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: 
ERROR:siptrace:trace_sl_onreply_out: cannot parse FROM header 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: ERROR:core:parse_to: 
unexpected char [<] in status 5: <<<>> . 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: 
ERROR:core:parse_from_header: bad from header 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: 
ERROR:core:pv_get_from_attr: cannot parse From header 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2999]: ERROR:core:parse_to: 
unexpected char [<] in status 5: <<<>> . 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2999]: 
ERROR:core:parse_from_header: bad from header 
Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2999]: 
ERROR:b2b_entities:b2b_tm_cback: cannot parse From header 

The call trace shows that OpenSIPS is not originating the new call leg out to 
the phone that the call was transferred to (probably because of the error 
above). I don't see any errors in the call trace with regard to the REFER 
message (or any others) sent by the phones. The REFER looks the same with 
different extensions for the first transfer and the second transfer. It seems 
like OpenSIPS is just not handling the second transfer correctly. 


Brett Woollum 
br...@woollum.com 


- Original Message - 
From: "Anca Vamanu"  
To: users@lists.opensips.org 
Sent: Thursday, October 28, 2010 1:31:44 AM GMT -08:00 US/Canada Pacific 
Subject: Re: [OpenSIPS-Users] B2BUA Transfers Intermittently Working/Not 
Working (Bug?) 

Hi Brett, 

You should have used the script in scripts/mysql/b2b_create.sql . What you have 
missed is inserting in version table the version number for the new tables 
INSERT INTO version (table_name, table_version) values ('b2b_entities','1'); 
INSERT INTO version (table_name, table_version) values ('b2b_logic','1'); 

Regards, 
-- 
Anca Vamanu www.voice-system.ro 
On 10/28/2010 01:46 AM, Brett Woollum

Re: [OpenSIPS-Users] B2BUA Transfers Intermittently Working/Not Working (Bug?)

2010-10-28 Thread Ovidiu Sas
opensipsdbctl should be able to properly create the b2b tables in 1.6
now (I defined them in the list of EXTRA_MODULES).

Regards,
Ovidiu Sas

On Thu, Oct 28, 2010 at 5:39 PM, Brett Woollum  wrote:
> Got it.
>
> I've updated the MySQL table and started OpenSIPS (which is version 1.6 from
> the SVN head). I tried the calling again (with 2 transfers) and I now see
> the 202 Accepted message which is correct, but the second transfer is still
> failing with the same error:
>
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: ERROR:core:parse_to:
> unexpected char [<] in status 5: <<<>> .
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]:
> ERROR:core:parse_from_header: bad from header
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]:
> ERROR:b2b_entities:b2b_prescript_f: cannot parse From header
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: ERROR:core:parse_to:
> unexpected char [<] in status 5: <<<>> .
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]:
> ERROR:core:parse_from_header: bad from header
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]:
> ERROR:core:pv_get_from_attr: cannot parse From header
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: ERROR:core:parse_to:
> unexpected char [<] in status 5: <<<>> .
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]:
> ERROR:core:parse_from_header: bad from header
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]:
> ERROR:core:pv_get_from_attr: cannot parse From header
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: ERROR:core:do_assign:
> no value in right expression
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: ERROR:core:do_assign:
> error at line: 314
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: ERROR:core:parse_to:
> unexpected char [<] in status 5: <<<>> .
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]:
> ERROR:core:parse_from_header: bad from header
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]:
> ERROR:siptrace:sip_trace: cannot parse FROM header
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: ERROR:core:parse_to:
> unexpected char [<] in status 5: <<<>> .
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]:
> ERROR:core:parse_from_header: bad from header
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]:
> ERROR:core:pv_get_from_attr: cannot parse From header
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: ERROR:core:parse_to:
> unexpected char [<] in status 5: <<<>> .
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]:
> ERROR:core:parse_from_header: bad from header
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: ERROR:rr:record_route:
> From parsing failed
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: ERROR:core:parse_to:
> unexpected char [<] in status 5: <<<>> .
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]:
> ERROR:core:parse_from_header: bad from header
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: ERROR:tm:new_t: no
> valid From in INVITE
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: ERROR:tm:t_newtran:
> new_t failed
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: ERROR:core:parse_to:
> unexpected char [<] in status 5: <<<>> .
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]:
> ERROR:core:parse_from_header: bad from header
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]:
> ERROR:siptrace:trace_sl_onreply_out: cannot parse FROM header
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]: ERROR:core:parse_to:
> unexpected char [<] in status 5: <<<>> .
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]:
> ERROR:core:parse_from_header: bad from header
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2998]:
> ERROR:core:pv_get_from_attr: cannot parse From header
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2999]: ERROR:core:parse_to:
> unexpected char [<] in status 5: <<<>> .
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2999]:
> ERROR:core:parse_from_header: bad from header
> Oct 28 14:16:40 sip01 /usr/local/sbin/opensips[2999]:
> ERROR:b2b_entities:b2b_tm_cback: cannot parse From header
>
> The call trace shows that OpenSIPS is not originating the new call leg out
> to the phone that the call was transferred to (probably because of the error
> above). I don't see any errors in the call trace with regard to the REFER
> message (or any others) sent by the phones. The REFER looks the same with
> different extensions for the first transfer and the second transfer. It
> seems like OpenSIPS is just not handling the second transfer correctly.
>
> Brett Woollum
> br...@woollum.com
>
>
> - Original Message -
> From: "Anca Vamanu" 
> To: users@lists.opensips.org
> Sent: Thursday, October 28, 2010 1:31:44 AM GMT -08:00 US/Canada Pacific
> Subject: Re: [OpenSIPS-Users] B2BUA Transfers Intermittently Working/Not
> Working (Bug?)
>
> Hi Brett,
>
> You should have used the script in  scripts/mysql/b2b_create.sql . What you
> have missed is inserting 

Re: [OpenSIPS-Users] B2BUA Implementation for Transfer

2010-10-28 Thread osiris123d

Actually Anca for Transfers shouldn't I really be doing the following?

if(is_method("REFER") && !(src_ip == "OPENSIPS_IP") && !has_totag() ) {
{
location();
b2b_init_request("refer");
exit;
}


???

If I do it with "INVITE" instead of "REFER" OPENSIPS does a core dump
because of some Nat-Traversal stuff.
-- 
View this message in context: 
http://opensips-open-sip-server.1449251.n2.nabble.com/B2BUA-Implementation-for-Transfer-tp5675822p5684913.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.com.

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Registrations, Retransmissions and Nonces

2010-10-28 Thread Bradley Falzon
Hi,

I have been debugging an issue with a particularly intermittent fault
and wanted to get some clarification.

Just like the subject says, it's a story about a Stateless Registrar,
a UAC Retransmitting a Registration, and a Nonce policy.

Basically:
1. Client (UAC) sends Register to Server (UAS)
2. UAS Responds with 401 Unauthorised, but includes a
WWW-Authentication header with Realm and Nonce
3. Using the Realm, Nonce and user supplied Username and Password a
Response is generated and sent to the UAS
4. UAS checks the response and:
4.1 It’ll check the Nonce – and yes it is valid
4.2 It’ll query its database <- let’s presume this takes a second or two
5. UAC then retransmits the packet from step 3
6. UAS finally gets results from the database
6.1 Invalidates the Nonce (can’t be used again)
6.2 Responds with 200 OK
7. UAS receives the Retransmitted Register
7.1 It’ll check the Nonce – it is NOT valid
7.2 Respond with 401 Unauthorised.

An example of this created with Net::SIP to reproduce the error is
available: 
http://blog.teambrad.net/wp-content/uploads/2010/10/opensips-registration-nonce-retransmission-example.txt

This issue had been discussed before on this list, I don't have the
exact conversation, however, the advise seemed to be "make the proxy
stateful".

Looking at this flow looks relatively normal, step 6.2 results in a
200 OK, but Step 5 was a retransmission. Because the Nonce was
invalidated, the retransmitted packet now has an invalid nonce (7.1)
and this results in a 401 Unauthorised, with a new nonce (7.2). But
the packet in 7.2 does not contain the parameters 'stale="true"' -
causing the UAC to assume that the credentials are wrong and it won't
re-authenticate.

How can I ensure OpenSIPS (oh, I'm using 1.5.3 btw), sets the
stale="true" flag ?

I am quite new to OpenSIPS in production, so it could very well be my
configuration.

--- Some relevant snippets of code: ---

loadmodule "registrar.so"
modparam("registrar", "default_expires", 3600)
modparam("registrar", "min_expires", 60)
modparam("registrar", "max_expires", 0)
modparam("registrar", "path_mode", 1)
modparam("registrar", "received_avp", "$avp(i:801)")
modparam("registrar","sock_flag",18)
modparam("registrar", "sock_hdr_name", "Local-Sock")
modparam("registrar", "use_path", 1)

loadmodule "db_mysql.so"
modparam("db_mysql", "ping_interval", 300)

loadmodule "auth.so"
modparam("auth", "nonce_expire", 300)
modparam("auth", "rpid_suffix", ";party=calling;id-type=subscriber;screen=yes")
modparam("auth", "rpid_avp", "$avp(s:rpid)")

loadmodule "auth_db.so"
modparam("auth_db", "db_url", "mysql://user:p...@db/opensips")
modparam("auth_db", "user_column", "username")
modparam("auth_db", "domain_column", "domain")
modparam("auth_db", "password_column", "password")
modparam("auth_db", "password_column_2", "ha1b")
modparam("auth_db", "calculate_ha1", 1)
modparam("auth_db", "use_domain", 0)
modparam("auth_db", "load_credentials", "$avp(s:caller_uuid)=uuid")

---

if(is_method("REGISTER"))
{
route(11);
}


---

route[11]
{

if(!search("^Contact:[ ]*\*") && nat_uac_test("19"))
{
fix_nated_register();
setbflag(6);
}

if(!www_authorize("", "subscriber"))
{

#xlog("L_INFO", "Register authentication failed -
M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
www_challenge("", "0");
exit;
}
if(!check_to())
{

xlog("L_INFO", "Spoofed To-URI detected - M=$rm
RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
sl_send_reply("403", "Spoofed To-URI Detected");
exit;
}
consume_credentials();
if(!save("location"))
{

xlog("L_ERR", "Saving contact failed - M=$rm RURI=$ru
F=$fu T=$tu IP=$si ID=$ci\n");
sl_reply_error();
exit;
}
exit;
}

-- 
Bradley Falzon
b...@teambrad.net

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users