[OpenSIPS-Users] OpenSIPS error Malformed Header/failed to generate a HBH ACK

2016-03-19 Thread Nagorny, Dimitry
Good afternoon Ladies and Gentlemen,

I'm trying to use OpenSIPS as a Border Controller between a PSTN and a 
FreeSWITCH. The PSTN is sending all SIP-messages through a SIP-trunk.
I got OpenSIPS working fine from PSTN through OpenSIPS to FreeSWITCH, but the 
other way around (from FS over OpenSIPS to PSTN),  I'm getting an error message 
I can't solve.

As far as I can tell, when OpenSIPS opens up a new branch it is changing 
internally the headers from the incoming SIP-message from FreeSWITCH into a 
wrong format and after that it's throwing two errors:

-  ERROR:tm:send_ack: failed to generate a HBH ACK if key HFs in reply 
missing
ERROR:tm:reply_received: failed to send ACK (local=no)

o   Here I looked at the relevant code but I can't tell what it is trying to do 
in the transaction module
Additionally this piece of info:

-  ... SIP/2.0 400 Bad Request..Warning: 399 192.168.1.30 "Malformed 
headers : From " ...

o   From this somehow I found out that it's missing the ":" after From


Please see the attached config, routing logic, oopensips-errorlog and the 
sip-trace.
I would very much appreciate it if somebody could give me, at least, a hint how 
I could fix the problem, because by now I googled these problems for three days 
now w/o a solution.

Thanks in advance for any help I can get!


Very Respectfully
Dimitry Nagorny
Trainee

robot5 GmbH
Walter-Oehmichen-Straße 18
68519 Viernheim
Tel.: +49 6204 704 - 511
Fax: +49 6204 704 - 501

E-Mail: dimitry.nago...@robot5.de
Internet: www.robot5.de

_
Geschäftsführer:
Werner Oestreicher
Robert Schlabs
Stefan Wagner

Sitz der Gesellschaft: Viernheim
Amtsgericht: Darmstadt
Registerabteilung: Lampertheim HRB 92975
USt-IdNr.: DE293694382


Diese Email enthält vertrauliche und/oder rechtlich geschützte Informationen.
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten
haben, informieren Sie bitte sofort den Absender und vernichten diese E-Mail.
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser E-Mail ist
nicht gestattet.

This message is confidential and may contain privileged information.
If you are not the above named addressee or authorized to receive this
message on behalf of the addressee, please advise the sender immediately
and delete this message. Any unauthorized copying, disclosure or
distribution of the information in this e-mail is strictly forbidden.

Mar 14 12:48:29 r5dev-osipstest ./opensips[28089]: DBG:core:parse_msg: SIP 
Request:
Mar 14 12:48:29 r5dev-osipstest ./opensips[28089]: DBG:core:parse_msg:  method: 
 
Mar 14 12:48:29 r5dev-osipstest ./opensips[28089]: DBG:core:parse_msg:  uri:
 
Mar 14 12:48:29 r5dev-osipstest ./opensips[28089]: DBG:core:parse_msg:  
version: 
Mar 14 12:48:29 r5dev-osipstest ./opensips[28089]: DBG:core:parse_headers: 
flags=2
Mar 14 12:48:29 r5dev-osipstest ./opensips[28089]: DBG:core:parse_via_param: 
found param type 235,  = ; state=6
Mar 14 12:48:29 r5dev-osipstest ./opensips[28089]: DBG:core:parse_via_param: 
found param type 232,  = ; state=16
Mar 14 12:48:29 r5dev-osipstest ./opensips[28089]: DBG:core:parse_via: end of 
header reached, state=5
Mar 14 12:48:29 r5dev-osipstest ./opensips[28089]: DBG:core:parse_headers: via 
found, flags=2
Mar 14 12:48:29 r5dev-osipstest ./opensips[28089]: DBG:core:parse_headers: this 
is the first via
Mar 14 12:48:29 r5dev-osipstest ./opensips[28089]: DBG:core:receive_msg: After 
parse_msg...
Mar 14 12:48:29 r5dev-osipstest ./opensips[28089]: DBG:core:receive_msg: 
preparing to run routing scripts...
Mar 14 12:48:29 r5dev-osipstest ./opensips[28089]: DBG:core:parse_headers: 
flags=100
Mar 14 12:48:29 r5dev-osipstest ./opensips[28089]: 
DBG:maxfwd:is_maxfwd_present: value = 69
Mar 14 12:48:29 r5dev-osipstest ./opensips[28089]: DBG:core:parse_headers: 
flags=8
Mar 14 12:48:29 r5dev-osipstest ./opensips[28089]: DBG:core:parse_to: end of 
header reached, state=10
Mar 14 12:48:29 r5dev-osipstest ./opensips[28089]: DBG:core:parse_to: 
display={}, ruri={sip:185511@10.250.5.3:5080}
Mar 14 12:48:29 r5dev-osipstest ./opensips[28089]: DBG:core:get_hdr_field:  
[30]; uri=[sip:185511@10.250.5.3:5080]
Mar 14 12:48:29 r5dev-osipstest ./opensips[28089]: DBG:core:get_hdr_field: to 
body [#015#012]
Mar 14 12:48:29 r5dev-osipstest ./opensips[28089]: DBG:uri:has_totag: no totag
Mar 14 12:48:29 r5dev-osipstest ./opensips[28089]: DBG:core:parse_headers: 
flags=78
Mar 14 12:48:29 r5dev-osipstest ./opensips[28089]: DBG:core:get_hdr_field: cseq 
: <88641991> 
Mar 14 12:48:29 r5dev-osipstest ./opensips[28089]: DBG:tm:t_lookup_request: 
start searching: hash=30020, isACK=0
Mar 14 12:48:29 r5dev-osipstest ./opensips[28089]: DBG:tm:matching_3261: 
RFC3261 transaction matching failed
Mar 14 12:48:29 r5dev-osipstest ./opensips[28089]: DBG:tm:t_lookup_request: no 
transaction found
Mar 14 12:48:29 r5dev-osipstest ./opensips[28089]: DBG:co

Re: [OpenSIPS-Users] OpenSIPS error Malformed Header/failed to generate a HBH ACK

2016-03-19 Thread Nagorny, Dimitry
Please disregard this one, I forgot to cancel it.

Respectfully
Dimitry Nagorny
Trainee

Von: users-boun...@lists.opensips.org [mailto:users-boun...@lists.opensips.org] 
Im Auftrag von Nagorny, Dimitry
Gesendet: Montag, 14. März 2016 13:42
An: users@lists.opensips.org
Betreff: [OpenSIPS-Users] OpenSIPS error Malformed Header/failed to generate a 
HBH ACK

Good afternoon Ladies and Gentlemen,

I'm trying to use OpenSIPS as a Border Controller between a PSTN and a 
FreeSWITCH. The PSTN is sending all SIP-messages through a SIP-trunk.
I got OpenSIPS working fine from PSTN through OpenSIPS to FreeSWITCH, but the 
other way around (from FS over OpenSIPS to PSTN),  I'm getting an error message 
I can't solve.

As far as I can tell, when OpenSIPS opens up a new branch it is changing 
internally the headers from the incoming SIP-message from FreeSWITCH into a 
wrong format and after that it's throwing two errors:

-  ERROR:tm:send_ack: failed to generate a HBH ACK if key HFs in reply 
missing
ERROR:tm:reply_received: failed to send ACK (local=no)

o   Here I looked at the relevant code but I can't tell what it is trying to do 
in the transaction module
Additionally this piece of info:

-  ... SIP/2.0 400 Bad Request..Warning: 399 192.168.1.30 "Malformed 
headers : From " ...

o   From this somehow I found out that it's missing the ":" after From


Please see the attached config, routing logic, oopensips-errorlog and the 
sip-trace.
I would very much appreciate it if somebody could give me, at least, a hint how 
I could fix the problem, because by now I googled these problems for three days 
now w/o a solution.

Thanks in advance for any help I can get!


Very Respectfully
Dimitry Nagorny
Trainee

robot5 GmbH
Walter-Oehmichen-Straße 18
68519 Viernheim
Tel.: +49 6204 704 - 511
Fax: +49 6204 704 - 501

E-Mail: dimitry.nago...@robot5.de<mailto:dimitry.nago...@robot5.de>
Internet: www.robot5.de<http://www.robot5.de/>

_
Geschäftsführer:
Werner Oestreicher
Robert Schlabs
Stefan Wagner

Sitz der Gesellschaft: Viernheim
Amtsgericht: Darmstadt
Registerabteilung: Lampertheim HRB 92975
USt-IdNr.: DE293694382


Diese Email enthält vertrauliche und/oder rechtlich geschützte Informationen.
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten
haben, informieren Sie bitte sofort den Absender und vernichten diese E-Mail.
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser E-Mail ist
nicht gestattet.

This message is confidential and may contain privileged information.
If you are not the above named addressee or authorized to receive this
message on behalf of the addressee, please advise the sender immediately
and delete this message. Any unauthorized copying, disclosure or
distribution of the information in this e-mail is strictly forbidden.

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


Re: [OpenSIPS-Users] OpenSIPS error Malformed Header/failed to generate a HBH ACK

2016-03-16 Thread Liviu Chircu
Useful update: The actual culprit is the initial INVITE from the SIP 
trunk, which is missing the "From" header. FreeSWITCH raises an eyebrow 
and replies with 400 "Bad Request", while omitting the header as well on 
the way back to OpenSIPS!


Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 16.03.2016 11:27, Liviu Chircu wrote:

Hi Dimitry!

That errors suggests the "From" Header Field of the 400 negative reply 
is missing! Best way to continue from here is to perform a SIP trace 
on this scenario, so you can confirm this yourself before starting to 
fix it.

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com
On 15.03.2016 14:48, Nagorny, Dimitry wrote:


Good afternoon Ladies and Gentlemen,

I’m trying to use OpenSIPS as a Border Controller between a PSTN and 
a FreeSWITCH. The PSTN is sending all SIP-messages through a SIP-trunk.


I got OpenSIPS working fine from PSTN through OpenSIPS to FreeSWITCH, 
but the other way around (from FS over OpenSIPS to PSTN),  I’m 
getting an error message I can’t solve. (Info: There are NO phones 
registered with OpenSIPS or FreeSWITCH, they are all on the PSTN, I 
need OpenSIPS only to guide traffic to either my FreeSWITCH 
mediaserver or tot he Aus @ PBX.)


As far as I can tell, when OpenSIPS opens up a new branch it is 
changing internally the headers from the incoming SIP-message from 
FreeSWITCH into a wrong format and after that it’s throwing two errors:


-ERROR:tm:send_ack: failed to generate a HBH ACK if key HFs in reply 
missing

ERROR:tm:reply_received: failed to send ACK (local=no)

oHere I looked at the relevant code but I can’t tell what it is 
trying to do in the transaction module


oAs well I couldn’t find info about the abbreviation „HBH“ or „HF“

Additionally this piece of info:

-… SIP/2.0 400 Bad Request..Warning: 399 192.168.1.30 "Malformed 
headers : From " …


oFrom this somehow I found out that it’s missing the “:“ after From

Please see the attached files for more info.
I would very much appreciate it if somebody could give me, at least, 
a hint how I could fix the problem, because by now I googled these 
problems for three days now w/o a solution. I can’t attach the full 
debug, the mail list blocks the size of it (17KB…). I’ll attach it to 
an answer.


Thanks in advance for any help I can get!

Very Respectfully

*Dimitry Nagorny*

Trainee

robot5GmbH

___

This message is confidential and may contain privileged information.
If you are not the above named addressee or authorized to receive this
message on behalf of the addressee, please advise the sender immediately
and delete this message. Any unauthorized copying, disclosure or
distribution of the information in this e-mail is strictly forbidden.



___
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] OpenSIPS error Malformed Header/failed to generate a HBH ACK

2016-03-16 Thread Liviu Chircu

Hi Dimitry!

That errors suggests the "From" Header Field of the 400 negative reply 
is missing! Best way to continue from here is to perform a SIP trace on 
this scenario, so you can confirm this yourself before starting to fix it.


Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 15.03.2016 14:48, Nagorny, Dimitry wrote:


Good afternoon Ladies and Gentlemen,

I’m trying to use OpenSIPS as a Border Controller between a PSTN and a 
FreeSWITCH. The PSTN is sending all SIP-messages through a SIP-trunk.


I got OpenSIPS working fine from PSTN through OpenSIPS to FreeSWITCH, 
but the other way around (from FS over OpenSIPS to PSTN),  I’m getting 
an error message I can’t solve. (Info: There are NO phones registered 
with OpenSIPS or FreeSWITCH, they are all on the PSTN, I need OpenSIPS 
only to guide traffic to either my FreeSWITCH mediaserver or tot he 
Aus @ PBX.)


As far as I can tell, when OpenSIPS opens up a new branch it is 
changing internally the headers from the incoming SIP-message from 
FreeSWITCH into a wrong format and after that it’s throwing two errors:


-ERROR:tm:send_ack: failed to generate a HBH ACK if key HFs in reply 
missing

ERROR:tm:reply_received: failed to send ACK (local=no)

oHere I looked at the relevant code but I can’t tell what it is trying 
to do in the transaction module


oAs well I couldn’t find info about the abbreviation „HBH“ or „HF“

Additionally this piece of info:

-… SIP/2.0 400 Bad Request..Warning: 399 192.168.1.30 "Malformed 
headers : From " …


oFrom this somehow I found out that it’s missing the “:“ after From

Please see the attached files for more info.
I would very much appreciate it if somebody could give me, at least, a 
hint how I could fix the problem, because by now I googled these 
problems for three days now w/o a solution. I can’t attach the full 
debug, the mail list blocks the size of it (17KB…). I’ll attach it to 
an answer.


Thanks in advance for any help I can get!

Very Respectfully

*Dimitry Nagorny*

Trainee

robot5GmbH

___

This message is confidential and may contain privileged information.
If you are not the above named addressee or authorized to receive this
message on behalf of the addressee, please advise the sender immediately
and delete this message. Any unauthorized copying, disclosure or
distribution of the information in this e-mail is strictly forbidden.



___
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] OpenSIPS error Malformed Header/failed to generate a HBH ACK

2016-03-15 Thread Nagorny, Dimitry
John,

thanks for the quick reply, but I am not using the uac_replace_from() function. 
I checked routing and debug file for it.


Very Respectfully
Dimitry Nagorny
Trainee

/*-Ursprüngliche Nachricht-
/*Von: users-boun...@lists.opensips.org [mailto:users-
/*boun...@lists.opensips.org] Im Auftrag von John Quick
/*Gesendet: Dienstag, 15. März 2016 14:03
/*An: users@lists.opensips.org
/*Betreff: [OpenSIPS-Users] OpenSIPS error Malformed Header/failed to
/*generate a HBH ACK
/*
/*
/*Dimitry,
/*
/*Just an idea, but are you by any chance using the function
/*uac_replace_from()?
/*I ask because I have seen it corrupt the From header when it is called twice
/*on the same branch.
/*
/*John Quick
/*Smartvox Limited
/*
/*
/*Date: Tue, 15 Mar 2016 12:48:05 +
/*From: "Nagorny, Dimitry" 
/*Subject: [OpenSIPS-Users] OpenSIPS error Malformed Header/failed to
/*  generate        a HBH ACK
/*To: "users@lists.opensips.org" 
/*Message-ID:
/*  
/*Content-Type: text/plain; charset="us-ascii"
/*
/*Good afternoon Ladies and Gentlemen,
/*
/*I'm trying to use OpenSIPS as a Border Controller between a PSTN and a
/*FreeSWITCH. The PSTN is sending all SIP-messages through a SIP-trunk.
/*I got OpenSIPS working fine from PSTN through OpenSIPS to FreeSWITCH,
/*but the other way around (from FS over OpenSIPS to PSTN),  I'm getting an
/*error message I can't solve. (Info: There are NO phones registered with
/*OpenSIPS or FreeSWITCH, they are all on the PSTN, I need OpenSIPS only to
/*guide traffic to either my FreeSWITCH mediaserver or tot he Aus @ PBX.)
/*
/*As far as I can tell, when OpenSIPS opens up a new branch it is changing
/*internally the headers from the incoming SIP-message from FreeSWITCH into
/*a wrong format and after that it's throwing two errors:
/*
/*-  ERROR:tm:send_ack: failed to generate a HBH ACK if key HFs in
/*reply missing
/*ERROR:tm:reply_received: failed to send ACK (local=no)
/*
/*o   Here I looked at the relevant code but I can't tell what it is trying to
/*do in the transaction module
/*
/*o   As well I couldn't find info about the abbreviation "HBH" or "HF"
/*Additionally this piece of info:
/*
/*-  ... SIP/2.0 400 Bad Request..Warning: 399 192.168.1.30 "Malformed
/*headers : From " ...
/*
/*o   From this somehow I found out that it's missing the ":" after From
/*
/*Please see the attached files for more info.
/*I would very much appreciate it if somebody could give me, at least, a hint
/*how I could fix the problem, because by now I googled these problems for
/*three days now w/o a solution. I can't attach the full debug, the mail list
/*blocks the size of it (17KB...). I'll attach it to an answer.
/*
/*Thanks in advance for any help I can get!
/*
/*Very Respectfully
/*Dimitry Nagorny
/*Trainee
/*
/*
/*___
/*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] OpenSIPS error Malformed Header/failed to generate a HBH ACK

2016-03-15 Thread John Quick

Dimitry,

Just an idea, but are you by any chance using the function
uac_replace_from()?
I ask because I have seen it corrupt the From header when it is called twice
on the same branch.

John Quick
Smartvox Limited


Date: Tue, 15 Mar 2016 12:48:05 +
From: "Nagorny, Dimitry" 
Subject: [OpenSIPS-Users] OpenSIPS error Malformed Header/failed to
    generate        a HBH ACK
To: "users@lists.opensips.org" 
Message-ID:

Content-Type: text/plain; charset="us-ascii"

Good afternoon Ladies and Gentlemen,

I'm trying to use OpenSIPS as a Border Controller between a PSTN and a
FreeSWITCH. The PSTN is sending all SIP-messages through a SIP-trunk.
I got OpenSIPS working fine from PSTN through OpenSIPS to FreeSWITCH, but
the other way around (from FS over OpenSIPS to PSTN),  I'm getting an error
message I can't solve. (Info: There are NO phones registered with OpenSIPS
or FreeSWITCH, they are all on the PSTN, I need OpenSIPS only to guide
traffic to either my FreeSWITCH mediaserver or tot he Aus @ PBX.)

As far as I can tell, when OpenSIPS opens up a new branch it is changing
internally the headers from the incoming SIP-message from FreeSWITCH into a
wrong format and after that it's throwing two errors:

-  ERROR:tm:send_ack: failed to generate a HBH ACK if key HFs in
reply missing
ERROR:tm:reply_received: failed to send ACK (local=no)

o   Here I looked at the relevant code but I can't tell what it is trying to
do in the transaction module

o   As well I couldn't find info about the abbreviation "HBH" or "HF"
Additionally this piece of info:

-  ... SIP/2.0 400 Bad Request..Warning: 399 192.168.1.30 "Malformed
headers : From " ...

o   From this somehow I found out that it's missing the ":" after From

Please see the attached files for more info.
I would very much appreciate it if somebody could give me, at least, a hint
how I could fix the problem, because by now I googled these problems for
three days now w/o a solution. I can't attach the full debug, the mail list
blocks the size of it (17KB...). I'll attach it to an answer.

Thanks in advance for any help I can get!

Very Respectfully
Dimitry Nagorny
Trainee


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


Re: [OpenSIPS-Users] OpenSIPS error Malformed Header/failed to generate a HBH ACK

2016-03-15 Thread Nagorny, Dimitry
Just attached the debug log.

Very Respectfully
Dimitry Nagorny
Trainee

robot5 GmbH

_
This message is confidential and may contain privileged information.
If you are not the above named addressee or authorized to receive this
message on behalf of the addressee, please advise the sender immediately
and delete this message. Any unauthorized copying, disclosure or
distribution of the information in this e-mail is strictly forbidden.
./opensips[28089]: DBG:core:parse_msg: SIP Request:
./opensips[28089]: DBG:core:parse_msg:method:
./opensips[28089]: DBG:core:parse_msg:uri: 
./opensips[28089]: DBG:core:parse_msg:version: 
./opensips[28089]: DBG:core:parse_headers: flags=2
./opensips[28089]: DBG:core:parse_via_param: found param type 235,  = 
; state=6
./opensips[28089]: DBG:core:parse_via_param: found param type 232,  = 
; state=16
./opensips[28089]: DBG:core:parse_via: end of header reached, state=5
./opensips[28089]: DBG:core:parse_headers: via found, flags=2
./opensips[28089]: DBG:core:parse_headers: this is the first via
./opensips[28089]: DBG:core:receive_msg: After parse_msg...
./opensips[28089]: DBG:core:receive_msg: preparing to run routing scripts...
./opensips[28089]: DBG:core:parse_headers: flags=100
./opensips[28089]: DBG:maxfwd:is_maxfwd_present: value = 69
./opensips[28089]: DBG:core:parse_headers: flags=8
./opensips[28089]: DBG:core:parse_to: end of header reached, state=10
./opensips[28089]: DBG:core:parse_to: display={}, 
ruri={sip:185511@10.250.5.3:5080}
./opensips[28089]: DBG:core:get_hdr_field:  [30]; 
uri=[sip:185511@10.250.5.3:5080]
./opensips[28089]: DBG:core:get_hdr_field: to body 
[#015#012]
./opensips[28089]: DBG:uri:has_totag: no totag
./opensips[28089]: DBG:core:parse_headers: flags=78
./opensips[28089]: DBG:core:get_hdr_field: cseq : <88641991> 
./opensips[28089]: DBG:tm:t_lookup_request: start searching: hash=30020, isACK=0
./opensips[28089]: DBG:tm:matching_3261: RFC3261 transaction matching failed
./opensips[28089]: DBG:tm:t_lookup_request: no transaction found
./opensips[28089]: DBG:core:parse_headers: flags=200
./opensips[28089]: DBG:core:get_hdr_field: content_length=218
./opensips[28089]: DBG:core:get_hdr_field: found end of header
./opensips[28089]: DBG:rr:find_first_route: No Route headers found
./opensips[28089]: DBG:rr:loose_route: There is no Route HF
./opensips[28089]: DBG:core:parse_to_param: tag=m05SKryceZQ7F
./opensips[28089]: DBG:core:parse_to: end of header reached, state=29
./opensips[28089]: DBG:core:parse_to: display={"1001"}, 
ruri={sip:1001@[10.250.5.50:5090]}
./opensips[28089]: DBG:core:grep_sock_info: checking if host==us: 16==13 
&&[10.250.5.50:5090] == [192.168.1.150]
./opensips[28089]: DBG:core:grep_sock_info: checking if port 5060 matches port 
5060
./opensips[28089]: DBG:core:grep_sock_info: checking if host==us: 16==10 
&&[10.250.5.50:5090] == [10.250.5.3]
./opensips[28089]: DBG:core:grep_sock_info: checking if port 5080 matches port 
5060
./opensips[28089]: DBG:core:check_self: host != me
./opensips[28089]: DBG:core:grep_sock_info: checking if host==us: 10==13 
&&[10.250.5.3] == [192.168.1.150]
./opensips[28089]: DBG:core:grep_sock_info: checking if port 5060 matches port 
5080
./opensips[28089]: DBG:core:grep_sock_info: checking if host==us: 10==10 
&&[10.250.5.3] == [10.250.5.3]
./opensips[28089]: DBG:core:grep_sock_info: checking if port 5080 matches port 
5080
./opensips[28089]: DBG:core:buf_init: initializing...
./opensips[28089]: Into invite method.
./opensips[28089]: DBG:dialog:w_create_dialog2: bye on timeout activated
./opensips[28089]: DBG:dialog:build_new_dlg: new dialog 0x7fb36ea18a18 
(c=83c45345-647d-1234-e187-000c295a647b,f=sip:1001@[10.250.5.50:5090],t=sip:185511@10.250.5.3:5080,ft=m05SKryceZQ7F)
 on hash 1723
./opensips[28089]: DBG:core:parse_headers: flags=
./opensips[28089]: DBG:dialog:init_leg_info: route_set , contact 
sip:gw+osips@10.250.5.50:5090;transport=udp;gw=osips, cseq 88641991 and 
bind_addr udp:10.250.5.3:5080
./opensips[28089]: DBG:dialog:dlg_add_leg_info: set leg 0 for 0x7fb36ea18a18: 
tag= rcseq=<0>
./opensips[28089]: DBG:dialog:link_dlg: ref dlg 0x7fb36ea18a18 with 4 -> 4 in 
h_entry 0x7fb36e9f43d8 - 1723
./opensips[28089]: DBG:rr:add_rr_param: adding (;did=bb6.b255faa3)
./opensips[28089]: DBG:rr:add_rr_param: second RR lump found
./opensips[28089]: DBG:rr:add_rr_param: second RR lump found
./opensips[28089]: DBG:db_mysql:mysql_raise_event: MySQL status has not 
changed: connected
./opensips[28089]: DBG:core:db_new_result: allocate 48 bytes for result set at 
0x7fb3b2ef0970
./opensips[28089]: DBG:db_mysql:db_mysql_get_columns: 2 columns returned from 
the query
./opensips[28089]: DBG:core:db_allocate_columns: allocate 56 bytes for result 
columns at 0x7fb3b2ef09b8
./opensips[28089]: DBG:db_mysql:db_mysql_get_columns: 
RES_NAMES(0x7fb3b2ef09c8)[0]=[username]
./opensips[28089]: DBG:db_mysql:db_mysql_get_columns: use DB_STRING result type
./ope

[OpenSIPS-Users] OpenSIPS error Malformed Header/failed to generate a HBH ACK

2016-03-15 Thread Nagorny, Dimitry
Good afternoon Ladies and Gentlemen,

I'm trying to use OpenSIPS as a Border Controller between a PSTN and a 
FreeSWITCH. The PSTN is sending all SIP-messages through a SIP-trunk.
I got OpenSIPS working fine from PSTN through OpenSIPS to FreeSWITCH, but the 
other way around (from FS over OpenSIPS to PSTN),  I'm getting an error message 
I can't solve. (Info: There are NO phones registered with OpenSIPS or 
FreeSWITCH, they are all on the PSTN, I need OpenSIPS only to guide traffic to 
either my FreeSWITCH mediaserver or tot he Aus @ PBX.)

As far as I can tell, when OpenSIPS opens up a new branch it is changing 
internally the headers from the incoming SIP-message from FreeSWITCH into a 
wrong format and after that it's throwing two errors:

-  ERROR:tm:send_ack: failed to generate a HBH ACK if key HFs in reply 
missing
ERROR:tm:reply_received: failed to send ACK (local=no)

o   Here I looked at the relevant code but I can't tell what it is trying to do 
in the transaction module

o   As well I couldn't find info about the abbreviation "HBH" or "HF"
Additionally this piece of info:

-  ... SIP/2.0 400 Bad Request..Warning: 399 192.168.1.30 "Malformed 
headers : From " ...

o   From this somehow I found out that it's missing the ":" after From


Please see the attached files for more info.
I would very much appreciate it if somebody could give me, at least, a hint how 
I could fix the problem, because by now I googled these problems for three days 
now w/o a solution. I can't attach the full debug, the mail list blocks the 
size of it (17KB...). I'll attach it to an answer.

Thanks in advance for any help I can get!


Very Respectfully
Dimitry Nagorny
Trainee

robot5 GmbH

_
This message is confidential and may contain privileged information.
If you are not the above named addressee or authorized to receive this
message on behalf of the addressee, please advise the sender immediately
and delete this message. Any unauthorized copying, disclosure or
distribution of the information in this e-mail is strictly forbidden.


debug=4
log_stderror=no
log_facility=LOG_LOCAL0

fork=yes
children=8

listen=udp:192.168.1.150:5060
listen=udp:10.250.5.3:5080

...Standard config data (signaling and so on)...

 MYSQL module
loadmodule "db_mysql.so"

 USeR LOCation module
loadmodule "usrloc.so"
modparam("usrloc", "nat_bflag", "NAT")
modparam("usrloc", "db_mode",   0)

 REGISTRAR module
loadmodule "registrar.so"
modparam("registrar", "tcp_persistent_flag", "TCP_PERSISTENT")

 ACCounting module
loadmodule "acc.so"
modparam("acc", "early_media", 0)
modparam("acc", "report_cancels", 0)
modparam("acc", "detect_direction", 0)
modparam("acc", "failed_transaction_flag", "ACC_FAILED")
modparam("acc", "db_flag", "ACC_DO")
modparam("acc", "db_missed_flag", "ACC_MISSED")
modparam("acc", "db_url",
"mysql://root:@localhost/opensips")

 ALIAS module
loadmodule "alias_db.so"
modparam("alias_db","db_url",
"mysql://root:@localhost/opensips")

 DIALOG module
loadmodule "dialog.so"
modparam("dialog", "dlg_match_mode", 1)
modparam("dialog", "default_timeout", 21600)  # 6 hours timeout
modparam("dialog", "db_mode", 2)
modparam("dialog", "db_url",
"mysql://root:@localhost/opensips")

  NAT modules
loadmodule "nathelper.so"
modparam("nathelper", "natping_interval", 10)
modparam("nathelper", "ping_nated_only", 1)
modparam("nathelper","sipping_bflag", "SIP_PING_FLAG")
modparam("nathelper","sipping_from","sip:pinger@192.168.1.150")
modparam("nathelper", "received_avp", "$avp(received_nh)")

loadmodule "rtpproxy.so"
modparam("rtpproxy", "rtpproxy_sock", "udp:localhost:5006")

loadmodule "proto_udp.so"route {
force_rport();

...Irrelevant part...

t_check_trans();

if (loose_route()) {
xlog("L_ERR", "Attempt to route with preloaded Route's 
[$fu/$tu/$ru/$ci]");

if (!is_method("ACK"))
sl_send_reply("403","Preload Route denied");

exit;
}

...Irrelevant part...

if ($rU==NULL) {
sl_send_reply("484","Address Incomplete");
exit;
}

#FreeSWITCH
route(freeswitch);

#Outbound
route(outbound);

if (!lookup("location", "m")) {
t_newtran();
t_reply("404", "Not Found");
exit;
}

setflag(ACC_MISSED);
xlog("Reaching lowest Call Relay.\n");
route(relay);
}

route[outbound] {
xlog("Jumped to Outbound.\n");
if(!is_method("INVITE")){
return;
}
if ($rU=~"^[1-9][0-9]+$") {
xlog("FS tries to call PBX! $rU@$rd:$rp via $si");
$rd="192.168.1.30";
$rp="5060";
force_send_socket(udp:192.168.1.150:5060);
route(relay);