Thats because your configuration file is not sending packet out (RELAY) to MSC instead it is only doing a Loadbalancer / destination lookup in TOASTERISK route and comes out of it, processes the following routes in orderroute(SIPOUT);route(PRESENCE);route(REGISTRAR);route(PSTN);route(LOCATION);Where finally in LOCATION route it tries to find the destination user 0730092190 online locally on Kamailio, which it can't find and says 404 Not Found.You should modify your TOASTERISK route as follow:route[TOASTERISK] {if(ds_is_from_list("2")) {#Call from Telco Should goto Asterisk pool in Loadbalanced modeif(!ds_select_dst("1", "4")) {sl_send_reply("500", "Service Unavailable");xlog("L_INFO","[$fU@$si:$sp]{$rm} No destinations available for $rd \n");exit;}route(RELAY);}if(ds_is_from_list("1")) {#Call from Asterisk servers pool, send it to telco using LoadBalancerif(!ds_select_dst("2", "4")) {sl_send_reply("500", "Service Unavailable");xlog("L_INFO","[$fU@$si:$sp]{$rm} No destinations available for $rd \n");exit;}route(RELAY);}}This will immediately route the packet out towards the new $du after the loadbalancer function ds_select_dst(...)On Tue, Aug 11, 2015 at 10:48 AM, Sandeep Chakravarthi <ivschakravarthi@gmail.com> wrote:Hi,Kamailio is sending 404 Response and its not MSC.If you see the pcap file , Kamailio has to forward the SIP invite packet to MSC which it got from Asterisk server. But it is not happening.I am attaching the pcap one more time for your reference.In my pcap, below are the server details172.22.14.12 - Kamailio server172.22.14.17 - Asterisk server172.22.0.68 - MSCRegards,SandeepWarm Regards,
Sandeep Chakravarthi.On Tue, Aug 11, 2015 at 7:10 PM, SamyGo <govoiper@gmail.com> wrote:Hi Sandeep,what is the problem here ? Kamailio just sends a 404 on its own or is really sending calls to MSC and MSC is replying with 404 ?On Mon, Aug 10, 2015 at 12:33 PM, Sandeep Chakravarthi <ivschakravarthi@gmail.com> wrote:Hi ,Sorry for the delayed reply.I have configured my Asterisk and kamailio server, but when i initiate one outbound call from my asterisk server to kamailio server, kamailio server is initiating the call to MSC.Please find the attached pcap details for your reference.Below is my kamailio debug log and kamailio.cfg file.Please check the pcap and below cfg file and log file and let me know whether to change anything in cfg file or not.++++++++++++++++++++++++++++++++++++++++++++++++request_route {# per request initial checksroute(REQINIT);# NAT detectionroute(NATDETECT);# CANCEL processingif (is_method("CANCEL")){if (t_check_trans()) {route(RELAY);}exit;}# handle requests within SIP dialogsroute(WITHINDLG);### only initial requests (no To tag)t_check_trans();# authenticationroute(AUTH);# record routing for dialog forming requests (in case they are routed)# - remove preloaded route headersremove_hf("Route");if (is_method("INVITE|SUBSCRIBE"))record_route();# account only INVITEsif (is_method("INVITE")){setflag(FLT_ACC); # do accounting}route(TOASTERISK);# dispatch requests to foreign domainsroute(SIPOUT);### requests for my local domains# handle presence related requestsroute(PRESENCE);# handle registrationsroute(REGISTRAR);if ($rU==$null){# request with no Username in RURIsl_send_reply("484","Address Incomplete");exit;}# dispatch destinations to PSTNroute(PSTN);# user location serviceroute(LOCATION);}route[TOASTERISK] {if(ds_is_from_list("2")) {#Call from Telco Should goto Asterisk pool in Loadbalanced modeif(!ds_select_dst("1", "4")) {sl_send_reply("500", "Service Unavailable");xlog("L_INFO","[$fU@$si:$sp]{$rm} No destinations available for $rd \n");exit;}}if(ds_is_from_list("1")) {#Call from Asterisk servers pool, send it to telco using LoadBalancerif(!ds_select_dst("2", "4")) {sl_send_reply("500", "Service Unavailable");xlog("L_INFO","[$fU@$si:$sp]{$rm} No destinations available for $rd \n");exit;}}}+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Debug log8(1186) DEBUG: <core> [parser/msg_parser.c:623]: parse_msg(): SIP Request:8(1186) DEBUG: <core> [parser/msg_parser.c:625]: parse_msg(): method: <INVITE>8(1186) DEBUG: <core> [parser/msg_parser.c:627]: parse_msg(): uri: <sip:0730092190@172.22.14.12>8(1186) DEBUG: <core> [parser/msg_parser.c:629]: parse_msg(): version: <SIP/2.0>8(1186) DEBUG: <core> [parser/parse_via.c:1284]: parse_via_param(): Found param type 232, <branch> = <z9hG4bK3c5fb091>; state=168(1186) DEBUG: <core> [parser/parse_via.c:2672]: parse_via(): end of header reached, state=58(1186) DEBUG: <core> [parser/msg_parser.c:513]: parse_headers(): parse_headers: Via found, flags=28(1186) DEBUG: <core> [parser/msg_parser.c:515]: parse_headers(): parse_headers: this is the first via8(1186) DEBUG: <core> [receive.c:152]: receive_msg(): After parse_msg...8(1186) DEBUG: <core> [receive.c:193]: receive_msg(): preparing to run routing scripts...8(1186) DEBUG: maxfwd [mf_funcs.c:85]: is_maxfwd_present(): value = 708(1186) DEBUG: <core> [parser/parse_addr_spec.c:898]: parse_addr_spec(): end of header reached, state=108(1186) DEBUG: <core> [parser/msg_parser.c:190]: get_hdr_field(): DEBUG: get_hdr_field: <To> [31]; uri=[sip:0730092190@172.22.14.12]8(1186) DEBUG: <core> [parser/msg_parser.c:192]: get_hdr_field(): DEBUG: to body [<sip:0730092190@172.22.14.12>]8(1186) DEBUG: <core> [parser/msg_parser.c:170]: get_hdr_field(): get_hdr_field: cseq <CSeq>: <102> <INVITE>8(1186) DEBUG: <core> [parser/msg_parser.c:204]: get_hdr_field(): DEBUG: get_hdr_body : content_length=3278(1186) DEBUG: <core> [parser/msg_parser.c:106]: get_hdr_field(): found end of header8(1186) DEBUG: <core> [parser/parse_addr_spec.c:176]: parse_to_param(): DEBUG: add_param: tag=as4decf9758(1186) DEBUG: <core> [parser/parse_addr_spec.c:898]: parse_addr_spec(): end of header reached, state=298(1186) DEBUG: sanity [mod_sanity.c:255]: w_sanity_check(): sanity checks result: 18(1186) DEBUG: siputils [checks.c:103]: has_totag(): no totag8(1186) DEBUG: tm [t_lookup.c:1072]: t_check_msg(): DEBUG: t_check_msg: msg id=2 global id=1 T start=0xffffffff8(1186) DEBUG: tm [t_lookup.c:527]: t_lookup_request(): t_lookup_request: start searching: hash=3888, isACK=08(1186) DEBUG: tm [t_lookup.c:485]: matching_3261(): DEBUG: RFC3261 transaction matching failed8(1186) DEBUG: tm [t_lookup.c:709]: t_lookup_request(): DEBUG: t_lookup_request: no transaction found8(1186) DEBUG: tm [t_lookup.c:1141]: t_check_msg(): DEBUG: t_check_msg: msg id=2 global id=2 T end=(nil)8(1186) DEBUG: <core> [socket_info.c:583]: grep_sock_info(): grep_sock_info - checking if host==us: 12==9 && [172.22.14.17] == [127.0.0.1]8(1186) DEBUG: <core> [socket_info.c:587]: grep_sock_info(): grep_sock_info - checking if port 5060 (advertise 0) matches port 50608(1186) DEBUG: <core> [socket_info.c:583]: grep_sock_info(): grep_sock_info - checking if host==us: 12==12 && [172.22.14.17] == [172.22.14.12]8(1186) DEBUG: <core> [socket_info.c:587]: grep_sock_info(): grep_sock_info - checking if port 5060 (advertise 0) matches port 50608(1186) DEBUG: <core> [socket_info.c:583]: grep_sock_info(): grep_sock_info - checking if host==us: 12==9 && [172.22.14.17] == [127.0.0.1]8(1186) DEBUG: <core> [socket_info.c:587]: grep_sock_info(): grep_sock_info - checking if port 5060 (advertise 0) matches port 50608(1186) DEBUG: <core> [socket_info.c:583]: grep_sock_info(): grep_sock_info - checking if host==us: 12==12 && [172.22.14.17] == [172.22.14.12]8(1186) DEBUG: <core> [socket_info.c:587]: grep_sock_info(): grep_sock_info - checking if port 5060 (advertise 0) matches port 50608(1186) DEBUG: <core> [forward.c:450]: check_self(): check_self: host != me8(1186) DEBUG: <core> [socket_info.c:583]: grep_sock_info(): grep_sock_info - checking if host==us: 12==9 && [172.22.14.17] == [127.0.0.1]8(1186) DEBUG: <core> [socket_info.c:587]: grep_sock_info(): grep_sock_info - checking if port 5060 (advertise 0) matches port 50608(1186) DEBUG: <core> [socket_info.c:583]: grep_sock_info(): grep_sock_info - checking if host==us: 12==12 && [172.22.14.17] == [172.22.14.12]8(1186) DEBUG: <core> [socket_info.c:587]: grep_sock_info(): grep_sock_info - checking if port 5060 (advertise 0) matches port 50608(1186) DEBUG: <core> [socket_info.c:583]: grep_sock_info(): grep_sock_info - checking if host==us: 12==9 && [172.22.14.17] == [127.0.0.1]8(1186) DEBUG: <core> [socket_info.c:587]: grep_sock_info(): grep_sock_info - checking if port 5060 (advertise 0) matches port 50608(1186) DEBUG: <core> [socket_info.c:583]: grep_sock_info(): grep_sock_info - checking if host==us: 12==12 && [172.22.14.17] == [172.22.14.12]8(1186) DEBUG: <core> [socket_info.c:587]: grep_sock_info(): grep_sock_info - checking if port 5060 (advertise 0) matches port 50608(1186) DEBUG: <core> [forward.c:450]: check_self(): check_self: host != me8(1186) DEBUG: <core> [socket_info.c:583]: grep_sock_info(): grep_sock_info - checking if host==us: 12==9 && [172.22.14.12] == [127.0.0.1]8(1186) DEBUG: <core> [socket_info.c:587]: grep_sock_info(): grep_sock_info - checking if port 5060 (advertise 0) matches port 50608(1186) DEBUG: <core> [socket_info.c:583]: grep_sock_info(): grep_sock_info - checking if host==us: 12==12 && [172.22.14.12] == [172.22.14.12]8(1186) DEBUG: <core> [socket_info.c:587]: grep_sock_info(): grep_sock_info - checking if port 5060 (advertise 0) matches port 50608(1186) DEBUG: dispatcher [dispatch.c:1629]: ds_select_dst(): set [2]8(1186) DEBUG: dispatcher [dispatch.c:1731]: ds_select_dst(): alg hash [0]8(1186) DEBUG: dispatcher [dispatch.c:1772]: ds_select_dst(): selected [4-2/0] <sip:172.28.0.68:5060>8(1186) DEBUG: <core> [socket_info.c:583]: grep_sock_info(): grep_sock_info - checking if host==us: 12==9 && [172.22.14.12] == [127.0.0.1]8(1186) DEBUG: <core> [socket_info.c:587]: grep_sock_info(): grep_sock_info - checking if port 5060 (advertise 0) matches port 50608(1186) DEBUG: <core> [socket_info.c:583]: grep_sock_info(): grep_sock_info - checking if host==us: 12==12 && [172.22.14.12] == [172.22.14.12]8(1186) DEBUG: <core> [socket_info.c:587]: grep_sock_info(): grep_sock_info - checking if port 5060 (advertise 0) matches port 50608(1186) DEBUG: registrar [lookup.c:158]: lookup(): '0730092190' Not found in usrloc8(1186) DEBUG: tm [t_lookup.c:1373]: t_newtran(): DEBUG: t_newtran: msg id=2 , global msg id=2 , T on entrance=(nil)8(1186) DEBUG: tm [t_lookup.c:527]: t_lookup_request(): t_lookup_request: start searching: hash=3888, isACK=08(1186) DEBUG: tm [t_lookup.c:485]: matching_3261(): DEBUG: RFC3261 transaction matching failed8(1186) DEBUG: tm [t_lookup.c:709]: t_lookup_request(): DEBUG: t_lookup_request: no transaction found8(1186) DEBUG: tm [t_hooks.c:380]: run_reqin_callbacks_internal(): DBG: trans=0xb5d3f20c, callback type 1, id 0 entered8(1186) DEBUG: <core> [md5utils.c:67]: MD5StringArray(): DEBUG: MD5 calculated: 3d26b7732e22874c5837c971c8ec76cd8(1186) DEBUG: tm [t_lookup.c:1072]: t_check_msg(): DEBUG: t_check_msg: msg id=2 global id=2 T start=0xb5d3f20c8(1186) DEBUG: tm [t_lookup.c:1144]: t_check_msg(): DEBUG: t_check_msg: T already found!8(1186) DEBUG: <core> [msg_translator.c:205]: check_via_address(): check_via_address(172.22.14.17, 172.22.14.17, 0)8(1186) DEBUG: <core> [mem/shm_mem.c:111]: _shm_resize(): WARNING:vqm_resize: resize(0) called8(1186) DEBUG: tm [t_reply.c:1653]: cleanup_uac_timers(): DEBUG: cleanup_uac_timers: RETR/FR timers reset8(1186) DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0xb5d3f20c, callback type 512, id 0 entered8(1186) DEBUG: acc [acc_logic.c:571]: tmcb_func(): acc callback called for t(0xb5d3f20c) event type 512, reply code 4048(1186) DEBUG: tm [t_reply.c:728]: _reply_light(): DEBUG: reply sent out. buf=0xb7bb8030: SIP/2.0 404 Not Foun..., shmem=0xb5d40cdc: SIP/2.0 404 Not Foun8(1186) DEBUG: tm [t_reply.c:738]: _reply_light(): DEBUG: _reply_light: finished8(1186) DEBUG: sl [sl.c:288]: send_reply(): reply in stateful mode (tm)++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Warm Regards,
Sandeep Chakravarthi.On Thu, Jul 30, 2015 at 6:35 PM, SamyGo <govoiper@gmail.com> wrote:Below is output from the dispatcher table, Set-2 is a pool of asterisk servers to be Load balanced, and Set-1 is the Telco IP.KAMSBC01:~# kamctl dispatcher dumpSET_NO:: 2SET:: 2URI:: sip:192.168.0.150:5050 flags=AP priority=1 attrs=URI:: sip:192.168.0.151:5060 flags=AP priority=1 attrs=URI:: sip:192.168.0.152:5070 flags=AP priority=1 attrs=URI:: sip:192.168.0.153:5080 flags=AP priority=1 attrs=URI:: sip:192.168.0.155:5090 flags=AP priority=1 attrs=SET:: 1URI:: sip:124.311.201.600:5060 flags=AP priority=1 attrs=Now in my kamailio.cfg in relevant routeif(ds_is_from_list("1")) {#Call from Telco Should goto Asterisk pool in Loadbalanced modeif(!ds_select_dst("2", "4")) {sl_send_reply("500", "Service Unavailable");xlog("L_INFO","[$fU@$si:$sp]{$rm} No destinations available for $rd \n");exit;}} else if (ds_is_from_list("2")) {#Call from Asterisk servers pool, send it to telco using LoadBalancerif(!ds_select_dst("1", "4")) {sl_send_reply("500", "Service Unavailable");xlog("L_INFO","[$fU@$si:$sp]{$rm} No destinations available for $rd \n");exit;}}So if your Telco has more than 1 IP you can do Load balancing.I hope this solves your problem.Best Regards,SammyOn Thu, Jul 30, 2015 at 3:17 AM, Sandeep Chakravarthi <ivschakravarthi@gmail.com> wrote:Hi,Can you share the sample code to differentiate the both telco IP and our server IP?.Warm Regards,
Sandeep Chakravarthi.On Tue, Jul 14, 2015 at 10:55 PM, SamyGo <govoiper@gmail.com> wrote:Sure but if you look into the dispatcher module there is a field called 'setid' or groupid. Use it wisely to differentiate between the Load Balanced asterisk pool and the Telco IP.The dispatcher module is exactly what you should use. You can find out if incoming source IP belongs to a particular set in dispatcher table thus you can tell if call is coming from Telco or from your Asterisks.You can select the dispatcher set for load balancing but if we only have one IP in there then it gets all the load.BR,SammyOn Tue, Jul 14, 2015 at 1:21 PM, Sandeep Chakravarthi <ivschakravarthi@gmail.com> wrote:Hi,Thanks for the immediate reply.You are right ,using the dispatcher module , i am able to send the OPTIONS packet to MSC Telco.But as i describer in my earlier mail, i am using the same dispatcher module to establish the sip trunk between my My Kamailio server and my Asterisk server.There is a table in the database with the name dispatcher.Now, in that table i have 2 recordsone is my Telco SIP IP and the other is Asterisk PBX IP.But as per my understanding from the google, dispatcher module is used for load balancing between the serversTelco SIP server will be sending the calls to Kamailio and Kamailio has to distribute completely to Asterisk server instead of distributing the calls between Telco SIP IP and Asterisk.Please help with it.Warm Regards,
Sandeep Chakravarthi.On Tue, Jul 14, 2015 at 10:28 PM, SamyGo <govoiper@gmail.com> wrote:Hi,You're right about using IP Auth in Kamailio. You'll need to use the permissions module. However I believe permissions module wont send the OPTIONS to the MSC SIP Server. For this you may alternatively use the "dispatcher" module.Take a look at the sample kamailio.cfg here: http://kb.asipto.com/asterisk:realtime:kamailio-4.0.x-asterisk-11.3.0-astdbFollow the tag WITH_IPAUTH and I'm sure you'll be able to implement it easily.BR,SammyOn Tue, Jul 14, 2015 at 12:51 PM, Sandeep Chakravarthi <ivschakravarthi@gmail.com> wrote:_______________________________________________
Hi,We have a requirement with one of our telcoWe are using asterisk in our servers and we are planning to implement SIP-I protocol and we choosed kamailio for it.In Kamailio website, i came to know that kamailio will be supporting both SIP-I and SIP-T protocolsBelow is what we need and pls confirm whether it is possible or not?Asterisk PBX <-------> Kamailio <--------> Telco MSCTelco will be forwarding the calls to kamailio on sip-i protocol and kamailio server has to forward the calls to our Asterisk server by converting sip-i to standard sip protocolSimiliarly Asterisk will be initiating sip call to kamailio server and kamailio server should convert it into SIP-I and should forward the call to Telco MSC1. I am able to establish the SIP trunk [sending OPTIONS from asterisk and kamailio acknowledges with 200 OK] between Asterisk and Kamailio using dispatcher module in kamailio and sip.conf in asterisk.How to establish the SIP trunk between kamailio and telco MSC?[Generally MSC will act as SIP server and kamalio should send OPTIONS packet and MSC will acknowledges with 200 OK]My telco MSC has only provided me the MSC SIP IP and there were no username/passwords provided.Means i need to use IP based authentication for the SIP Trunk establishment.In Kamailio how to achieve it?Please help and any suggestions/feedback will be highly appreciated and thankfulRegards,Sandeep
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users