Re: [OpenSIPS-Users] Intercepting a 302 response and dispatching an INVITE to a new destination set

2017-09-05 Thread Alex Balashov
Yes, failure_route is the answer to all your objectives here. You can
intercept the 302, extract what you want from it, create a new branch
and fork the call elsewhere.

-- 
Alex Balashov | Principal | Evariste Systems LLC

Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free) 
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/

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


[OpenSIPS-Users] Intercepting a 302 response and dispatching an INVITE to a new destination set

2017-09-05 Thread Blagovest Buyukliev
Hello,

We are using OpenSIPS 2.3.1 as a proxy to dispatch requests between an external 
network (referred to as "EN") and a few different destination sets of local SIP 
servers (referred to as "LS1", "LS2", "LS3", etc.).

The basic architecture looks like this:

EN <-> OSIPS <-> (LS1, LS2, LS3, ...)

The current setup worked well for us until we implemented a feature in the 
first set of local servers (LS1) which makes them send a "302 Moved 
Temporarily" response to certain INVITEs matching a specific criteria. With 
this feature on, a typical (and unwanted) SIP conversation becomes:

1) EN -> OSIPS: "1 INVITE"
2) OSIPS -> LS1[x]: "1 INVITE" (adds Record-Route and Via headers)
3) LS1[x] -> OSIPS: "100 Trying"
4) LS1[x] -> OSIPS: "302 Moved Temporarily" (request must be handled by a
local server from a different set, say LS3)
5) OSIPS -> EN: "302 Moved Temporarily"
6) EN -> OSIPS: "1 ACK"

The external network simply replies with an ACK to the 302, but doesn't 
initiate a new INVITE to what's indicated in the Contact header of the 302 
response.

To go around this problem, my action plan is to prevent OpenSIPS from passing 
back the 302 to EN in point 5 and instead dispatch the original INVITE to a 
random server from LS3, which would result in a conversation similar to this:

1) EN -> OSIPS: "1 INVITE"
2) OSIPS -> LS1[x]: "1 INVITE" (adds Record-Route and Via headers)
3) LS1[x] -> OSIPS: "100 Trying"
4) LS1[x] -> OSIPS: "302 Moved Temporarily"
5) OSIPS -> LS3[y]: "1 INVITE"
6) LS3[y] -> OSIPS: "200 OK"
7) OSIPS -> EN: "200 OK"
8) EN -> OSIPS: "1 ACK"

However, implementing that behaviour turned out to be very hard, considering my 
limited knowledge of OpenSIPS.

The particular problems that I encountered were:

a) Not being able to drop the 302 from "onreply_route", since the drop() 
function seems to be able to drop only 1xx provisional responses;
b) Not being able to call any of the dispatcher functions for switching to a 
new destination in "onreply_route".

Is there a way to let OpenSIPS handle the 302 not as a normal reply but as a 
failure in "failure_route", where the dispatcher functions can be called?

In general, is the latter conversation flow possible to implement with 
OpenSIPS, or maybe a better solution exists?

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


Re: [OpenSIPS-Users] ACK bug help needed

2017-09-05 Thread Răzvan Crainea

Hi, Brian!

OpenSIPS doesn't need to send an ACK back, it has to relay the 200 OK to 
the caller, and the caller will send the ACK back. Can you confirm you 
are doing record_route() on the initial INVITE?

Also, can you post somewhere a SIP trace/pcap?

Best regards,

Răzvan Crainea
OpenSIPS Developer
www.opensips-solutions.com

On 09/05/2017 12:44 PM, Brian Southworth wrote:


Hi All,

I seem to be having issues with outbound calls, the calls go out and 
the connection is established.


But when the asterisk gateway send the 200OK back from the provider to 
opensips proxy, the proxy doesn’t send the ACK packet back to asterisk 
it just keeps looping it to itself.


Any help would be appreciated.

Regards,

Brian Southworth

Communications Developer

cid:image001.png@01D22CAC.1DCB8580

111 Wilmslow Road

Handforth

Wilmslow

SK9 3ER

T: 0 446677

W: www.clocom.uk __









cid:image002.png@01CDDC62.D8483910 



Like us on Facebook



cid:image003.png@01CDDC62.D8483910



Follow us on Twitter



cid:image004.png@01CDDC62.D8483910 









Clocom is a *green* company. Think, do you need to print this email?

This message contains confidential information and is intended only 
for the individual named. If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail. Please notify 
the sender immediately by e-mail if you have received this e-mail by 
mistake and delete this e-mail from your system. E-mail transmission 
cannot be guaranteed to be secure or error-free as information could 
be intercepted, corrupted, lost, destroyed, arrive late or incomplete, 
or contain viruses. The sender therefore does not accept liability for 
any errors or omissions in the contents of this message, which arise 
as a result of e-mail transmission. If verification is required please 
request a hard-copy version. Clocom UK Ltd, 111 Wilmslow Road, 
Handforth, Cheshire, SK9 3ER www.clocom.uk __




___
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] Need some help adding extra column in acc table in oepsnisp-1.11

2017-09-05 Thread Răzvan Crainea

Yes, you need to create the columns in the database.

Best regards,

Răzvan Crainea
OpenSIPS Developer
www.opensips-solutions.com

On 09/05/2017 12:43 PM, Sasmita Panda wrote:

Hi All ,

        I am using opensips-1.11 with acc module . Trying to add extra 
columns in it to store some other data which is needed for billing .


        I am trying to add like bellow .

modparam("acc", "db_url", "mysql://root:root@x.x.x.x/opensips_1_11")
modparam("acc", "db_flag", 2)
modparam("acc", "log_flag", 3)
modparam("acc", "cdr_flag", 1)
modparam("acc", "db_extra", "from_uri=$fU; to_uri=$tU")


 route{

         if (method == "INVITE") {
                 create_dialog();
                 setflag(1);
                 setflag(2); # do accounting ...
                 record_route();
                 xlog("INBOUND CALL,$dd,$ru,$ci,$fn,$fu");
                 route(10);
                 exit;
         }


When the cdr getting stored , its giving error .

 CRITICAL:db_mysql:wrapper_single_mysql_stmt_prepare: driver error 
(1054): Unknown column 'from_uri' in 'field list'

 ERROR:db_mysql:db_mysql_do_prepared_query: failed to create new context
 ERROR:acc:acc_db_cdrs: failed to insert into database
 ERROR:acc:acc_dlg_callback: Cannot insert into database


      What should I do for the above error . Will I need to create the 
columns first in acc table then I can insert extra column or what ?


       Thank you in advance . Any kind of suggestion is appreciated.

*/Thanks & Regards/*
/Sasmita Panda/
/Network Testing and Software Engineer/
/3CLogic , ph:07827611765/


___
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


[OpenSIPS-Users] Need some help adding extra column in acc table in oepsnisp-1.11

2017-09-05 Thread Sasmita Panda
Hi All ,

I am using opensips-1.11 with acc module . Trying to add extra
columns in it to store some other data which is needed for billing .

I am trying to add like bellow .

modparam("acc", "db_url", "mysql://root:root@x.x.x.x/opensips_1_11")
modparam("acc", "db_flag", 2)
modparam("acc", "log_flag", 3)
modparam("acc", "cdr_flag", 1)
modparam("acc", "db_extra", "from_uri=$fU; to_uri=$tU")


 route{

 if (method == "INVITE") {
 create_dialog();
 setflag(1);
 setflag(2); # do accounting ...
 record_route();
 xlog("INBOUND CALL,$dd,$ru,$ci,$fn,$fu");
 route(10);
 exit;
 }


When the cdr getting stored , its giving error .

 CRITICAL:db_mysql:wrapper_single_mysql_stmt_prepare: driver error (1054):
Unknown column 'from_uri' in 'field list'
 ERROR:db_mysql:db_mysql_do_prepared_query: failed to create new context
 ERROR:acc:acc_db_cdrs: failed to insert into database
 ERROR:acc:acc_dlg_callback: Cannot insert into database


  What should I do for the above error . Will I need to create the
columns first in acc table then I can insert extra column or what ?

   Thank you in advance . Any kind of suggestion is appreciated.

*Thanks & Regards*
*Sasmita Panda*
*Network Testing and Software Engineer*
*3CLogic , ph:07827611765*
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] ACK bug help needed

2017-09-05 Thread Brian Southworth
Hi All,

 
I seem to be having issues with outbound calls, the calls go out and the 
connection is established.

But when the asterisk gateway send the 200OK back from the provider to opensips 
proxy, the proxy doesn’t send the ACK packet back to asterisk it just keeps 
looping it to itself.

 
Any help would be appreciated. 

 
Regards,

 
Brian Southworth

Communications Developer


111 Wilmslow Road

Handforth

Wilmslow

SK9 3ER

 
T: 0 446677

W: www.clocom.uk  

 
 

 

 

 

  

Like us on Facebook



Follow us on Twitter



 
 

 

 

 

Clocom is a green company. Think, do you need to print this email?

 
This message contains confidential information and is intended only for the 
individual named. If you are not the named addressee you should not 
disseminate, distribute or copy this e-mail. Please notify the sender 
immediately by e-mail if you have received this e-mail by mistake and delete 
this e-mail from your system. E-mail transmission cannot be guaranteed to be 
secure or error-free as information could be intercepted, corrupted, lost, 
destroyed, arrive late or incomplete, or contain viruses. The sender therefore 
does not accept liability for any errors or omissions in the contents of this 
message, which arise as a result of e-mail transmission. If verification is 
required please request a hard-copy version. Clocom UK Ltd, 111 Wilmslow Road, 
Handforth, Cheshire, SK9 3ER www.clocom.uk  

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