Hi, I have kamilio-4.2 and rtpengine running on the same machine.I have this scenario: softphone --> Kamailio with Rtpengine --> AsteriskThe softphone initiates the call, it is sent to the Asterisk. I can see the SDPs being re-written with the new IP/Ports provided by rtpengine: Invite from Kamailio to Asterisk200 Ok from Kamailio to Softphone However, I take a signaling/media capture on the server where the kamailio/rtpengine are running and see the RTP coming from both endpoints (softphone and asterisk) to the correct ports but there is no packets coming out from the proxy to either direction. I see these 2 lines on the rtpengine log and make me think that something prevents the rtpengine to stream out to the 2 endpoints:
Nov 1 18:59:26 ip-10-0-2-68 rtpengine[27764]: [0866b358-dc9c-1232-1399-3767db69b8dd port 35038] Write error on RTP socket Nov 1 18:59:26 ip-10-0-2-68 rtpengine[27764]: [0866b358-dc9c-1232-1399-3767db69b8dd port 35038] Final packet stats:
this is the log from the rtpengine: Nov 1 18:59:26 ip-10-0-2-68 rtpengine[27764]: Got valid command from 127.0.0.1:46686: offer - { "sdp": "v=0#015#012o=- 314474204173996793 6663595733338147866 IN IP4 99.153.161.148#015#012s=-#015#012c=IN IP4 99.153.161.148#015#012t=0 0#015#012m=audio 16386 RTP/AVP 114 0 8 101#015#012a=rtpmap:114 ilbc/8000#015#012a=fmtp:114 mode=30#015#012a=rtpmap:0 pcmu/8000#015#012a=rtpmap:8 pcma/8000#015#012a=rtpmap:101 telephone-event/8000#015#012a=fmtp:101 0-15#015#012", "direction": [ "pub", "pub" ], "replace": [ "origin", "session-connection" ], "call-id": "0866b358-dc9c-1232-1399-3767db69b8dd", "received-from": [ "IP4", " ... Nov 1 18:59:26 ip-10-0-2-68 rtpengine[27764]: ... 99.153.161.148" ], "from-tag": "73rH43p60NeKm", "command": "offer" } Nov 1 18:59:26 ip-10-0-2-68 rtpengine[27764]: [0866b358-dc9c-1232-1399-3767db69b8dd] Creating new call Nov 1 18:59:26 ip-10-0-2-68 rtpengine[27764]: [0866b358-dc9c-1232-1399-3767db69b8dd] Opened ports 35022..35023 for media relay Nov 1 18:59:26 ip-10-0-2-68 rtpengine[27764]: [0866b358-dc9c-1232-1399-3767db69b8dd] Opened ports 35038..35039 for media relay Nov 1 18:59:26 ip-10-0-2-68 rtpengine[27764]: [0866b358-dc9c-1232-1399-3767db69b8dd] Returning to SIP proxy: d3:sdp529:v=0#015#012o=- 314474204173996793 6663595733338147866 IN IP4 54.173.60.13#015#012s=-#015#012c=IN IP4 54.173.60.13#015#012t=0 0#015#012a=ice-lite#015#012m=audio 35022 RTP/AVP 114 0 8 101#015#012a=rtpmap:114 ilbc/8000#015#012a=fmtp:114 mode=30#015#012a=rtpmap:0 pcmu/8000#015#012a=rtpmap:8 pcma/8000#015#012a=rtpmap:101 telephone-event/8000#015#012a=fmtp:101 0-15#015#012a=sendrecv#015#012a=rtcp:35023#015#012a=ice-ufrag:oPm3I7OE#015#012a=ice-pwd:WjZnh7dnhfdkfoXDoqDbnCLLr7N7#015#012a=candidate:NZ1IXXQHYxOora9j 1 UDP 2130706431 54.173.60.13 35022 typ host#015#012a=candidate: ... Nov 1 18:59:26 ip-10-0-2-68 rtpengine[27764]: [0866b358-dc9c-1232-1399-3767db69b8dd] ... NZ1IXXQHYxOora9j 2 UDP 2130706430 54.173.60.13 35023 typ host#015#0126:result2:oke Nov 1 18:59:26 ip-10-0-2-68 rtpengine[27764]: Got valid command from 127.0.0.1:46686: answer - { "sdp": "v=0#015#012o=root 439969655 439969655 IN IP4 205.10.248.62#015#012s=Asterisk PBX 1.8.10.0#015#012c=IN IP4 205.10.248.62#015#012t=0 0#015#012m=audio 11142 RTP/AVP 0 101#015#012a=rtpmap:0 PCMU/8000#015#012a=rtpmap:101 telephone-event/8000#015#012a=fmtp:101 0-16#015#012a=silenceSupp:off - - - -#015#012a=ptime:20#015#012a=sendrecv#015#012", "direction": [ "pub", "pub" ], "replace": [ "origin", "session-connection" ], "call-id": "0866b358-dc9c-1232-1399-3767db69b8dd", "received-from": [ "IP4", "205.10.248.62" ], "fr ... Nov 1 18:59:26 ip-10-0-2-68 rtpengine[27764]: ... om-tag": "73rH43p60NeKm", "to-tag": "as57e7b8e3", "command": "answer" } Nov 1 18:59:26 ip-10-0-2-68 rtpengine[27764]: [0866b358-dc9c-1232-1399-3767db69b8dd] Returning to SIP proxy: d3:sdp500:v=0#015#012o=root 439969655 439969655 IN IP4 54.173.60.13#015#012s=Asterisk PBX 1.8.10.0#015#012c=IN IP4 54.173.60.13#015#012t=0 0#015#012a=ice-lite#015#012m=audio 35038 RTP/AVP 0 101#015#012a=rtpmap:0 PCMU/8000#015#012a=rtpmap:101 telephone-event/8000#015#012a=fmtp:101 0-16#015#012a=silenceSupp:off - - - -#015#012a=ptime:20#015#012a=sendrecv#015#012a=rtcp:35039#015#012a=ice-ufrag:cBL9SIw9#015#012a=ice-pwd:QHw7VHp83nMsLpD8ZoSqtDxGchN4#015#012a=candidate:NZ1IXXQHYxOora9j 1 UDP 2130706431 54.173.60.13 35038 typ host#015#012a=candidate:NZ1IXXQHYxOora9j 2 UDP 213070 ... Nov 1 18:59:26 ip-10-0-2-68 rtpengine[27764]: [0866b358-dc9c-1232-1399-3767db69b8dd] ... 6430 54.173.60.13 35039 typ host#015#0126:result2:oke Nov 1 18:59:26 ip-10-0-2-68 rtpengine[27764]: [0866b358-dc9c-1232-1399-3767db69b8dd port 35038] Write error on RTP socket Nov 1 18:59:26 ip-10-0-2-68 rtpengine[27764]: [0866b358-dc9c-1232-1399-3767db69b8dd port 35038] Final packet stats: Nov 1 18:59:26 ip-10-0-2-68 rtpengine[27764]: [0866b358-dc9c-1232-1399-3767db69b8dd port 35038] --- Tag 'as57e7b8e3', created 0:00 ago, in dialogue with '73rH43p60NeKm' Nov 1 18:59:26 ip-10-0-2-68 rtpengine[27764]: [0866b358-dc9c-1232-1399-3767db69b8dd port 35038] ------ Media #1, port 35022 <> 205.10.248.62:11142, 0 p, 0 b, 0 e Nov 1 18:59:26 ip-10-0-2-68 rtpengine[27764]: [0866b358-dc9c-1232-1399-3767db69b8dd port 35038] ------ Media #1, port 35023 <> 205.10.248.62:11143 (RTCP), 0 p, 0 b, 0 e Nov 1 18:59:26 ip-10-0-2-68 rtpengine[27764]: [0866b358-dc9c-1232-1399-3767db69b8dd port 35038] --- Tag '73rH43p60NeKm', created 0:00 ago, in dialogue with 'as57e7b8e3' Nov 1 18:59:26 ip-10-0-2-68 rtpengine[27764]: [0866b358-dc9c-1232-1399-3767db69b8dd port 35038] ------ Media #1, port 35038 <> 99.153.161.148:16386, 0 p, 0 b, 1 e Nov 1 18:59:26 ip-10-0-2-68 rtpengine[27764]: [0866b358-dc9c-1232-1399-3767db69b8dd port 35038] ------ Media #1, port 35039 <> 99.153.161.148:16387 (RTCP), 0 p, 0 b, 0 e Nov 1 18:59:36 ip-10-0-2-68 rtpengine[27764]: [0866b358-dc9c-1232-1399-3767db69b8dd port 35038] Got valid command from 127.0.0.1:46686: delete - { "call-id": "0866b358-dc9c-1232-1399-3767db69b8dd", "received-from": [ "IP4", "205.10.248.62" ], "from-tag": "as57e7b8e3", "command": "delete" } Nov 1 18:59:36 ip-10-0-2-68 rtpengine[27764]: [0866b358-dc9c-1232-1399-3767db69b8dd port 35038] [0866b358-dc9c-1232-1399-3767db69b8dd] Call-ID to delete not found Nov 1 18:59:36 ip-10-0-2-68 rtpengine[27764]: [0866b358-dc9c-1232-1399-3767db69b8dd port 35038] Returning to SIP proxy: d7:warning38:Call-ID not found or tags didn't match6:result2:oke
this is the log from kamailio (showing only the lines that include the word rtpengine): Nov 1 18:59:26 ip-10-0-2-68 ./kamailio[28001]: INFO: <script>: mylog: TO_FS: Starting rtpengine session. Invite Nov 1 18:59:26 ip-10-0-2-68 ./kamailio[28001]: exec: *** cfgtrace:request_route=[TO_FS] c=[/usr/local/kamailio-install-dir//etc/kamailio//kamailio.cfg] l=441 a=25 n=rtpengine_offer Nov 1 18:59:26 ip-10-0-2-68 ./kamailio[28001]: DEBUG: rtpengine [rtpengine_funcs.c:148]: check_content_type(): type <application/sdp> found valid Nov 1 18:59:26 ip-10-0-2-68 ./kamailio[28001]: DEBUG: rtpengine [rtpengine.c:1448]: rtpp_function_call(): proxy reply: d3:sdp529:v=0#015#012o=- 314474204173996793 6663595733338147866 IN IP4 54.173.60.13#015#012s=-#015#012c=IN IP4 54.173.60.13#015#012t=0 0#015#012a=ice-lite#015#012m=audio 35022 RTP/AVP 114 0 8 101#015#012a=rtpmap:114 ilbc/8000#015#012a=fmtp:114 mode=30#015#012a=rtpmap:0 pcmu/8000#015#012a=rtpmap:8 pcma/8000#015#012a=rtpmap:101 telephone-event/8000#015#012a=fmtp:101 0-15#015#012a=sendrecv#015#012a=rtcp:35023#015#012a=ice-ufrag:oPm3I7OE#015#012a=ice-pwd:WjZnh7dnhfdkfoXDoqDbnCLLr7N7#015#012a=candidate:NZ1IXXQHYxOora9j 1 UDP 2130706431 54.173.60.13 35022 typ host#015#012a=candidate:NZ1IXXQHYxOora9j 2 UDP 2130706430 54.173.60.13 35023 typ host#015#0126:result2:oke Nov 1 18:59:26 ip-10-0-2-68 ./kamailio[28001]: INFO: <script>: mylog: Starting rtpengine session. Answer Nov 1 18:59:26 ip-10-0-2-68 ./kamailio[28001]: exec: *** cfgtrace:onreply_route=[TO_FS] c=[/usr/local/kamailio-install-dir//etc/kamailio//kamailio.cfg] l=476 a=25 n=rtpengine_answer Nov 1 18:59:26 ip-10-0-2-68 ./kamailio[28001]: DEBUG: rtpengine [rtpengine_funcs.c:148]: check_content_type(): type <application/sdp> found valid Nov 1 18:59:26 ip-10-0-2-68 ./kamailio[28001]: DEBUG: rtpengine [rtpengine.c:1448]: rtpp_function_call(): proxy reply: d3:sdp500:v=0#015#012o=root 439969655 439969655 IN IP4 54.173.60.13#015#012s=Asterisk PBX 1.8.10.0#015#012c=IN IP4 54.173.60.13#015#012t=0 0#015#012a=ice-lite#015#012m=audio 35038 RTP/AVP 0 101#015#012a=rtpmap:0 PCMU/8000#015#012a=rtpmap:101 telephone-event/8000#015#012a=fmtp:101 0-16#015#012a=silenceSupp:off - - - -#015#012a=ptime:20#015#012a=sendrecv#015#012a=rtcp:35039#015#012a=ice-ufrag:cBL9SIw9#015#012a=ice-pwd:QHw7VHp83nMsLpD8ZoSqtDxGchN4#015#012a=candidate:NZ1IXXQHYxOora9j 1 UDP 2130706431 54.173.60.13 35038 typ host#015#012a=candidate:NZ1IXXQHYxOora9j 2 UDP 2130706430 54.173.60.13 35039 typ host#015#0126:result2:oke Nov 1 18:59:36 ip-10-0-2-68 ./kamailio[28001]: exec: *** cfgtrace:request_route=[LOOSE_ROUTE] c=[/usr/local/kamailio-install-dir//etc/kamailio//kamailio.cfg] l=488 a=24 n=rtpengine_delete Nov 1 18:59:36 ip-10-0-2-68 ./kamailio[28001]: DEBUG: rtpengine [rtpengine.c:1448]: rtpp_function_call(): proxy reply: d7:warning38:Call-ID not found or tags didn't match6:result2:oke
On 11/01/14 15:39, Juan Perez wrote:
Hi, I have kamilio-4.2 and rtpengine running on the same machine. I have this scenario:
softphone --> Kamailio with Rtpengine --> Asterisk The softphone initiates the call, it is sent to the Asterisk. I can see the SDPs being re-written with the new IP/Ports provided by rtpengine:
Invite from Kamailio to Asterisk 200 Ok from Kamailio to Softphone
However, I take a signaling/media capture on the server where the kamailio/rtpengine are running and see the RTP coming from both endpoints (softphone and asterisk) to the correct ports but there is no packets coming out from the proxy to either direction.
I see these 2 lines on the rtpengine log and make me think that something prevents the rtpengine to stream out to the 2 endpoints:
Nov 1 18:59:26 ip-10-0-2-68 rtpengine[27764]: [0866b358-dc9c-1232-1399-3767db69b8dd port 35038] Write error on RTP socket
Seeing as you're using the "direction" options, can you double check that the local IP addresses that you've configured at the command line are actually addresses bound to local interfaces on the machine?
cheers
thank you Richard, yes the IP is local to the machine:
./rtpengine --interface=pub/<PUBLIC_IP> --interface=priv/10.0.2.68 --listen-ng=127.0.0.1:7722--timeout=30 --port-min=35000 --port-max=65000 --log-level=7 --log-facility=daemon
The PUBLIC_IP is a NAT that the machine has, it is a virtual machine (Amazon), so it is not configured on any interface in that machine.
But the Private one it is configured on the eth0:
[root@ip-10-0-2-68]# ifconfig eth0 Link encap:Ethernet HWaddr 12:23:49:EF:3A:53 inet addr:10.0.2.68 Bcast:10.0.2.255 Mask:255.255.255.0 inet6 addr: fe80::1023:49ff:feef:3a53/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:9001 Metric:1 RX packets:161973 errors:0 dropped:0 overruns:0 frame:0 TX packets:102009 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:117022408 (111.6 MiB) TX bytes:20614133 (19.6 MiB) Interrupt:247
This is how kamailio is setup to communicate with rtpengine and it is the only line I have manually configured for that module in the kamailio config file, everything else is by default
:
# ----- rtpengine params ----- modparam("rtpengine", "rtpengine_sock", "udp:127.0.0.1:7722")
This is the line I have on the Route section to forward the INVITE to the Asterisk:
rtpengine_offer("direction=pub direction=pub replace-origin replace-session-connection");
The whole Route section is this:
route[TO_FS] { # here we load the Asterisk GWs that will be used to send the calls out. t_on_reply("TO_FS"); t_on_failure("TO_FS"); $var(result) = load_gws(10); rtpengine_offer("direction=pub direction=pub replace-origin replace-session-connection");
xlog("L_INFO","mylog: TO_FS: Call received. Loading LCR_GRP 10\n"); if (!load_gws(10)) { xlog("L_INFO","mylog: TO_FS: After, GW_URI_AVP: $avp(i:709).\n"); sl_send_reply("503", "Unable to load destination gateways"); xlog("L_INFO","mylog: TO_FS: Destination GWs load section failed!. Load_GW function.\n"); exit; }
if(!next_gw()){ xlog("L_INFO","mylog: TO_FS: After, GW_URI_AVP: $avp(i:709).\n"); xlog("L_INFO","mylog: TO_FS: Destination GWs load section failed!. Next_GW function.\n"); sl_send_reply("503", "Unable to find a gateway"); exit; } xlog("L_INFO","mylog: TO_FS: Destination GWs load section OK.\n");
if (!t_relay()) { xlog("L_INFO","mylog: TO_FS. T_Relay failed. Method [$rm].\n"); sl_reply_error(); }
exit; }
And this is the line I setup when I manage the Reply from the Asterisk:
onreply_route[TO_FS] { xlog("L_INFO","mylog: OnReply Route TO_FS.\n"); if (has_body("application/sdp")) { xlog("L_INFO","mylog: Starting rtpengine session. Answer\n"); rtpengine_answer("direction=pub direction=pub replace-origin replace-session-connection"); } exit; }
On Monday, November 3, 2014 8:59 AM, Richard Fuchs rfuchs@sipwise.com wrote:
On 11/01/14 15:39, Juan Perez wrote:
Hi, I have kamilio-4.2 and rtpengine running on the same machine. I have this scenario:
softphone --> Kamailio with Rtpengine --> Asterisk The softphone initiates the call, it is sent to the Asterisk. I can see the SDPs being re-written with the new IP/Ports provided by rtpengine:
Invite from Kamailio to Asterisk 200 Ok from Kamailio to Softphone
However, I take a signaling/media capture on the server where the kamailio/rtpengine are running and see the RTP coming from both endpoints (softphone and asterisk) to the correct ports but there is no packets coming out from the proxy to either direction.
I see these 2 lines on the rtpengine log and make me think that something prevents the rtpengine to stream out to the 2 endpoints:
Nov 1 18:59:26 ip-10-0-2-68 rtpengine[27764]: [0866b358-dc9c-1232-1399-3767db69b8dd port 35038] Write error on RTP socket
Seeing as you're using the "direction" options, can you double check that the local IP addresses that you've configured at the command line are actually addresses bound to local interfaces on the machine?
cheers
_______________________________________________ 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
On 11/03/14 09:17, Juan Perez wrote:
thank you Richard, yes the IP is local to the machine:
./rtpengine --interface=pub/<PUBLIC_IP> --interface=priv/10.0.2.68 --listen-ng=127.0.0.1:7722--timeout=30 --port-min=35000 --port-max=65000 --log-level=7 --log-facility=daemon
The PUBLIC_IP is a NAT that the machine has, it is a virtual machine (Amazon), so it is not configured on any interface in that machine.
There's your problem. If the address isn't configured on the machine, rtpengine cannot use it as source address when sending packets out. If RTP packets must be sent with one address as source, but another address must appear in SDP bodies, use this format:
--interface=pub/<RTP SOURCE ADDRESS>!<SDP ADDRESS>
cheers
thank you Richard,that was it, at least 1 side is working, the other side I think is having issues with the Record-Route having the private IP in it.I know it is out of context , but do you know how to make Kamailio to use the Public IP instead?txs a lot!jp
On Monday, November 3, 2014 9:17 AM, Juan Perez juan_perez_2014@yahoo.com wrote:
thank you Richard, yes the IP is local to the machine:
./rtpengine --interface=pub/<PUBLIC_IP> --interface=priv/10.0.2.68 --listen-ng=127.0.0.1:7722--timeout=30 --port-min=35000 --port-max=65000 --log-level=7 --log-facility=daemon
The PUBLIC_IP is a NAT that the machine has, it is a virtual machine (Amazon), so it is not configured on any interface in that machine.
But the Private one it is configured on the eth0:
[root@ip-10-0-2-68]# ifconfig eth0 Link encap:Ethernet HWaddr 12:23:49:EF:3A:53 inet addr:10.0.2.68 Bcast:10.0.2.255 Mask:255.255.255.0 inet6 addr: fe80::1023:49ff:feef:3a53/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:9001 Metric:1 RX packets:161973 errors:0 dropped:0 overruns:0 frame:0 TX packets:102009 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:117022408 (111.6 MiB) TX bytes:20614133 (19.6 MiB) Interrupt:247
This is how kamailio is setup to communicate with rtpengine and it is the only line I have manually configured for that module in the kamailio config file, everything else is by default
:
# ----- rtpengine params ----- modparam("rtpengine", "rtpengine_sock", "udp:127.0.0.1:7722")
This is the line I have on the Route section to forward the INVITE to the Asterisk:
rtpengine_offer("direction=pub direction=pub replace-origin replace-session-connection");
The whole Route section is this:
route[TO_FS] { # here we load the Asterisk GWs that will be used to send the calls out. t_on_reply("TO_FS"); t_on_failure("TO_FS"); $var(result) = load_gws(10); rtpengine_offer("direction=pub direction=pub replace-origin replace-session-connection");
xlog("L_INFO","mylog: TO_FS: Call received. Loading LCR_GRP 10\n"); if (!load_gws(10)) { xlog("L_INFO","mylog: TO_FS: After, GW_URI_AVP: $avp(i:709).\n"); sl_send_reply("503", "Unable to load destination gateways"); xlog("L_INFO","mylog: TO_FS: Destination GWs load section failed!. Load_GW function.\n"); exit; }
if(!next_gw()){ xlog("L_INFO","mylog: TO_FS: After, GW_URI_AVP: $avp(i:709).\n"); xlog("L_INFO","mylog: TO_FS: Destination GWs load section failed!. Next_GW function.\n"); sl_send_reply("503", "Unable to find a gateway"); exit; } xlog("L_INFO","mylog: TO_FS: Destination GWs load section OK.\n");
if (!t_relay()) { xlog("L_INFO","mylog: TO_FS. T_Relay failed. Method [$rm].\n"); sl_reply_error(); }
exit; }
And this is the line I setup when I manage the Reply from the Asterisk:
onreply_route[TO_FS] { xlog("L_INFO","mylog: OnReply Route TO_FS.\n"); if (has_body("application/sdp")) { xlog("L_INFO","mylog: Starting rtpengine session. Answer\n"); rtpengine_answer("direction=pub direction=pub replace-origin replace-session-connection"); } exit; }
On Monday, November 3, 2014 8:59 AM, Richard Fuchs rfuchs@sipwise.com wrote:
On 11/01/14 15:39, Juan Perez wrote:
Hi, I have kamilio-4.2 and rtpengine running on the same machine. I have this scenario:
softphone --> Kamailio with Rtpengine --> Asterisk The softphone initiates the call, it is sent to the Asterisk. I can see the SDPs being re-written with the new IP/Ports provided by rtpengine:
Invite from Kamailio to Asterisk 200 Ok from Kamailio to Softphone
However, I take a signaling/media capture on the server where the kamailio/rtpengine are running and see the RTP coming from both endpoints (softphone and asterisk) to the correct ports but there is no packets coming out from the proxy to either direction.
I see these 2 lines on the rtpengine log and make me think that something prevents the rtpengine to stream out to the 2 endpoints:
Nov 1 18:59:26 ip-10-0-2-68 rtpengine[27764]: [0866b358-dc9c-1232-1399-3767db69b8dd port 35038] Write error on RTP socket
Seeing as you're using the "direction" options, can you double check that the local IP addresses that you've configured at the command line are actually addresses bound to local interfaces on the machine?
cheers
_______________________________________________ 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