Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- X.X.X.X Upstream Provider
- X.X.X.71 Upstream Proveder Media Gateway
- Y.Y.Y.Y MY Kamailio Public IP Address
- Z.Z.Z.Z Client Public IP Address
- 172.16.10.146 Client Private IP Address
- ######SIP-FLOW UPSTREAM PROVIDE <---> KAMAILIO
- INVITE sip:09711895361@X.X.X.X SIP/2.0
- Via: SIP/2.0/UDP Y.Y.Y.Y:2149;branch=z9hG4bK00E0F51008D6D4843B0E34E42C36
- From: <sip:09711895150@Y.Y.Y.Y>;tag=00E0F51008D6D4843B0E3E1E80F8
- To: <sip:09711895361@X.X.X.X>
- Call-ID: 505980000c82-4dcc001b-52422d5f-2e9c5f80-181cf48@127.0.0.1
- CSeq: 20994 INVITE
- Contact: <sip:Y.Y.Y.Y:5060>
- Allow-Events: refer
- Max-Forwards: 70
- Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, INFO, REFER, NOTIFY, SUBSCRIBE, UPDATE
- Content-Type: application/sdp
- Supported: 100rel, timer, replaces
- User-Agent: TELES.iSWITCH
- Content-Length: 312
- v=0
- o=- 379612009 0 IN IP4 Y.Y.Y.Y
- s=session
- t=0 0
- m=audio 6320 RTP/AVP 18 18 18 18 8 0 96
- c=IN IP4 X.X.X.71
- a=rtpmap:18 G729/8000
- a=rtpmap:18 G729A/8000
- a=rtpmap:18 G729B/8000
- a=rtpmap:18 G729/8000
- a=rtpmap:8 PCMA/8000
- a=rtpmap:0 PCMU/8000
- a=sendrecv
- a=rtpmap:96 telephone-event/8000
- SIP/2.0 100 trying -- your call is important to us
- Via: SIP/2.0/UDP Y.Y.Y.Y:2149;branch=z9hG4bK00E0F51008D6D4843B0E34E42C36;rport=2149
- From: <sip:09711895150@Y.Y.Y.Y>;tag=00E0F51008D6D4843B0E3E1E80F8
- To: <sip:09711895361@X.X.X.X>
- Call-ID: 505980000c82-4dcc001b-52422d5f-2e9c5f80-181cf48@127.0.0.1
- CSeq: 20994 INVITE
- Server: kamailio (3.1.3 (i386/linux))
- Content-Length: 0
- SIP/2.0 180 Ringing
- Via: SIP/2.0/UDP Y.Y.Y.Y:2149;rport=2149;branch=z9hG4bK00E0F51008D6D4843B0E34E42C36
- Record-Route: <sip:X.X.X.X;lr;nat=yes>
- Contact: <sip:09711895361@Z.Z.Z.Z:40597>
- To: <sip:09711895361@X.X.X.X>;tag=7a3af13f
- From: <sip:09711895150@Y.Y.Y.Y>;tag=00E0F51008D6D4843B0E3E1E80F8
- Call-ID: 505980000c82-4dcc001b-52422d5f-2e9c5f80-181cf48@127.0.0.1
- CSeq: 20994 INVITE
- User-Agent: X-Lite release 1104o stamp 56125
- Content-Length: 0
- P-hint: nated fixed
- SIP/2.0 200 OK
- Via: SIP/2.0/UDP Y.Y.Y.Y:2149;rport=2149;branch=z9hG4bK00E0F51008D6D4843B0E34E42C36
- Record-Route: <sip:X.X.X.X;lr;nat=yes>
- Contact: <sip:09711895361@Z.Z.Z.Z:40597>
- To: <sip:09711895361@X.X.X.X>;tag=7a3af13f
- From: <sip:09711895150@Y.Y.Y.Y>;tag=00E0F51008D6D4843B0E3E1E80F8
- Call-ID: 505980000c82-4dcc001b-52422d5f-2e9c5f80-181cf48@127.0.0.1
- CSeq: 20994 INVITE
- Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO
- Content-Type: application/sdp
- User-Agent: X-Lite release 1104o stamp 56125
- Content-Length: 198
- P-hint: forced rtp Z.Z.Z.Z
- P-hint: nated fixed
- v=0
- o=- 4 2 IN IP4 X.X.X.X
- s=CounterPath X-Lite 3.0
- c=IN IP4 X.X.X.X
- t=0 0
- m=audio 60180 RTP/AVP 8 0 96
- a=fmtp:96 0-15
- a=rtpmap:96 telephone-event/8000
- a=sendrecv
- a=nortpproxy:yes
- ACK sip:09711895361@Z.Z.Z.Z:40597 SIP/2.0
- Via: SIP/2.0/UDP Y.Y.Y.Y:2149;branch=z9hG4bK00E0F51008D6D4843D5EC23085CB
- Route: <sip:X.X.X.X;lr;nat=yes>
- From: <sip:09711895150@Y.Y.Y.Y>;tag=00E0F51008D6D4843B0E3E1E80F8
- To: <sip:09711895361@X.X.X.X>;tag=7a3af13f
- Call-ID: 505980000c82-4dcc001b-52422d5f-2e9c5f80-181cf48@127.0.0.1
- CSeq: 20994 ACK
- Contact: <sip:09711895150@Y.Y.Y.Y:5060>
- Max-Forwards: 70
- Content-Length: 0
- BYE sip:09711895361@Z.Z.Z.Z:40597 SIP/2.0
- Via: SIP/2.0/UDP Y.Y.Y.Y:2149;branch=z9hG4bK00E0F51008D6D4843F3CB0C591D4
- Route: <sip:X.X.X.X;lr;nat=yes>
- From: <sip:09711895150@Y.Y.Y.Y>;tag=00E0F51008D6D4843B0E3E1E80F8
- To: <sip:09711895361@X.X.X.X>;tag=7a3af13f
- Call-ID: 505980000c82-4dcc001b-52422d5f-2e9c5f80-181cf48@127.0.0.1
- CSeq: 20995 BYE
- Contact: <sip:09711895150@Y.Y.Y.Y:5060>
- Max-Forwards: 70
- Reason: Q.850;cause=16;text="Normal call clearing"
- Content-Length: 0
- SIP/2.0 200 OK
- Via: SIP/2.0/UDP Y.Y.Y.Y:2149;rport=2149;branch=z9hG4bK00E0F51008D6D4843F3CB0C591D4
- Contact: <sip:09711895361@X.X.X.X>
- To: <sip:09711895361@X.X.X.X>;tag=7a3af13f
- From: <sip:09711895150@Y.Y.Y.Y>;tag=00E0F51008D6D4843B0E3E1E80F8
- Call-ID: 505980000c82-4dcc001b-52422d5f-2e9c5f80-181cf48@127.0.0.1
- CSeq: 20995 BYE
- User-Agent: X-Lite release 1104o stamp 56125
- Content-Length: 0
- ######SIP-FLOW KAMAILIO <---> CLIENT
- INVITE sip:09711895361@Y.Y.Y.Y SIP/2.0
- Record-Route: <sip:Y.Y.Y.Y;lr=on;nat=yes>
- Via: SIP/2.0/UDP Y.Y.Y.Y;branch=z9hG4bKf5d3.2601ebd4.0
- Via: SIP/2.0/UDP X.X.X.X:2149;rport=2149;branch=z9hG4bK00E0F51008D6D4843B0E34E42C36
- From: <sip:09711895150@X.X.X.X>;tag=00E0F51008D6D4843B0E3E1E80F8
- To: <sip:09711895361@Y.Y.Y.Y>
- Call-ID: 505980000c82-4dcc001b-52422d5f-2e9c5f80-181cf48@127.0.0.1
- CSeq: 20994 INVITE
- Contact: <sip:X.X.X.X:5060>
- Allow-Events: refer
- Max-Forwards: 69
- Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, INFO, REFER, NOTIFY, SUBSCRIBE, UPDATE
- Content-Type: application/sdp
- Supported: 100rel, timer, replaces
- User-Agent: TELES.iSWITCH
- Content-Length: 325
- v=0
- o=- 379612009 0 IN IP4 Y.Y.Y.Y
- s=session
- t=0 0
- m=audio 43140 RTP/AVP 18 18 18 18 8 0 96
- c=IN IP4 Y.Y.Y.Y
- a=rtpmap:18 G729/8000
- a=rtpmap:18 G729A/8000
- a=rtpmap:18 G729B/8000
- a=rtpmap:18 G729/8000
- a=rtpmap:8 PCMA/8000
- a=rtpmap:0 PCMU/8000
- a=sendrecv
- a=rtpmap:96 telephone-event/8000
- a=nortpproxy:yes
- SIP/2.0 180 Ringing
- Via: SIP/2.0/UDP Y.Y.Y.Y;branch=z9hG4bKf5d3.2601ebd4.0
- Via: SIP/2.0/UDP X.X.X.X:2149;rport=2149;branch=z9hG4bK00E0F51008D6D4843B0E34E42C36
- Record-Route: <sip:Y.Y.Y.Y;lr;nat=yes>
- Contact: <sip:09711895361@Y.Y.Y.Y>
- To: <sip:09711895361@Y.Y.Y.Y>;tag=7a3af13f
- From: <sip:09711895150@X.X.X.X>;tag=00E0F51008D6D4843B0E3E1E80F8
- Call-ID: 505980000c82-4dcc001b-52422d5f-2e9c5f80-181cf48@127.0.0.1
- CSeq: 20994 INVITE
- User-Agent: X-Lite release 1104o stamp 56125
- Content-Length: 0
- SIP/2.0 200 OK
- Via: SIP/2.0/UDP Y.Y.Y.Y;branch=z9hG4bKf5d3.2601ebd4.0
- Via: SIP/2.0/UDP X.X.X.X:2149;rport=2149;branch=z9hG4bK00E0F51008D6D4843B0E34E42C36
- Record-Route: <sip:Y.Y.Y.Y;lr;nat=yes>
- Contact: <sip:09711895361@Y.Y.Y.Y>
- To: <sip:09711895361@Y.Y.Y.Y>;tag=7a3af13f
- From: <sip:09711895150@X.X.X.X>;tag=00E0F51008D6D4843B0E3E1E80F8
- Call-ID: 505980000c82-4dcc001b-52422d5f-2e9c5f80-181cf48@127.0.0.1
- CSeq: 20994 INVITE
- Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO
- Content-Type: application/sdp
- User-Agent: X-Lite release 1104o stamp 56125
- Content-Length: 184
- v=0
- o=- 4 2 IN IP4 172.16.10.146
- s=CounterPath X-Lite 3.0
- c=IN IP4 172.16.10.146
- t=0 0
- m=audio 65502 RTP/AVP 8 0 96
- a=fmtp:96 0-15
- a=rtpmap:96 telephone-event/8000
- a=sendrecv
- ACK sip:09711895361@84.253.172.33:40597 SIP/2.0
- Via: SIP/2.0/UDP Y.Y.Y.Y;branch=0
- Via: SIP/2.0/UDP X.X.X.X:2149;rport=2149;branch=z9hG4bK00E0F51008D6D4843D5EC23085CB
- From: <sip:09711895150@X.X.X.X>;tag=00E0F51008D6D4843B0E3E1E80F8
- To: <sip:09711895361@Y.Y.Y.Y>;tag=7a3af13f
- Call-ID: 505980000c82-4dcc001b-52422d5f-2e9c5f80-181cf48@127.0.0.1
- CSeq: 20994 ACK
- Contact: <sip:09711895150@X.X.X.X:5060>
- Max-Forwards: 69
- Content-Length: 0
- ....BYE sip:09711895361@84.253.172.33:40597 SIP/2.0
- Via: SIP/2.0/UDP Y.Y.Y.Y;branch=z9hG4bK06d3.3104cee2.0
- Via: SIP/2.0/UDP X.X.X.X:2149;rport=2149;branch=z9hG4bK00E0F51008D6D4843F3CB0C591D4
- From: <sip:09711895150@X.X.X.X>;tag=00E0F51008D6D4843B0E3E1E80F8
- To: <sip:09711895361@Y.Y.Y.Y>;tag=7a3af13f
- Call-ID: 505980000c82-4dcc001b-52422d5f-2e9c5f80-181cf48@127.0.0.1
- CSeq: 20995 BYE
- Contact: <sip:09711895150@X.X.X.X:5060>
- Max-Forwards: 69
- Reason: Q.850;cause=16;text="Normal call clearing"
- Content-Length: 0
- SIP/2.0 200 OK
- Via: SIP/2.0/UDP Y.Y.Y.Y;branch=z9hG4bK06d3.3104cee2.0
- Via: SIP/2.0/UDP X.X.X.X:2149;rport=2149;branch=z9hG4bK00E0F51008D6D4843F3CB0C591D4
- Contact: <sip:09711895361@Y.Y.Y.Y>
- To: <sip:09711895361@Y.Y.Y.Y>;tag=7a3af13f
- From: <sip:09711895150@X.X.X.X>;tag=00E0F51008D6D4843B0E3E1E80F8
- Call-ID: 505980000c82-4dcc001b-52422d5f-2e9c5f80-181cf48@127.0.0.1
- CSeq: 20995 BYE
- User-Agent: X-Lite release 1104o stamp 56125
- Content-Length: 0
- ######SIP ROUTING LOGIC
- route[PSTN] {
- #!ifdef WITH_PSTN
- # check if PSTN GW IP is defined
- if(strempty($sel(cfg_get.pstn.gw_ip))) {
- xlog("SCRIPT: PSTN rotuing enabled but pstn.gw_ip not defined\n");
- return;
- }
- # route to PSTN dialed numbers starting with '+' or '00'
- # (international format)
- # - update the condition to match your dialing rules for PSTN routing
- if(!($rU=~"^(\+|0|3)[1-9][0-9]{3,20}$"))
- return;
- # only local users allowed to call
- if(from_uri!=myself) {
- route(INBOUND);
- if (!allow_trusted("$fd", "$proto")) {
- xlog("L_WARN","not allowed trusted $td\n");
- if (!proxy_authorize("$td", "subscriber")) {
- xlog("L_WARN","proxy authorize fails $td\n");
- proxy_challenge("$td", "0");
- exit;
- };
- }else{
- rewriteuri("sip:09711895361@Y.Y.Y.Y");
- xlog("L_WARN","rewrited host $dd\n");
- if(lookup("location")){
- $ru="sip:" + $rU + "@" + $od;
- xlog("L_WARN", "ru * 0 * ='$ru' \n");
- route(RELAY);
- return;
- # t_relay();
- };
- }
- }
- #!endif
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement