If all calls go like this, usage of a rtp relay (rttpproxy/mediaproxy)
is no longer necessary -- I see in the config you call use_media_proxy()
- asterisk will handle media relay if it has public ip if the nat option
is enabled in asterisk as David says.
Cheers,
Daniel
On 10/09/08 12:07, David Villasmil wrote:
Try adding a:
nat=yes
to the kamailio/openser peer definition and test
dvg
On Thu, Oct 9, 2008 at 10:58 AM, luzango mfupe
<luzango.mfupe(a)gmail.com <mailto:luzango.mfupe@gmail.com>> wrote:
Hi mates,
I have this setup:
Xlite---->Openser---->Asterisk------>VoIP to PTSN Provider
I use kamailio 1.3.3(port5060), MediaProxy and Asterisk 1.4 (port
5065) on the same Debian Box in Realtime with no NAT. Asterisk
connects calls to the VoIP to PSTN provider. I am able to
establish calls towards the PSTN side(Landline & Mobiles) but
with no audio. I can hear the ringing tone but when the call
connects and the conversation begin i hear nothing so as the
Callee side.
Below are my configs,the ngrep captured packets and codecs.
####################################################################################
route[4] {
# routing to the public network
rewritehostport("xx.xxx.xxx.xx:5065");
t_on_failure("2");
if (!t_relay()) {
sl_reply_error();
};
exit;
}
route[6] {
#
# -- NAT handling --
#
if (isbflagset(6) || isbflagset(7)) {
append_hf("P-hint: Route[6]: mediaproxy \r\n");
use_media_proxy();
};
}
route[10] {
#from an internal domain -> inbound
#Native SIP destinations are handled using the location table
#Gateway destinations are handled by regular expressions
append_hf("P-hint: inbound->inbound \r\n");
if (uri=~"^sip:0[1-9][0-9]+@.*") {
if (is_user_in("credentials","local")) {
strip(1);
prefix("27");
route(6);
route(4);
exit;
} else {
sl_send_reply("403", "No permissions for local
calls");
exit;
};
};
if (uri=~"^sip:00[1-9][0-9]+@.*") {
if (is_user_in("credentials","int")) {
strip(2);
route(6);
route(4);
exit;
} else {
sl_send_reply("403", "No permissions for international
calls");
};
};
###################################################################################
This call was from the xlite softphone 1974 towards the Landline
0123825710.
###################################################################################
U 2008/12/06 03:38:43.896057 196.212.209.18:46738
<http://196.212.209.18:46738> -> kamailio IP:5060
INVITE sip:0123825710@KAMAILIO ip SIP/2.0..Via: SIP/2.0/UDP
192.168.0.55 <http://192.168.0.55>:
46738;branch=z9hG4bK-d8754z-2d5e73428b95d262-1---d8754z-;rport..Max-Forward
s: 70..Contact: <sip:1974@196.212.209.18:46738
<http://sip:1974@196.212.209.18:46738>>..To:
"0123825710"<sip:01238
25710@kamailio IP>..From: <sip:1974@kamailio
IP>;tag=353dd217..Call-ID:
MGRiNzM0ZGYxZTk1ZDI3ZjZmMTRhMDVlNTQ0NTUwZjg...CSeq: 1
INVITE..Allow: INVIT
E, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE,
INFO..Cont
ent-Type: application/sdp..User-Agent: X-Lite release 1014k
stamp 47051..Co
ntent-Length: 237....v=0..o=- 1 2 IN IP4
192.168.0.55..s=CounterPath X-Lite
3.0..c=IN IP4 192.168.0.55..t=0 0..m=audio 60782 RTP/AVP 0 8 3
101..a=fmtp
:101 0-15..a=rtpmap:101 telephone-event/8000..a=alt:1 1 :
ljiQYRpD NiMZsfdZ
192.168.0.55 <http://192.168.0.55> 60782..a=sendrecv..
U 2008/12/06 03:38:43.896350 Kamailio IP:5060 ->
196.212.209.18:46738 <http://196.212.209.18:46738>
SIP/2.0 407 Proxy Authentication Required..Via: SIP/2.0/UDP
192.168.0.55:46 <http://192.168.0.55:46>
738;branch=z9hG4bK-d8754z-2d5e73428b95d262-1---d8754z-;rport=46738;received
=196.212.209.18..To: "0123825710"<sip:0123825710@kamailio
IP>;tag=329cfea
a6ded039da25ff8cbb8668bd2.dcfe..From: <sip:1974@kamailio
IP>;tag=353dd217
..Call-ID: MGRiNzM0ZGYxZTk1ZDI3ZjZmMTRhMDVlNTQ0NTUwZjg...CSeq: 1
INVITE..Pr
oxy-Authenticate: Digest realm="41.208.212.97
<http://41.208.212.97>", nonce="4939d8cfeb060ab14354
85eee811cdf644f759a2"..Content-Length: 0....
U 2008/12/06 03:38:44.086313 196.212.209.18:46738
<http://196.212.209.18:46738> -> kamailio IP:5060
ACK sip:0123825710@kamailio IP SIP/2.0..Via: SIP/2.0/UDP
192.168.0.55:467 <http://192.168.0.55:467>
38;branch=z9hG4bK-d8754z-2d5e73428b95d262-1---d8754z-;rport..To:
"012382571
0"<sip:0123825710@kamailio
IP>;tag=329cfeaa6ded039da25ff8cbb8668bd2.dcfe.
.From: <sip:1974@41.208.212.97
<mailto:sip%3A1974@41.208.212.97>>;tag=353dd217..Call-ID:
MGRiNzM0ZGYxZTk1ZDI3
ZjZmMTRhMDVlNTQ0NTUwZjg...CSeq: 1 ACK..Content-Length: 0....
U 2008/12/06 03:38:44.582208 asterisk IP:5065 -> kamailio IP:5060
SIP/2.0 100 Trying..Via: SIP/2.0/UDP kamailio
IP;branch=z9hG4bKd78.7bd576
24.0;received=kamailio IP..Via: SIP/2.0/UDP
192.168.0.55:46738;received=1
96.212.209.18
<http://96.212.209.18>;branch=z9hG4bK-d8754z-2aedec27a8ddd96c-1---d8754z-;rport=4673
8..Record-Route: <sip:kamailio
IP;lr=on;ftag=353dd217;nat=yes>..From: <si
p:1974@kamailio IP>;tag=353dd217..To:
"0123825710"<sip:0123825710@41.208.
212.97>..Call-ID:
MGRiNzM0ZGYxZTk1ZDI3ZjZmMTRhMDVlNTQ0NTUwZjg...CSeq: 2 INV
ITE..User-Agent: Asterisk PBX..Allow: INVITE, ACK, CANCEL,
OPTIONS, BYE, RE
FER, SUBSCRIBE, NOTIFY..Supported: replaces..Contact:
<sip:27123825710@41.2
08.212.97:5065>..Content-Length: 0....
U 2008/12/06 03:38:44.711225 70.42.72.49:5060
<http://70.42.72.49:5060> -> Asterisk IP:5065
SIP/2.0 100 Giving a try..Via: SIP/2.0/UDP Asterisk
IP:5065;branch=z9hG4b
K22abec12;rport=5065..From: "1974" <sip:1974@Asterisk
IP:5065>;tag=as6a7c
b89f..To: <sip:1214650027123825710@70.42.72.49
<mailto:sip%3A1214650027123825710@70.42.72.49>>..Call-ID:
1934f5d443abffe07
c59d0a42215b49c@41.208.212.97..CSeq: 102 INVITE..Server: OpenSER
(1.3.2-not
ls (i386/solaris))..Content-Length: 0....
U 2008/12/06 03:38:47.206445 70.42.72.49:5060
<http://70.42.72.49:5060> -> Asterisk IP:5065
SIP/2.0 183 Session Progress..Via: SIP/2.0/UDP Asterisk
IP:5065;branch=z9
hG4bK22abec12;rport=5065..From: "1974" <sip:1974@Asterisk
IP:5065>;tag=as
6a7cb89f..To: <sip:1214650027123825710@70.42.72.49
<mailto:sip%3A1214650027123825710@70.42.72.49>>;tag=cba-1a6e-48ecbab6..
Call-ID: 1934f5d443abffe07c59d0a42215b49c@Asterisk IP..CSeq: 102
INVITE..
Contact: <sip:1214650027123825710@70.42.72.138
<mailto:sip%3A1214650027123825710@70.42.72.138>>..Date: Wed, 08
Oct 2008 13:
50:49 GMT..Server: BRSIP v2.0.1.2..Record-Route:
<sip:70.42.72.49 <http://70.42.72.49>;lr=on;fta
g=as6a7cb89f>..Content-Type: application/sdp..Content-Length:
212....v=0..o
=BRSDP 792898 792898 IN IP4 216.49.201.22..s=BRSDP Session..c=IN
IP4 216.49
.201.22..t=0 0..m=audio 27852 RTP/AVP 0
101..a=ptime:20..a=rtpmap:0 PCMU/80
00..a=rtpmap:101 telephone-event/8000..a=fmtp:101 0-15..
U 2008/12/06 03:38:47.206891 Asterisk IP:5065 -> Kamailio IP:5060
SIP/2.0 183 Session Progress..Via: SIP/2.0/UDP kamailio
IP;branch=z9hG4bK
d78.7bd57624.0;received=kamailio IP..Via: SIP/2.0/UDP
192.168.0.55:46738 <http://192.168.0.55:46738>;
received=196.212.209.18
<http://196.212.209.18>;branch=z9hG4bK-d8754z-2aedec27a8ddd96c-1---d8754z-;
rport=46738..Record-Route: <sip:41.208.212.97
<http://41.208.212.97>;lr=on;ftag=353dd217;nat=yes>.
.From: <sip:1974@kamilio IP>;tag=353dd217..To:
"0123825710"<sip:01238257
10(a)41.208.212.97
<mailto:10@41.208.212.97>>;tag=as4377a96d..Call-ID:
MGRiNzM0ZGYxZTk1ZDI3ZjZmMTRhMDVl
NTQ0NTUwZjg...CSeq: 2 INVITE..User-Agent: Asterisk PBX..Allow:
INVITE, ACK,
CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY..Supported:
replaces..Conta
ct: <sip:27123825710@Asterisk IP:5065>..Content-Type:
application/sdp..Co
ntent-Length: 287....v=0..o=root 2664 2664 IN IP4
41.208.212.97..s=session.
.c=IN IP4 41.208.212.97..t=0 0..m=audio 19202 RTP/AVP 8 0 3
101..a=rtpmap:8
PCMA/8000..a=rtpmap:0 PCMU/8000..a=rtpmap:3
GSM/8000..a=rtpmap:101 telepho
ne-event/8000..a=fmtp:101 0-16..a=silenceSupp:off - - -
-..a=ptime:20..a=se
ndrecv..
U 2008/12/06 03:38:47.207106 Kamailio IP:5060 ->
196.212.209.18:46738 <http://196.212.209.18:46738>
SIP/2.0 183 Session Progress..Via: SIP/2.0/UDP
192.168.0.55:46738;received=
196.212.209.18
<http://196.212.209.18>;branch=z9hG4bK-d8754z-2aedec27a8ddd96c-1---d8754z-;rport=467
38..Record-Route: <sip:kamailio
IP;lr=on;ftag=353dd217;nat=yes>..From: <s
ip:1974@Kamailio IP>;tag=353dd217..To:
"0123825710"<sip:0123825710@kamilio IP>;tag=as4377a96d..Call-ID:
MGRiNzM0ZGYxZTk1ZDI3ZjZmMTRhMDVlNTQ0NTUwZ
jg...CSeq: 2 INVITE..User-Agent: Asterisk PBX..Allow: INVITE,
ACK, CANCEL,
OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY..Supported:
replaces..Contact: <sip:
27123825710@41.208.212.97:5065
<http://27123825710@41.208.212.97:5065>>..Content-Type:
application/sdp..Content-Len
gth: 287....v=0..o=root 2664 2664 IN IP4 Asterisk
IP..s=session..c=IN IP4
41.208.212.97..t=0 0..m=audio 19202 RTP/AVP 8 0 3
101..a=rtpmap:8 PCMA/800
0..a=rtpmap:0 PCMU/8000..a=rtpmap:3 GSM/8000..a=rtpmap:101
telephone-event/
8000..a=fmtp:101 0-16..a=silenceSupp:off - - -
-..a=ptime:20..a=sendrecv..
########################################################################################
Sip.conf
[general]
context=from-trunk
bindport=5065
autocreatepeer=yes
bindaddr=xx.xxx.xxx.xx
disallow=all
;allow=gsm
;allow=amr
allow=alaw
allow=ulaw
allow=gsm
;allow=ilbc
;disallow=all
;
;useragent=Asterisk PBX
dtmfmode = rfc2833
domain=xx.xxx.xxx.xx ; Add IP address as local
domain
[Provider]
disallow=all
canreinvite=no
context=from-trunk
allow=all
;allow=ulaw
;allow=gsm
host=xx.xx.xx.xx
insecure=port,invite
type=peer ; we only want to call
out, not be call$
dtmfmode=rfc2833
#########################################################################################
Here is my codecs
41*CLI> core show translation
Translation times between formats (in milliseconds) for
one second of data
Source Format (Rows) Destination Format (Columns)
g723 gsm ulaw alaw g726aal2 adpcm slin lpc10 g729 speex
ilbc g726 g722 amr
g723 - - - - - - - - - -
- - - -
gsm - - 2 2 2 2 1 5 - 19
- 2 - 14
ulaw - 5 - 1 2 2 1 5 - 19
- 2 - 14
alaw - 5 1 - 2 2 1 5 - 19
- 2 - 14
g726aal2 - 5 2 2 - 2 1 5 - 19
- 1 - 14
adpcm - 5 2 2 2 - 1 5 - 19
- 2 - 14
slin - 4 1 1 1 1 - 4 - 18
- 1 - 13
lpc10 - 6 3 3 3 3 2 - - 20
- 3 - 15
g729 - - - - - - - - - -
- - - -
speex - 6 3 3 3 3 2 6 - -
- 3 - 15
ilbc - - - - - - - - - -
- - - -
g726 - 5 2 2 1 2 1 5 - 19
- - - 14
g722 - - - - - - - - - -
- - - -
amr - 6 3 3 3 3 2 6 - 20
- 3 - -
With best regards,
Lu.
--
Luzango Mfupe
TUUNE MOBILE
Tel:0128440528/0123825710
Tshwane-RSA
"...Ships are safe in harbor, but they were never meant to stay
there......."
_______________________________________________
Users mailing list
Users(a)lists.kamailio.org <mailto:Users@lists.kamailio.org>
http://lists.kamailio.org/cgi-bin/mailman/listinfo/users
------------------------------------------------------------------------
_______________________________________________
Users mailing list
Users(a)lists.kamailio.org
http://lists.kamailio.org/cgi-bin/mailman/listinfo/users