davehorton / drachtio-fs-load-balancing-proxy

Load-balancing SIP proxy for Freeswitch
http://davehorton.github.io/drachtio-fs-load-balancing-proxy/
MIT License
24 stars 12 forks source link

How to route calls to FS Nodes #3

Open shashiTeleDNA opened 7 years ago

shashiTeleDNA commented 7 years ago

HI, I have installed drachtio Server and drachtio-fs-load-balancing-proxy and they are both running perfectly but there is no documentation provided, to register sip clients and how to originate calls FreeSWITCH and when we are trying to register sip clinet its giving error below error.

REGISTER sip:172.16.23.26:5060;transport=UDP SIP/2.0 Via: SIP/2.0/UDP 172.16.3.247:32487;branch=z9hG4bK-524287-1---d2cd315c9e4578fd;rport Max-Forwards: 70 Contact: sip:1000@172.16.3.247:32487;rinstance=1b3277f568469273;transport=UDP To: sip:1000@172.16.23.26:5060;transport=UDP From: sip:1000@172.16.23.26:5060;transport=UDP;tag=b0a07237 Call-ID: yqQjGnLx4xnlFWj1hL_qvA.. CSeq: 1 REGISTER Expires: 60 User-Agent: Zoiper rv2.8.30 Allow-Events: presence, kpml, talk Content-Length: 0

00000610|2017-Jul-24 14:36:09.006655| tport.c:3023 tport_deliver() tport_deliver(0xca4f70): msg 0xcbaed0 (502 bytes) from udp/172.16.3.247:5060 next=(nil) 00000611|2017-Jul-24 14:36:09.006699| nta.c:2880 agent_recv_request() nta: received REGISTER sip:172.16.23.26:5060;transport=UDP SIP/2.0 (CSeq 1) 00000612|2017-Jul-24 14:36:09.006750| nta.c:3248 agent_aliases() nta: canonizing sip:172.16.23.26:5060 with contact 00000613|2017-Jul-24 14:36:09.006792| nta.c:3094 agent_recv_request() nta: REGISTER (1) to message callback 00000614|2017-Jul-24 14:36:09.011734| tport.c:3257 tport_tsend() tport_tsend(0xca4f70) tpn = UDP/172.16.3.247:32487 00000615|2017-Jul-24 14:36:09.011831| tport.c:4046 tport_resolve() tport_resolve addrinfo = 172.16.3.247:32487 00000616|2017-Jul-24 14:36:09.011874| tport.c:4680 tport_by_addrinfo() tport_by_addrinfo(0xca4f70): not found by name UDP/172.16.3.247:32487 00000617|2017-Jul-24 14:36:09.011953| tport.c:3492 tport_send_msg() tport_vsend returned 318 00000618|2017-Jul-24 14:36:09.012050| send 318 bytes to udp/[172.16.3.247]:32487 at 14:36:09.011919: SIP/2.0 403 Forbidden Via: SIP/2.0/UDP 172.16.3.247:32487;branch=z9hG4bK-524287-1---d2cd315c9e4578fd;rport=32487 From: sip:1000@172.16.23.26:5060;transport=UDP;tag=b0a07237 To: sip:1000@172.16.23.26:5060;transport=UDP;tag=8Q2jaUDKy10Na Call-ID: yqQjGnLx4xnlFWj1hL_qvA.. CSeq: 1 REGISTER Content-Length: 0

please provide proper documentation.

davehorton commented 7 years ago

I'm unclear which direction the REGISTERs are going -- are you wanting the drachtio proxy to receive REGISTERs from clients and distribute them across freeswitches (similar to INVITEs) ?

davehorton commented 7 years ago

I am thinking that you want the drachtio app to be an outbound proxy -- to proxy REGISTER requests on to the Freeswitch after adding a Path: header, so that calls from the freeswitch to the device will transit the proxy.....is that correct? Let me know if this is the case -- this app was not originally designed to be an outbound proxy, but could probably be enhanced to do so.

shashiTeleDNA commented 7 years ago

Yes we want to use drachtio-fs-load-balancing-proxy as outbound proxy, we make invite requests to drachito server and it should transfer request to available(registered) FreeSWITCH nodes in round robin or priority wise

davehorton commented 7 years ago

The only reason the app should send a 403 response to a REGISTER is if the source address is in a black-listed range for some reason. Could you paste in the logs from the app itself when it is handling a REGISTER (i.e. when you run node app.js)

shashiTeleDNA commented 7 years ago

[root@localhost drachtio-fs-load-balancing-proxy]# node app.js Thu Jul 27 2017 12:39:47 GMT+0530 (IST) - info: Cluster#addServer: adding target 127.0.0.1:8021:external Thu Jul 27 2017 12:39:47 GMT+0530 (IST) - info: Cluster#addServer: adding target 127.0.0.1:8021:internal Thu Jul 27 2017 12:39:47 GMT+0530 (IST) - info: added 2 servers and removed 0 servers Thu Jul 27 2017 12:39:47 GMT+0530 (IST) - error: error listing chain LOGDROP: iptables: No chain/target/match by that name.

Thu Jul 27 2017 12:39:47 GMT+0530 (IST) - info: connected to freeswitch at 127.0.0.1:external, it reports handling SIP on 220.227.38.109:5070 Thu Jul 27 2017 12:39:47 GMT+0530 (IST) - info: freeswitch 127.0.0.1:8021:external went online Thu Jul 27 2017 12:39:47 GMT+0530 (IST) - info: connected to freeswitch at 127.0.0.1:internal, it reports handling SIP on 220.227.38.109:5070 Thu Jul 27 2017 12:39:47 GMT+0530 (IST) - info: freeswitch 127.0.0.1:8021:internal went online

davehorton commented 7 years ago

sorry I was on holiday last week.

The logs I wanted to see where when the 403 is actually sent....seems like you only posted the logs from when the app started? Could you also edit /etc/drachtio.conf.xml and change log level from 'info' to 'debug' and gather those logs as well?

shashiTeleDNA commented 7 years ago

00000186|2017-Aug-02 10:45:29.326415| tport.c:2749 tport_wakeup_pri() tport_wakeup_pri(0x1dd9f70): events IN 00000187|2017-Aug-02 10:45:29.326584| tport.c:2864 tport_recv_event() tport_recv_event(0x1dd9f70) 00000188|2017-Aug-02 10:45:29.326644| tport.c:3205 tport_recv_iovec() tport_recv_iovec(0x1dd9f70) msg 0x1decc20 from (udp/172.16.23.26:5060) has 487 bytes, veclen = 1 00000189|2017-Aug-02 10:45:29.326828| recv 487 bytes from udp/[172.16.3.247]:63594 at 10:45:29.326698: REGISTER sip:172.16.23.26;transport=UDP SIP/2.0 Via: SIP/2.0/UDP 172.16.3.247:63594;branch=z9hG4bK-524287-1---1968cddf0f997e84;rport Max-Forwards: 70 Contact: sip:1000@172.16.3.247:63594;rinstance=aa4ba5382c5dabbc;transport=UDP To: sip:1000@172.16.23.26;transport=UDP From: sip:1000@172.16.23.26;transport=UDP;tag=db9cd535 Call-ID: pq19Xrd5gGi0Y177dUvI5Q.. CSeq: 1 REGISTER Expires: 60 User-Agent: Zoiper rv2.8.30 Allow-Events: presence, kpml, talk Content-Length: 0

0000018a|2017-Aug-02 10:45:29.326893| tport.c:3023 tport_deliver() tport_deliver(0x1dd9f70): msg 0x1decc20 (487 bytes) from udp/172.16.3.247:5060 next=(nil) 0000018b|2017-Aug-02 10:45:29.326937| nta.c:2880 agent_recv_request() nta: received REGISTER sip:172.16.23.26;transport=UDP SIP/2.0 (CSeq 1) 0000018c|2017-Aug-02 10:45:29.326995| nta.c:3248 agent_aliases() nta: canonizing sip:172.16.23.26 with contact 0000018d|2017-Aug-02 10:45:29.327036| nta.c:3094 agent_recv_request() nta: REGISTER (1) to message callback 0000018e|2017-Aug-02 10:45:29.327088| processMessageStatelessly - incoming message with call-id pq19Xrd5gGi0Y177dUvI5Q.. does not match an existing call leg 0000018f|2017-Aug-02 10:45:29.327133| ClientController::route_request_outside_dialog - there are 1 possible clients, we are starting with offset 0 00000190|2017-Aug-02 10:45:29.327169| Selected client at offset 0 00000191|2017-Aug-02 10:45:29.328385| PendingRequestController::add - tport: 0x1dd9f70, Call-ID: pq19Xrd5gGi0Y177dUvI5Q.., transactionId a9179012-d6eb-4086-8cda-e45667c511b7 00000192|2017-Aug-02 10:45:29.328445| pending-request: Adding entry to go off in 64000ms 00000193|2017-Aug-02 10:45:29.328479| pending-request: Adding entry to the head (queue was empty), length: 1 00000194|2017-Aug-02 10:45:29.328534| ClientController::addNetTransaction: transactionId a9179012-d6eb-4086-8cda-e45667c511b7; size: 1 00000195|2017-Aug-02 10:45:29.336700| Client::read_handler read: ffa775f3-5f91-4b79-9df8-778fb953b1ac|sip|a9179012-d6eb-4086-8cda-e45667c511b7| SIP/2.0 403 Forbidden Call-ID: pq19Xrd5gGi0Y177dUvI5Q.. cseq: 1 REGISTER from: sip:1000@172.16.23.26;transport=UDP;tag=db9cd535 to: sip:1000@172.16.23.26;transport=UDP Content-Length: 0

00000196|2017-Aug-02 10:45:29.336876| Client::processMessage - got request with 4 tokens 00000197|2017-Aug-02 10:45:29.336946| Client::processMessage - request id ffa775f3-5f91-4b79-9df8-778fb953b1ac, request type: sip transaction id: a9179012-d6eb-4086-8cda-e45667c511b7, dialog id: 00000198|2017-Aug-02 10:45:29.336994| ClientController::addApiRequest: clientMsgId ffa775f3-5f91-4b79-9df8-778fb953b1ac; size: 1 00000199|2017-Aug-02 10:45:29.337180| makeTags - Adding well-known header 'Call-ID' with value 'pq19Xrd5gGi0Y177dUvI5Q..' 0000019a|2017-Aug-02 10:45:29.337257| makeTags - Adding well-known header 'cseq' with value '1 REGISTER' 0000019b|2017-Aug-02 10:45:29.337299| makeTags - Adding well-known header 'from' with value 'sip:1000@172.16.23.26;transport=UDP;tag=db9cd535' 0000019c|2017-Aug-02 10:45:29.337338| makeTags - Adding well-known header 'to' with value 'sip:1000@172.16.23.26;transport=UDP' 0000019d|2017-Aug-02 10:45:29.337387| pending-request: removing entry, prior to removal length: 1 0000019e|2017-Aug-02 10:45:29.337450| pending-request: removed entry, timer not set (queue is empty after removal), length: 0 0000019f|2017-Aug-02 10:45:29.337519| SipDialogController::doRespondToSipRequest found incoming transaction 0x1ded3d0 000001a0|2017-Aug-02 10:45:29.337617| tport.c:3257 tport_tsend() tport_tsend(0x1dd9f70) tpn = UDP/172.16.3.247:63594 000001a1|2017-Aug-02 10:45:29.337675| tport.c:4046 tport_resolve() tport_resolve addrinfo = 172.16.3.247:63594 000001a2|2017-Aug-02 10:45:29.337716| tport.c:4680 tport_by_addrinfo() tport_by_addrinfo(0x1dd9f70): not found by name UDP/172.16.3.247:63594 000001a3|2017-Aug-02 10:45:29.337812| tport.c:3492 tport_send_msg() tport_vsend returned 308 000001a4|2017-Aug-02 10:45:29.337915| send 308 bytes to udp/[172.16.3.247]:63594 at 10:45:29.337768: SIP/2.0 403 Forbidden Via: SIP/2.0/UDP 172.16.3.247:63594;branch=z9hG4bK-524287-1---1968cddf0f997e84;rport=63594 From: sip:1000@172.16.23.26;transport=UDP;tag=db9cd535 To: sip:1000@172.16.23.26;transport=UDP;tag=y9Q6ZQ9cyB23Q Call-ID: pq19Xrd5gGi0Y177dUvI5Q.. CSeq: 1 REGISTER Content-Length: 0

000001a5|2017-Aug-02 10:45:29.337961| nta.c:6791 incoming_reply() nta: sent 403 Forbidden for REGISTER (1) 000001a6|2017-Aug-02 10:45:29.338021| ClientController::removeApiRequest: clientMsgId ffa775f3-5f91-4b79-9df8-778fb953b1ac; size: 0 000001a7|2017-Aug-02 10:45:29.338089| ClientController::removeNetTransaction: transactionId a9179012-d6eb-4086-8cda-e45667c511b7; size: 0 000001a8|2017-Aug-02 10:45:29.338135| SipDialogController::doRespondToSipRequest destroying irq 0x1ded3d0 ^C You have new mail in /var/spool/mail/root