How can I configure ASterisk to act like a sip proxy server

Hi,

I am new to asterisk and was trying to do the following:

I want asterisk to just act like a stateless sip proxy server.

UE1(919811098110) -> ASterisk -> AppServ(B2BUA) -> ASterisk -> UE2(919891300300)

For this I tried with following configuration:

==================
sip.conf:

[general]

sendrpid = yes
[919811098110]
type=friend
context=phones
host=dynamic

[919891300300]
type=friend
host=dynamic
context=phones

==================
extension.conf

[globals]
[general]
[default]
exten => s,1,Verbose(1|Unrouted call handler)
exten => s,n,Answer()
exten => s,n,Wait(1)
exten => s,n,Playback(tt-weasels)
exten => s,n,Hangup()

[incoming_calls]

[internal]
exten => 500,1,Verbose(1|Echo test application)
exten => 500,n,Echo()
exten => 500,n,Hangup()

exten => 919891300300,1,Verbose(1|Extension 919891300300)
exten => 919891300300,n,SET(CONTACT=$[${SIP_HEADER(Contact):0:4}])
exten => 919891300300,n,Verbose(1|Contact is ${CONTACT})
exten => 919891300300,n,GotoIf($[${CONTACT} = user]?vcc:vcc_1)
exten => 919891300300,n(vcc),SIPAddHeader(Route: sip:444@172.16.105.35:5060\;lr)
exten => 919891300300,n,SIPAddHeader(Route: sip:444@172.31.118.53:5060\;lr)
exten => 919891300300,n,Dial(SIP/919891300300@172.31.118.53:5060)
exten => 919891300300,n,Hangup()
exten => 919891300300,n(vcc_1),Dial(SIP/919891300300@10.203.154.137:7062)
exten => 919891300300,n,Hangup()

exten => 1000,1,Verbose(1|Extension 1000)
exten => 1000,n,Dial(SIP/1000,30)
exten => 1000,n,Hangup()

[user]
type=friend
host=172.31.118.53
fromuser=user
secret=my_special_secret
context=incoming_calls
dtmfmode=rfc2833
disallow=all
allow=gsm
allow=ulaw
insecure=invite

[phones]
include => internal

I want it to forward my INVITE to an Application server. Fo which I have added a Dial rule towards 172.31.118.53(AS ip) and for termibnated leg I have added a Dial towards my UE.

my flow is correct upto 200 OK but as soon as ACK is sent , ASterisk sends another INVITE(native bridging) towards UE and AS.
Also Asterisk is not tunneling INVITE as it is.
It is not preserving Route Headers or extension headers. It is also changing the Call-ID. It is acting as a B2BUA while I want it to act as a SIP proxy.

– Executing [919891300300@phones:1] Verbose(“SIP/919811098110-006ef3f0”, “1|Exten
sion 919891300300”) in new stack
Extension 919891300300
– Executing [919891300300@phones:2] Set(“SIP/919811098110-006ef3f0”, “CONTACT=use
r”) in new stack
– Executing [919891300300@phones:3] Verbose(“SIP/919811098110-006ef3f0”, “1|Conta
ct is user”) in new stack
Contact is user
– Executing [919891300300@phones:4] GotoIf(“SIP/919811098110-006ef3f0”, “1?vcc:vc
c_1”) in new stack
– Goto (phones,919891300300,5)
– Executing [919891300300@phones:5] SIPAddHeader(“SIP/919811098110-006ef3f0”, “Ro
ute: sip:444@172.16.105.35:5060;lr”) in new stack
– Executing [919891300300@phones:6] SIPAddHeader(“SIP/919811098110-006ef3f0”, “Ro
ute: sip:444@172.31.118.53:5060;lr”) in new stack
– Executing [919891300300@phones:7] Dial(“SIP/919811098110-006ef3f0”, “SIP/919891
300300@172.31.118.53:5060”) in new stack
– Called 919891300300@172.31.118.53:5060
– Executing [919891300300@phones:1] Verbose(“SIP/919811098110-006f8fa0”, “1|Exten
sion 919891300300”) in new stack
Extension 919891300300
[Jan 7 11:11:11] WARNING[30907]: ast_expr2.fl:398 ast_yyerror: ast_yyerror(): syntax
error: syntax error, unexpected $end, expecting ‘-’ or ‘!’ or ‘(’ or ‘’; Input
:
sip:
^
[Jan 7 11:11:11] WARNING[30907]: ast_expr2.fl:402 ast_yyerror: If you have questions,
please refer to doc/channelvariables.txt in the asterisk source.
– Executing [919891300300@phones:2] Set(“SIP/919811098110-006f8fa0”, “CONTACT=0”)
in new stack
– Executing [919891300300@phones:3] Verbose(“SIP/919811098110-006f8fa0”, “1|Conta
ct is 0”) in new stack
Contact is 0
– Executing [919891300300@phones:4] GotoIf(“SIP/919811098110-006f8fa0”, “0?vcc:vc
c_1”) in new stack
– Goto (phones,919891300300,9)
– Executing [919891300300@phones:9] Dial(“SIP/919811098110-006f8fa0”, “SIP/919891
300300@10.203.154.137:7062”) in new stack
– Called 919891300300@10.203.154.137:7062
– SIP/10.203.154.137:7062-006fd710 is ringing
– SIP/172.31.118.53:5060-00704260 is ringing
– SIP/10.203.154.137:7062-006fd710 answered SIP/919811098110-006f8fa0
– Native bridging SIP/919811098110-006f8fa0 and SIP/10.203.154.137:7062-006fd710
– SIP/172.31.118.53:5060-00704260 answered SIP/919811098110-006ef3f0
– Native bridging SIP/919811098110-006ef3f0 and SIP/172.31.118.53:5060-00704260

== Spawn extension (phones, 919891300300, 7) exited non-zero on ‘SIP/919811098110-006ef3f0’
== Spawn extension (phones, 919891300300, 9) exited non-zero on ‘SIP/919811098110-006f8fa0’

==================
SIP logs:

<— SIP read from 10.203.154.137:8060 —>
INVITE sip:919891300300@172.16.105.35 SIP/2.0
Via: SIP/2.0/UDP 10.203.154.137:8060;branch=z9hG4bK2406256392-643
Max-Forwards: 70
From: usersip:919811098110@ssf.com:8060;tag=ICF_2406256392-644
To: sip:919891300300@172.16.105.35
Call-ID: 2406225392-642
CSeq: 1 INVITE
Supported: timer
Contact: usersip:919811098110@10.203.154.137:8060
P-Asserted-Identity: tel:919811098110
Route: sip:444@172.31.118.53:18260;lr
Route: sip:10.203.154.137:7062;lr
P-Charging-Vector: icid-value=p.v.net.1e;orig-ioi=s1.h1.net;ggsn=11.22.33.44;pdp-sig=yes;gcid=7271;auth-token=659;flow-id=1
Request-Disposition: no-fork
Content-Type: application/sdp
Allow: INVITE,ACK,CANCEL,BYE,OPTIONS
Content-Length: 102

v=0
o=user 12345 787 IN IP4 127.0.0.1
s=Session
c=IN IP4 127.0.0.1
t=0 0
m=audio 1027 RTP/AVP 8

<------------->
— (17 headers 6 lines) —
Sending to 10.203.154.137 : 8060 (no NAT)
Using INVITE request as basis request - 2406225392-642
Found user '919811098110’
Found RTP audio format 8
Peer audio RTP is at port 127.0.0.1:1027
Capabilities: us - 0x8000e (gsm|ulaw|alaw|h263), peer - audio=0x8 (alaw)/video=0x0 (nothing), combined - 0x8 (alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x0 (nothing), combined - 0x0 (nothing)
Peer audio RTP is at port 127.0.0.1:1027
Looking for 919891300300 in phones (domain 172.16.105.35)
list_route: hop: sip:919811098110@10.203.154.137:8060

<— Transmitting (no NAT) to 10.203.154.137:8060 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.203.154.137:8060;branch=z9hG4bK2406256392-643;received=10.203.154.137
From: usersip:919811098110@ssf.com:8060;tag=ICF_2406256392-644
To: sip:919891300300@172.16.105.35
Call-ID: 2406225392-642
CSeq: 1 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Contact: sip:919891300300@172.16.105.35
Content-Length: 0

<------------>
– Executing [919891300300@phones:1] Verbose(“SIP/919811098110-006ef3f0”, “1|Extension 919891300300”) in new stack
Extension 919891300300
– Executing [919891300300@phones:2] Set(“SIP/919811098110-006ef3f0”, “CONTACT=user”) in new stack
– Executing [919891300300@phones:3] Verbose(“SIP/919811098110-006ef3f0”, “1|Contact is user”) in new stack
Contact is user
– Executing [919891300300@phones:4] GotoIf(“SIP/919811098110-006ef3f0”, “1?vcc:vcc_1”) in new stack
– Goto (phones,919891300300,5)
– Executing [919891300300@phones:5] SIPAddHeader(“SIP/919811098110-006ef3f0”, “Route: sip:444@172.16.105.35:5060;lr”) in new stack
– Executing [919891300300@phones:6] SIPAddHeader(“SIP/919811098110-006ef3f0”, “Route: sip:444@172.31.118.53:5060;lr”) in new stack
– Executing [919891300300@phones:7] Dial(“SIP/919811098110-006ef3f0”, “SIP/919891300300@172.31.118.53:5060”) in new stack
Audio is at 172.16.105.35 port 15818
Adding codec 0x8 (alaw) to SDP
Adding codec 0x2 (gsm) to SDP
Adding codec 0x4 (ulaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (no NAT) to 172.31.118.53:5060:
INVITE sip:919891300300@172.31.118.53 SIP/2.0
Via: SIP/2.0/UDP 172.16.105.35:5060;branch=z9hG4bK3941d736;rport
From: “user” sip:919811098110@172.16.105.35;tag=as222da8e3
To: sip:919891300300@172.31.118.53
Contact: sip:919811098110@172.16.105.35
Call-ID: 37f3cef32ef6a7a04a3ffab144391df2@172.16.105.35
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Max-Forwards: 70
Remote-Party-ID: “user” sip:919811098110@172.16.105.35;privacy=off;screen=no
Date: Mon, 07 Jan 2008 06:07:28 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Route: sip:444@172.31.118.53:5060;lr
Route: sip:444@172.16.105.35:5060;lr
Content-Type: application/sdp
Content-Length: 289

v=0
o=root 30836 30836 IN IP4 172.16.105.35
s=session
c=IN IP4 172.16.105.35
t=0 0
m=audio 15818 RTP/AVP 8 3 0 101
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv


-- Called 919891300300@172.31.118.53:5060

r4standalone*CLI>
<— SIP read from 172.31.118.53:5060 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 172.16.105.35:5060;branch=z9hG4bK3941d736;rport
From: “user” sip:919811098110@172.16.105.35;tag=as222da8e3
To: sip:919891300300@172.31.118.53;tag=hssUA_1698955200-26065
Call-ID: 37f3cef32ef6a7a04a3ffab144391df2@172.16.105.35
CSeq: 102 INVITE
Contact: sip:172.31.118.53:5060
Content-Length: 0

<------------->
— (8 headers 0 lines) —
r4standalone*CLI>
<— SIP read from 172.31.118.53:4060 —>
INVITE sip:919891300300@172.31.118.53 SIP/2.0
Via: SIP/2.0/UDP 172.31.118.53:4060;branch=z9hG4bK4199865856–455
Route: sip:444@172.16.105.35:5060;lr
Max-Forwards: 70
Date: Mon, 07 Jan 2008 06:07:28 GMT
User-Agent: Asterisk PBX
Remote-Party-Id: “user” sip:919811098110@172.16.105.35;privacy=off;screen=no
Allow: INVITE,ACK,CANCEL,OPTIONS,BYE,REFER,SUBSCRIBE,NOTIFY
Supported: replaces
Accept: application/sdp
Accept-Language:en
Accept-Encoding:identity
From: “user” sip:919811098110@172.16.105.35;tag=as222da8e3
To: sip:919891300300@172.31.118.53
Call-ID: 62@172.31.118.53
CSeq: 1 INVITE
Contact: sip:172.31.118.53:4060
Content-Type: application/sdp
P-Asserted-Identity:tel:
Content-Length: 289

v=0
o=root 30836 30836 IN IP4 172.16.105.35
s=session
c=IN IP4 172.16.105.35
t=0 0
m=audio 15818 RTP/AVP 8 3 0 101
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

<------------->
— (20 headers 14 lines) —
Sending to 172.31.118.53 : 4060 (no NAT)
Using INVITE request as basis request - 62@172.31.118.53
Found user '919811098110’
Found RTP audio format 8
Found RTP audio format 3
Found RTP audio format 0
Found RTP audio format 101
Peer audio RTP is at port 172.16.105.35:15818
Found audio description format PCMA for ID 8
Found audio description format GSM for ID 3
Found audio description format PCMU for ID 0
Found audio description format telephone-event for ID 101
Capabilities: us - 0x8000e (gsm|ulaw|alaw|h263), peer - audio=0xe (gsm|ulaw|alaw)/video=0x0 (nothing), combined - 0xe (gsm|ulaw|alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x1 (telephone-event), combined - 0x1 (telephone-event)
Peer audio RTP is at port 172.16.105.35:15818
Looking for 919891300300 in phones (domain 172.31.118.53)
list_route: hop: sip:172.31.118.53:4060

<— Transmitting (no NAT) to 172.31.118.53:4060 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 172.31.118.53:4060;branch=z9hG4bK4199865856–455;received=172.31.118.53
From: “user” sip:919811098110@172.16.105.35;tag=as222da8e3
To: sip:919891300300@172.31.118.53
Call-ID: 62@172.31.118.53
CSeq: 1 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Contact: sip:919891300300@172.16.105.35
Content-Length: 0

<------------>
– Executing [919891300300@phones:1] Verbose(“SIP/919811098110-006f8fa0”, “1|Extension 919891300300”) in new stack
Extension 919891300300
[Jan 7 11:37:29] WARNING[30927]: ast_expr2.fl:398 ast_yyerror: ast_yyerror(): syntax error: syntax error, unexpected $end, expecting ‘-’ or ‘!’ or ‘(’ or ‘’; Input:
sip:
^
[Jan 7 11:37:29] WARNING[30927]: ast_expr2.fl:402 ast_yyerror: If you have questions, please refer to doc/channelvariables.txt in the asterisk source.
– Executing [919891300300@phones:2] Set(“SIP/919811098110-006f8fa0”, “CONTACT=0”) in new stack
– Executing [919891300300@phones:3] Verbose(“SIP/919811098110-006f8fa0”, “1|Contact is 0”) in new stack
Contact is 0CLI>
– Executing [919891300300@phones:4] GotoIf(“SIP/919811098110-006f8fa0”, “0?vcc:vcc_1”) in new stack
– Goto (phones,919891300300,9)
– Executing [919891300300@phones:9] Dial(“SIP/919811098110-006f8fa0”, “SIP/919891300300@10.203.154.137:7062”) in new stack
Audio is at 172.16.105.35 port 16960
Adding codec 0x4 (ulaw) to SDP
Adding codec 0x2 (gsm) to SDP
Adding codec 0x8 (alaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (no NAT) to 10.203.154.137:7062:
INVITE sip:919891300300@10.203.154.137:7062 SIP/2.0
Via: SIP/2.0/UDP 172.16.105.35:5060;branch=z9hG4bK1c687e7b;rport
From: “user” sip:919811098110@172.16.105.35;tag=as410056b8
To: sip:919891300300@10.203.154.137:7062
Contact: sip:919811098110@172.16.105.35
Call-ID: 33927ef34b216f384fadd5177a147678@172.16.105.35
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Max-Forwards: 70
Remote-Party-ID: “user” sip:919811098110@172.16.105.35;privacy=off;screen=no
Date: Mon, 07 Jan 2008 06:07:29 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Content-Type: application/sdp
Content-Length: 289

v=0
o=root 30836 30836 IN IP4 172.16.105.35
s=session
c=IN IP4 172.16.105.35
t=0 0
m=audio 16960 RTP/AVP 0 3 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv


-- Called 919891300300@10.203.154.137:7062

r4standalone*CLI>
<— SIP read from 10.203.154.137:7062 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 172.16.105.35:5060;branch=z9hG4bK1c687e7b;rport
From: "user"sip:919811098110@172.16.105.35;tag=as410056b8
To: sip:919891300300@10.203.154.137:7062;tag=ICF_2407428392-1040
Call-ID: 33927ef34b216f384fadd5177a147678@172.16.105.35
CSeq: 102 INVITE
Supported: timer
Contact: usersip:919891300300@10.203.154.137:7062
Content-Length: 0

<------------->
— (9 headers 0 lines) —
r4standalone*CLI>
<— SIP read from 10.203.154.137:7062 —>
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 172.16.105.35:5060;branch=z9hG4bK1c687e7b;rport
From: "user"sip:919811098110@172.16.105.35;tag=as410056b8
To: sip:919891300300@10.203.154.137:7062;tag=ICF_2407428392-1040
Call-ID: 33927ef34b216f384fadd5177a147678@172.16.105.35
CSeq: 102 INVITE
Supported: timer
Contact: usersip:919891300300@10.203.154.137:7062
P-Access-Network-Info: 3GPP-GERAN;cgi-3gpp=123456CAFEFACE
Content-Length: 0

<------------->
— (10 headers 0 lines) —
– SIP/10.203.154.137:7062-006fd710 is ringing

<— Transmitting (no NAT) to 172.31.118.53:4060 —>
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 172.31.118.53:4060;branch=z9hG4bK4199865856–455;received=172.31.118.53
From: “user” sip:919811098110@172.16.105.35;tag=as222da8e3
To: sip:919891300300@172.31.118.53;tag=as55d7b1e1
Call-ID: 62@172.31.118.53
CSeq: 1 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Contact: sip:919891300300@172.16.105.35
Content-Length: 0

<------------>
r4standalone*CLI>
<— SIP read from 172.31.118.53:5060 —>
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 172.16.105.35:5060;branch=z9hG4bK3941d736;rport
User-Agent: Asterisk PBX
From: “user” sip:919811098110@172.16.105.35;tag=as222da8e3
To: sip:919891300300@172.31.118.53;tag=as55d7b1e1
Call-ID: 37f3cef32ef6a7a04a3ffab144391df2@172.16.105.35
CSeq: 102 INVITE
Contact: sip:172.31.118.53:5060
Content-Length: 0

<------------->
— (9 headers 0 lines) —
– SIP/172.31.118.53:5060-00704260 is ringing

<— Transmitting (no NAT) to 10.203.154.137:8060 —>
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 10.203.154.137:8060;branch=z9hG4bK2406256392-643;received=10.203.154.137
From: usersip:919811098110@ssf.com:8060;tag=ICF_2406256392-644
To: sip:919891300300@172.16.105.35;tag=as71bae74b
Call-ID: 2406225392-642
CSeq: 1 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Contact: sip:919891300300@172.16.105.35
Content-Length: 0

<------------>
r4standalone*CLI>
<— SIP read from 10.203.154.137:7062 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 172.16.105.35:5060;branch=z9hG4bK1c687e7b;rport
From: "user"sip:919811098110@172.16.105.35;tag=as410056b8
To: sip:919891300300@10.203.154.137:7062;tag=ICF_2407428392-1040
Call-ID: 33927ef34b216f384fadd5177a147678@172.16.105.35
CSeq: 102 INVITE
Session-Expires: 3600;refresher=uas
Supported: timer
Contact: usersip:919891300300@10.203.154.137:7062
P-Access-Network-Info: 3GPP-GERAN;cgi-3gpp=123456CAFEFACE
Content-Type: application/sdp
Allow: INVITE,ACK,CANCEL,BYE,OPTIONS
Content-Length: 102

v=0
o=user 12345 787 IN IP4 127.0.0.1
s=Session
c=IN IP4 127.0.0.1
t=0 0
m=audio 1027 RTP/AVP 8

<------------->
— (13 headers 6 lines) —
Found RTP audio format 8
Peer audio RTP is at port 127.0.0.1:1027
Capabilities: us - 0x8000e (gsm|ulaw|alaw|h263), peer - audio=0x8 (alaw)/video=0x0 (nothing), combined - 0x8 (alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x0 (nothing), combined - 0x0 (nothing)
Peer audio RTP is at port 127.0.0.1:1027
list_route: hop: sip:919891300300@10.203.154.137:7062
set_destination: Parsing sip:919891300300@10.203.154.137:7062 for address/port to send to
set_destination: set destination to 10.203.154.137, port 7062
Transmitting (no NAT) to 10.203.154.137:7062:
ACK sip:919891300300@10.203.154.137:7062 SIP/2.0
Via: SIP/2.0/UDP 172.16.105.35:5060;branch=z9hG4bK1a2275c4;rport
From: “user” sip:919811098110@172.16.105.35;tag=as410056b8
To: sip:919891300300@10.203.154.137:7062;tag=ICF_2407428392-1040
Contact: sip:919811098110@172.16.105.35
Call-ID: 33927ef34b216f384fadd5177a147678@172.16.105.35
CSeq: 102 ACK
User-Agent: Asterisk PBX
Max-Forwards: 70
Remote-Party-ID: “user” sip:919811098110@172.16.105.35;privacy=off;screen=no
Content-Length: 0


-- SIP/10.203.154.137:7062-006fd710 answered SIP/919811098110-006f8fa0

Audio is at 172.16.105.35 port 19604
Adding codec 0x2 (gsm) to SDP
Adding codec 0x4 (ulaw) to SDP
Adding codec 0x8 (alaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP

<— Reliably Transmitting (no NAT) to 172.31.118.53:4060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 172.31.118.53:4060;branch=z9hG4bK4199865856–455;received=172.31.118.53
From: “user” sip:919811098110@172.16.105.35;tag=as222da8e3
To: sip:919891300300@172.31.118.53;tag=as55d7b1e1
Call-ID: 62@172.31.118.53
CSeq: 1 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Contact: sip:919891300300@172.16.105.35
Content-Type: application/sdp
Content-Length: 289

v=0
o=root 30836 30836 IN IP4 172.16.105.35
s=session
c=IN IP4 172.16.105.35
t=0 0
m=audio 19604 RTP/AVP 3 0 8 101
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

<------------>
– Native bridging SIP/919811098110-006f8fa0 and SIP/10.203.154.137:7062-006fd710
set_destination: Parsing sip:919891300300@10.203.154.137:7062 for address/port to send to
set_destination: set destination to 10.203.154.137, port 7062
Audio is at 172.16.105.35 port 16960
Adding codec 0x8 (alaw) to SDP
Reliably Transmitting (no NAT) to 10.203.154.137:7062:
INVITE sip:919891300300@10.203.154.137:7062 SIP/2.0
Via: SIP/2.0/UDP 172.16.105.35:5060;branch=z9hG4bK2548a0e1;rport
From: “user” sip:919811098110@172.16.105.35;tag=as410056b8
To: sip:919891300300@10.203.154.137:7062;tag=ICF_2407428392-1040
Contact: sip:919811098110@172.16.105.35
Call-ID: 33927ef34b216f384fadd5177a147678@172.16.105.35
CSeq: 103 INVITE
User-Agent: Asterisk PBX
Max-Forwards: 70
Remote-Party-ID: “user” sip:919811098110@172.16.105.35;privacy=off;screen=no
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
X-asterisk-Info: SIP re-invite (External RTP bridge)
Content-Type: application/sdp
Content-Length: 186

v=0
o=root 30836 30837 IN IP4 172.16.105.35
s=session
c=IN IP4 172.16.105.35
t=0 0
m=audio 15818 RTP/AVP 8
a=rtpmap:8 PCMA/8000
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv


r4standalone*CLI>
<— SIP read from 172.31.118.53:5060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 172.16.105.35:5060;branch=z9hG4bK3941d736;rport
User-Agent: Asterisk PBX
From: “user” sip:919811098110@172.16.105.35;tag=as222da8e3
To: sip:919891300300@172.31.118.53;tag=as55d7b1e1
Call-ID: 37f3cef32ef6a7a04a3ffab144391df2@172.16.105.35
CSeq: 102 INVITE
Contact: sip:172.31.118.53:5060
Allow: INVITE,ACK,CANCEL,OPTIONS,BYE,REFER,SUBSCRIBE,NOTIFY
Supported: replaces
Content-Type: application/sdp
Content-Length: 289

v=0tandalone*CLI>
o=root 30836 30836 IN IP4 172.16.105.35
s=session
c=IN IP4 172.16.105.35
t=0 0
m=audio 19604 RTP/AVP 3 0 8 101
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

<------------->
— (12 headers 14 lines) —
Found RTP audio format 3
Found RTP audio format 0
Found RTP audio format 8
Found RTP audio format 101
Peer audio RTP is at port 172.16.105.35:19604
Found audio description format GSM for ID 3
Found audio description format PCMU for ID 0
Found audio description format PCMA for ID 8
Found audio description format telephone-event for ID 101
Capabilities: us - 0x8000e (gsm|ulaw|alaw|h263), peer - audio=0xe (gsm|ulaw|alaw)/video=0x0 (nothing), combined - 0xe (gsm|ulaw|alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x1 (telephone-event), combined - 0x1 (telephone-event)
Peer audio RTP is at port 172.16.105.35:19604
list_route: hop: sip:172.31.118.53:5060
set_destination: Parsing sip:172.31.118.53:5060 for address/port to send to
set_destination: set destination to 172.31.118.53, port 5060
Transmitting (no NAT) to 172.31.118.53:5060:
ACK sip:172.31.118.53:5060 SIP/2.0
Via: SIP/2.0/UDP 172.16.105.35:5060;branch=z9hG4bK1e0b8829;rport
From: “user” sip:919811098110@172.16.105.35;tag=as222da8e3
To: sip:919891300300@172.31.118.53;tag=as55d7b1e1
Contact: sip:919811098110@172.16.105.35
Call-ID: 37f3cef32ef6a7a04a3ffab144391df2@172.16.105.35
CSeq: 102 ACK
User-Agent: Asterisk PBX
Max-Forwards: 70
Remote-Party-ID: “user” sip:919811098110@172.16.105.35;privacy=off;screen=no
Content-Length: 0


-- SIP/172.31.118.53:5060-00704260 answered SIP/919811098110-006ef3f0

Audio is at 172.16.105.35 port 10372
Adding codec 0x8 (alaw) to SDP

<— Reliably Transmitting (no NAT) to 10.203.154.137:8060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.203.154.137:8060;branch=z9hG4bK2406256392-643;received=10.203.154.137
From: usersip:919811098110@ssf.com:8060;tag=ICF_2406256392-644
To: sip:919891300300@172.16.105.35;tag=as71bae74b
Call-ID: 2406225392-642
CSeq: 1 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Contact: sip:919891300300@172.16.105.35
Content-Type: application/sdp
Content-Length: 186

v=0
o=root 30836 30836 IN IP4 172.16.105.35
s=session
c=IN IP4 172.16.105.35
t=0 0
m=audio 10372 RTP/AVP 8
a=rtpmap:8 PCMA/8000
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

<------------>
– Native bridging SIP/919811098110-006ef3f0 and SIP/172.31.118.53:5060-00704260
set_destination: Parsing sip:172.31.118.53:5060 for address/port to send to
set_destination: set destination to 172.31.118.53, port 5060
Audio is at 172.16.105.35 port 15818
Adding codec 0x8 (alaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (no NAT) to 172.31.118.53:5060:
INVITE sip:172.31.118.53:5060 SIP/2.0
Via: SIP/2.0/UDP 172.16.105.35:5060;branch=z9hG4bK46a345fc;rport
From: “user” sip:919811098110@172.16.105.35;tag=as222da8e3
To: sip:919891300300@172.31.118.53;tag=as55d7b1e1
Contact: sip:919811098110@172.16.105.35
Call-ID: 37f3cef32ef6a7a04a3ffab144391df2@172.16.105.35
CSeq: 103 INVITE
User-Agent: Asterisk PBX
Max-Forwards: 70
Remote-Party-ID: “user” sip:919811098110@172.16.105.35;privacy=off;screen=no
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
X-asterisk-Info: SIP re-invite (External RTP bridge)
Content-Type: application/sdp
Content-Length: 233

v=0
o=root 30836 30837 IN IP4 127.0.0.1
s=session
c=IN IP4 127.0.0.1
t=0 0
m=audio 1027 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv


r4standalone*CLI>
<— SIP read from 172.31.118.53:5060 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 172.16.105.35:5060;branch=z9hG4bK46a345fc;rport
From: “user” sip:919811098110@172.16.105.35;tag=as222da8e3
To: sip:919891300300@172.31.118.53;tag=as55d7b1e1
Call-ID: 37f3cef32ef6a7a04a3ffab144391df2@172.16.105.35
CSeq: 103 INVITE
Contact: sip:172.31.118.53:5060
Content-Length: 0

<------------->
— (8 headers 0 lines) —
r4standalone*CLI>
<— SIP read from 172.31.118.53:4060 —>
ACK sip:919891300300@172.16.105.35 SIP/2.0
Via: SIP/2.0/UDP 172.31.118.53:4060;branch=z9hG4bK4021015232-17095
Max-Forwards: 70
User-Agent: Asterisk PBX
Remote-Party-Id: “user” sip:919811098110@172.16.105.35;privacy=off;screen=no
From: “user” sip:919811098110@172.16.105.35;tag=as222da8e3
To: sip:919891300300@172.31.118.53;tag=as55d7b1e1
Call-ID: 62@172.31.118.53
CSeq: 1 ACK
Contact: sip:172.31.118.53:4060
Content-Length: 0

<------------->
— (11 headers 0 lines) —
set_destination: Parsing sip:172.31.118.53:4060 for address/port to send to
set_destination: set destination to 172.31.118.53, port 4060
Audio is at 172.16.105.35 port 19604
Adding codec 0x8 (alaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (no NAT) to 172.31.118.53:4060:
INVITE sip:172.31.118.53:4060 SIP/2.0
Via: SIP/2.0/UDP 172.16.105.35:5060;branch=z9hG4bK7cbd48ce;rport
From: sip:919891300300@172.31.118.53;tag=as55d7b1e1
To: “user” sip:919811098110@172.16.105.35;tag=as222da8e3
Contact: sip:919891300300@172.16.105.35
Call-ID: 62@172.31.118.53
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Max-Forwards: 70
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
X-asterisk-Info: SIP re-invite (External RTP bridge)
Content-Type: application/sdp
Content-Length: 233

v=0
o=root 30836 30837 IN IP4 127.0.0.1
s=session
c=IN IP4 127.0.0.1
t=0 0
m=audio 1027 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv


r4standalone*CLI>
<— SIP read from 172.31.118.53:4060 —>
INVITE sip:919891300300@172.16.105.35 SIP/2.0
Via: SIP/2.0/UDP 172.31.118.53:4060;branch=z9hG4bK4246374976-25763
Max-Forwards: 70
Allow: INVITE,ACK,CANCEL,OPTIONS,BYE,REFER,SUBSCRIBE,NOTIFY
Supported: replaces
Accept: application/sdp
Accept-Encoding:identity
Accept-Language:en
From: “user” sip:919811098110@172.16.105.35;tag=as222da8e3
To: sip:919891300300@172.31.118.53;tag=as55d7b1e1
Call-ID: 62@172.31.118.53
CSeq: 2 INVITE
Contact: sip:172.31.118.53:4060
Content-Type: application/sdp
Content-Length: 233

v=0
o=root 30836 30837 IN IP4 127.0.0.1
s=session
c=IN IP4 127.0.0.1
t=0 0
m=audio 1027 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

<------------->
— (15 headers 12 lines) —

<— Transmitting (no NAT) to 172.31.118.53:4060 —>
SIP/2.0 491 Request Pending
Via: SIP/2.0/UDP 172.31.118.53:4060;branch=z9hG4bK4246374976-25763;received=172.31.118.53
From: “user” sip:919811098110@172.16.105.35;tag=as222da8e3
To: sip:919891300300@172.31.118.53;tag=as55d7b1e1
Call-ID: 62@172.31.118.53
CSeq: 2 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Content-Length: 0
X-Asterisk-HangupCause: Normal Clearing
X-Asterisk-HangupCauseCode: 16

<------------>
r4standalone*CLI>
<— SIP read from 172.31.118.53:4060 —>
SIP/2.0 491 Request Pending
Via: SIP/2.0/UDP 172.16.105.35:5060;branch=z9hG4bK7cbd48ce;rport
From: sip:919891300300@172.31.118.53;tag=as55d7b1e1
To: “user” sip:919811098110@172.16.105.35;tag=as222da8e3
Call-ID: 62@172.31.118.53
CSeq: 102 INVITE
Content-Length: 0

<------------->
— (7 headers 0 lines) —
set_destination: Parsing sip:172.31.118.53:4060 for address/port to send to
set_destination: set destination to 172.31.118.53, port 4060
Transmitting (no NAT) to 172.31.118.53:4060:
ACK sip:172.31.118.53:4060 SIP/2.0
Via: SIP/2.0/UDP 172.16.105.35:5060;branch=z9hG4bK7cbd48ce;rport
From: sip:919891300300@172.31.118.53;tag=as55d7b1e1
To: “user” sip:919811098110@172.16.105.35;tag=as222da8e3
Contact: sip:919891300300@172.16.105.35
Call-ID: 62@172.31.118.53
CSeq: 102 ACK
User-Agent: Asterisk PBX
Max-Forwards: 70
Content-Length: 0


r4standalone*CLI>
<— SIP read from 172.31.118.53:5060 —>
SIP/2.0 491 Request Pending
Via: SIP/2.0/UDP 172.16.105.35:5060;branch=z9hG4bK46a345fc;rport
From: “user” sip:919811098110@172.16.105.35;tag=as222da8e3
To: sip:919891300300@172.31.118.53;tag=as55d7b1e1
Call-ID: 37f3cef32ef6a7a04a3ffab144391df2@172.16.105.35
CSeq: 103 INVITE
Contact: sip:172.31.118.53:5060
Content-Length: 0

<------------->
— (8 headers 0 lines) —
set_destination: Parsing sip:172.31.118.53:5060 for address/port to send to
set_destination: set destination to 172.31.118.53, port 5060
Transmitting (no NAT) to 172.31.118.53:5060:
ACK sip:172.31.118.53:5060 SIP/2.0
Via: SIP/2.0/UDP 172.16.105.35:5060;branch=z9hG4bK46a345fc;rport
From: “user” sip:919811098110@172.16.105.35;tag=as222da8e3
To: sip:919891300300@172.31.118.53;tag=as55d7b1e1
Contact: sip:919811098110@172.16.105.35
Call-ID: 37f3cef32ef6a7a04a3ffab144391df2@172.16.105.35
CSeq: 103 ACK
User-Agent: Asterisk PBX
Max-Forwards: 70
Remote-Party-ID: “user” sip:919811098110@172.16.105.35;privacy=off;screen=no
Content-Length: 0


r4standalone*CLI>
<— SIP read from 172.31.118.53:4060 —>
ACK sip:919891300300@172.16.105.35 SIP/2.0
Via: SIP/2.0/UDP 172.31.118.53:4060;branch=z9hG4bK4246374976-25763
Max-Forwards: 70
User-Agent: Asterisk PBX
Remote-Party-Id: “user” sip:919811098110@172.16.105.35;privacy=off;screen=no
From: “user” sip:919811098110@172.16.105.35;tag=as222da8e3
To: sip:919891300300@172.31.118.53;tag=as55d7b1e1
Call-ID: 62@172.31.118.53
CSeq: 2 ACK
Contact: sip:172.31.118.53:4060
Content-Length: 0

<------------->
— (11 headers 0 lines) —
r4standalone*CLI>
<— SIP read from 10.203.154.137:8060 —>
ACK sip:919891300300@172.16.105.35 SIP/2.0
Via: SIP/2.0/UDP 10.203.154.137:8060;branch=z9hG4bK2410271392-645
Max-Forwards: 70
From: usersip:919811098110@ssf.com:8060;tag=ICF_2406256392-644
To: sip:919891300300@172.16.105.35;tag=as71bae74b
Call-ID: 2406225392-642
CSeq: 1 ACK
Contact: usersip:919811098110@10.203.154.137:8060
Content-Length: 0

<------------->
— (9 headers 0 lines) —
set_destination: Parsing sip:919811098110@10.203.154.137:8060 for address/port to send to
set_destination: set destination to 10.203.154.137, port 8060
Audio is at 172.16.105.35 port 10372
Adding codec 0x8 (alaw) to SDP
Reliably Transmitting (no NAT) to 10.203.154.137:8060:
INVITE sip:919811098110@10.203.154.137:8060 SIP/2.0
Via: SIP/2.0/UDP 172.16.105.35:5060;branch=z9hG4bK064a17a6;rport
From: sip:919891300300@172.16.105.35;tag=as71bae74b
To: usersip:919811098110@ssf.com:8060;tag=ICF_2406256392-644
Contact: sip:919891300300@172.16.105.35
Call-ID: 2406225392-642
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Max-Forwards: 70
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
X-asterisk-Info: SIP re-invite (External RTP bridge)
Content-Type: application/sdp
Content-Length: 186

v=0
o=root 30836 30837 IN IP4 172.16.105.35
s=session
c=IN IP4 172.16.105.35
t=0 0
m=audio 19604 RTP/AVP 8
a=rtpmap:8 PCMA/8000
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv


r4standalone*CLI>
<— SIP read from 10.203.154.137:7062 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 172.16.105.35:5060;branch=z9hG4bK2548a0e1;rport
From: "user"sip:919811098110@172.16.105.35;tag=as410056b8
To: sip:919891300300@10.203.154.137:7062;tag=ICF_2407428392-1040
Call-ID: 33927ef34b216f384fadd5177a147678@172.16.105.35
CSeq: 103 INVITE
Contact: usersip:919891300300@10.203.154.137:7062
Content-Type: application/sdp
Allow: INVITE,ACK,CANCEL,BYE,OPTIONS
Content-Length: 102

v=0
o=user 12345 788 IN IP4 127.0.0.1
s=Session
c=IN IP4 127.0.0.1
t=0 0
m=audio 1027 RTP/AVP 8

<------------->
— (10 headers 6 lines) —
Found RTP audio format 8
Peer audio RTP is at port 127.0.0.1:1027
Capabilities: us - 0xe (gsm|ulaw|alaw), peer - audio=0x8 (alaw)/video=0x0 (nothing), combined - 0x8 (alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x0 (nothing), combined - 0x0 (nothing)
Peer audio RTP is at port 127.0.0.1:1027
set_destination: Parsing sip:919891300300@10.203.154.137:7062 for address/port to send to
set_destination: set destination to 10.203.154.137, port 7062
Transmitting (no NAT) to 10.203.154.137:7062:
ACK sip:919891300300@10.203.154.137:7062 SIP/2.0
Via: SIP/2.0/UDP 172.16.105.35:5060;branch=z9hG4bK620a9b97;rport
From: “user” sip:919811098110@172.16.105.35;tag=as410056b8
To: sip:919891300300@10.203.154.137:7062;tag=ICF_2407428392-1040
Contact: sip:919811098110@172.16.105.35
Call-ID: 33927ef34b216f384fadd5177a147678@172.16.105.35
CSeq: 103 ACK
User-Agent: Asterisk PBX
Max-Forwards: 70
Remote-Party-ID: “user” sip:919811098110@172.16.105.35;privacy=off;screen=no
Content-Length: 0


r4standalone*CLI>
<— SIP read from 10.203.154.137:8060 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 172.16.105.35:5060;branch=z9hG4bK064a17a6;rport
From: sip:919891300300@172.16.105.35;tag=as71bae74b
To: usersip:919811098110@ssf.com:8060;tag=ICF_2406256392-644
Call-ID: 2406225392-642
CSeq: 102 INVITE
Contact: usersip:919811098110@10.203.154.137:8060
Content-Type: application/sdp
Allow: INVITE,ACK,CANCEL,BYE,OPTIONS
Content-Length: 102

v=0
o=user 12345 788 IN IP4 127.0.0.1
s=Session
c=IN IP4 127.0.0.1
t=0 0
m=audio 1027 RTP/AVP 8

<------------->
— (10 headers 6 lines) —
Found RTP audio format 8
Peer audio RTP is at port 127.0.0.1:1027
Capabilities: us - 0xe (gsm|ulaw|alaw), peer - audio=0x8 (alaw)/video=0x0 (nothing), combined - 0x8 (alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x0 (nothing), combined - 0x0 (nothing)
Peer audio RTP is at port 127.0.0.1:1027
list_route: hop: sip:919811098110@10.203.154.137:8060
set_destination: Parsing sip:919811098110@10.203.154.137:8060 for address/port to send to
set_destination: set destination to 10.203.154.137, port 8060
Transmitting (no NAT) to 10.203.154.137:8060:
ACK sip:919811098110@10.203.154.137:8060 SIP/2.0
Via: SIP/2.0/UDP 172.16.105.35:5060;branch=z9hG4bK71bd9e38;rport
From: sip:919891300300@172.16.105.35;tag=as71bae74b
To: usersip:919811098110@ssf.com:8060;tag=ICF_2406256392-644
Contact: sip:919891300300@172.16.105.35
Call-ID: 2406225392-642
CSeq: 102 ACK
User-Agent: Asterisk PBX
Max-Forwards: 70
Content-Length: 0

Asterisk is not a proxy, is a b2bua server, try use openser, openser.org/ .

Cheers.

Marco Bruni