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:<my password>@localhost/opensips")

#### ALIAS module
loadmodule "alias_db.so"
modparam("alias_db","db_url",
        "mysql://root:<my password>@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:<my password>@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:[email protected]")
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);
                exit;
        }
}

route[freeswitch] {
        if(!is_method("INVITE")){
                return;
        }
        if ( ($rU=~"^[5]$" || $rU=~"^[7]$") && src_ip==192.168.1.30 && 
src_port==5060) {
                xlog("PBX tries to call FS! $rU@$rd:$rp via $si");
                $rd="10.250.5.50";
                $rp="5090";
                force_send_socket(udp:10.250.5.3:5080);
                route(relay);
                exit;
        }
}

route[relay] {                  

        if (is_method("INVITE")) {             

                if (has_body("application/sdp") && $si=="192.168.1.30") {
                        xlog("Offer rtpp Inbound.\n");
                        rtpproxy_offer("rei");
                }else{
                        xlog("Offer rtpp Outbound.\n");
                        rtpproxy_offer("rie");
                }
                t_on_branch("per_branch_ops");
                t_on_reply("handle_nat");
                t_on_failure("missed_call");
        }

        if (is_method("CANCEL|BYE")) {
                rtpproxy_unforce();
        }

        if (!t_relay()) {
                send_reply("500","Internal Error");
        };
        exit;
}

branch_route[per_branch_ops] {
        xlog("new branch at $ru\n");
}

onreply_route[handle_nat] {

        if( is_method("ACK") && has_body("application/sdp")){
                xlog("Answer rtpp reply\n");
                rtpproxy_answer("rie");
        } else if(has_body("application/sdp")) {
                xlog("Offer rtpp reply\n");
                rtpproxy_offer("rei");
        }
        xlog("incoming reply\n");
}

...Irrelevant part...

From FreeSWITCH UA to FreeSWITCH Server:

10.250.5.17:5090 -> 10.250.5.50:5090
  INVITE sip:[email protected] SIP/2.0
  Via: SIP/2.0/UDP 10.250.5.17:5090;branch=z9hG4bK.I4KG97dOK;rport
  From: <sip:[email protected]>;tag=MeYxCN9Lq
  To: sip:[email protected]
  CSeq: 20 INVITE..Call-ID: t2XYFvCyYU..Max-Forwards: 70
  Route: <sip:10.250.5.50:5090;lr
  Supported: outbound
  Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, 
INFO, UPDATE
  Content-Type: application/sdp
  Content-Length: 328
  Contact: 
<sip:[email protected]:5090>;+sip.instance="<urn:uuid:2f0b19de-2db0-4bef-be7d-48bf483a8141>"
  User-Agent: Linphone/3.9.1 (belle-sip/1.4.2)
  v=0
  o=1001 36791124 IN IP4 10.250.5.17
  s=Talk
  c=IN IP4 10.250.5.17
  t=0 0
  a=rtcp-xr:rcvr-rtt=all:10000 stat-summary=loss,dup,jitt,TTL voip-metrics
  m=audio 7078 RTP/AVP 0 8 101
  a=rtpmap:101 telephone-event/8000
  m=video 9078 RTP/AVP 9697
  a=rtpmap:96 VP8/90000
  a=rtpmap:97 H264/90000
  a=fmtp:97 profile-level-
  id=42801F

10.250.5.50:5090 -> 10.250.5.17:5090
  SIP/2.0 100 Trying
  Via: SIP/2.0/UDP 10.250.5.17:5090;branch=z9hG4bK.I4KG97dOK;rport=5090
  From: <sip:[email protected]>;tag=MeYxCN9Lq
  To: <sip:[email protected]>
  Call-ID: t2XYFvCyYU
  CSeq: 20 INVITE
  User-Agent: FreeSWITCH-mod_sofia/1.7.0+git~20151211T002348Z~cae255395f~64bit
  Content-Length: 0

From FreeSWITCH Server to OpenSIPS:

10.250.5.50:5090 -> 10.250.5.3:5080
  INVITE sip:[email protected]:5080 SIP/2.0
  Via: SIP/2.0/UDP 10.250.5.50:5090;rport;branch=z9hG4bKQ4XSKc0vUp4FD 
Max-Forwards: 69
  From: "1001" <sip:1001@[10.250.5.50:5090]>;tag=2XyUKHFD2y6pF
  To: <sip:[email protected]:5080>
  Call-ID: 65474177-6471-1234-e187-000c295a647b
  CSeq: 88639388 INVITE
  Contact: <sip:[email protected]:5090;transport=udp;gw=osips>
  User-Agent: FreeSWITCH-mod_sofia/1.7.0+git~20151211T002348Z~cae255395f~64bit
  Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, 
REFER, NOTIFY
  Supported: timer, path, replaces
  Allow-Events: talk, hold, conference, refer
  Content-Type: application/sdp
  Content-Disposition: session
  Content-Length: 218
  X-FS-Support: update_display,send_info
  Remote-Party-ID: "1001" 
<sip:[email protected]:5090>;party=calling;screen=yes;privacy=off
  v=0
  o=FreeSWITCH 1457928161 1457928162 IN IP4 10.250.5.50
  s=FreeSWITCH
  c=IN IP4 10.250.5.50
  t=0 0
  m=audio 22744 RTP/AVP 8 101
  a=rtpmap:8 PCMA/8000
  a=rtpmap:101 telephone-event/8000
  a=fmtp:101 0-16
  a=ptime:20

U 10.250.5.3:5080 -> 10.250.5.50:5090
  SIP/2.0 100 Giving a try
  Via: SIP/2.0/UDP 
10.250.5.50:5090;received=10.250.5.50;rport=5090;branch=z9hG4bKQ4XSKc0vUp4FD
  From: "1001" <sip:1001@[10.250.5.50:5090]>;tag=2XyUKHFD2y6pF
  To: <sip:[email protected]:5080>
  Call-ID: 65474177-6471-1234-e187-000c295a647b
  CSeq: 88639388 INVITE
  Server: OpenSIPS (2.1.2 (x86_64/linux))
  Content-Length: 0

U 10.250.5.3:5080 -> 10.250.5.50:5090
  SIP/2.0 400 Bad Request
  Warning: 399 192.168.1.30 "Malformed headers : From "
  To: <sip:[email protected]:5080>;tag=7ea5fd275b6bfe2bcdd1565b6841ecc6
  Call-ID: 65474177-6471-1234-e187-000c295a647b
  CSeq: 88639388 INVITE
  Via: SIP/2.0/UDP 
10.250.5.50:5090;received=10.250.5.50;rport=5090;branch=z9hG4bKQ4XSKc0vUp4FD
  Content-Length: 0

After that only timeout or cancels ends sending this error.
_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to