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 checks
route(REQINIT);
# NAT detection
route(NATDETECT);
# CANCEL processing
if (is_method("CANCEL"))
{
if (t_check_trans()) {
route(RELAY);
}
exit;
}
# handle requests within SIP dialogs
route(WITHINDLG);
### only initial requests (no To tag)
t_check_trans();
# authentication
route(AUTH);
# record routing for dialog forming requests (in case they are routed)
# - remove preloaded route headers
remove_hf("Route");
if (is_method("INVITE|SUBSCRIBE"))
record_route();
# account only INVITEs
if (is_method("INVITE"))
{
setflag(FLT_ACC); # do accounting
}
route(TOASTERISK);
# dispatch requests to foreign domains
route(SIPOUT);
### requests for my local domains
# handle presence related requests
route(PRESENCE);
# handle registrations
route(REGISTRAR);
if ($rU==$null)
{
# request with no Username in RURI
sl_send_reply("484","Address Incomplete");
exit;
}
# dispatch destinations to PSTN
route(PSTN);
# user location service
route(LOCATION);
}
route[TOASTERISK] {
if(ds_is_from_list("2")) {
#Call from Telco Should goto Asterisk pool in Loadbalanced mode
if(!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 LoadBalancer
if(!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;
}
}
}
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
8(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: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=16
8(1186) DEBUG: <core> [parser/parse_via.c:2672]: parse_via(): end of header reached, state=5
8(1186) DEBUG: <core> [parser/msg_parser.c:513]: parse_headers(): parse_headers: Via found, flags=2
8(1186) DEBUG: <core> [parser/msg_parser.c:515]: parse_headers(): parse_headers: this is the first via
8(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 = 70
8(1186) DEBUG: <core> [parser/parse_addr_spec.c:898]: parse_addr_spec(): end of header reached, state=10
]
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=327
8(1186) DEBUG: <core> [parser/msg_parser.c:106]: get_hdr_field(): found end of header
8(1186) DEBUG: <core> [parser/parse_addr_spec.c:176]: parse_to_param(): DEBUG: add_param: tag=as4decf975
8(1186) DEBUG: <core> [parser/parse_addr_spec.c:898]: parse_addr_spec(): end of header reached, state=29
8(1186) DEBUG: sanity [mod_sanity.c:255]: w_sanity_check(): sanity checks result: 1
8(1186) DEBUG: siputils [checks.c:103]: has_totag(): no totag
8(1186) DEBUG: tm [t_lookup.c:1072]: t_check_msg(): DEBUG: t_check_msg: msg id=2 global id=1 T start=0xffffffff
8(1186) DEBUG: tm [t_lookup.c:527]: t_lookup_request(): t_lookup_request: start searching: hash=3888, isACK=0
8(1186) DEBUG: tm [t_lookup.c:485]: matching_3261(): DEBUG: RFC3261 transaction matching failed
8(1186) DEBUG: tm [t_lookup.c:709]: t_lookup_request(): DEBUG: t_lookup_request: no transaction found
8(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 5060
8(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 5060
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 5060
8(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 5060
8(1186) DEBUG: <core> [forward.c:450]: check_self(): check_self: host != me
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 5060
8(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 5060
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 5060
8(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 5060
8(1186) DEBUG: <core> [forward.c:450]: check_self(): check_self: host != me
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 5060
8(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 5060
8(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 5060
8(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 5060
8(1186) DEBUG: registrar [lookup.c:158]: lookup(): '0730092190' Not found in usrloc
8(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=0
8(1186) DEBUG: tm [t_lookup.c:485]: matching_3261(): DEBUG: RFC3261 transaction matching failed
8(1186) DEBUG: tm [t_lookup.c:709]: t_lookup_request(): DEBUG: t_lookup_request: no transaction found
8(1186) DEBUG: tm [t_hooks.c:380]: run_reqin_callbacks_internal(): DBG: trans=0xb5d3f20c, callback type 1, id 0 entered
8(1186) DEBUG: <core> [md5utils.c:67]: MD5StringArray(): DEBUG: MD5 calculated: 3d26b7732e22874c5837c971c8ec76cd
8(1186) DEBUG: tm [t_lookup.c:1072]: t_check_msg(): DEBUG: t_check_msg: msg id=2 global id=2 T start=0xb5d3f20c
8(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) called
8(1186) DEBUG: tm [t_reply.c:1653]: cleanup_uac_timers(): DEBUG: cleanup_uac_timers: RETR/FR timers reset
8(1186) DEBUG: tm [t_hooks.c:288]: run_trans_callbacks_internal(): DBG: trans=0xb5d3f20c, callback type 512, id 0 entered
8(1186) DEBUG: acc [acc_logic.c:571]: tmcb_func(): acc callback called for t(0xb5d3f20c) event type 512, reply code 404
8(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 Foun
8(1186) DEBUG: tm [t_reply.c:738]: _reply_light(): DEBUG: _reply_light: finished
8(1186) DEBUG: sl [sl.c:288]: send_reply(): reply in stateful mode (tm)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++