[Serusers] error: mediaproxy/sendMediaproxyCommand(): can't connect to MediaProxy

Java Rockx javarockx at gmail.com
Mon Feb 21 13:04:48 CET 2005


Charles,

How are you starting mediaproxy? Below is the start script I use.

Regards,
Paul

#!/bin/sh
#
# chkconfig: 2345 90 20
# description: VoIP RTP Proxy Server
#
# processname: mediaproxy
# pidfile: /var/run/mediaproxy.pid

# source function library
. /etc/rc.d/init.d/functions


PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

INSTALL_DIR="/usr/local"
RUNTIME_DIR="/var/run"

PROXY="$INSTALL_DIR/mediaproxy/mediaproxy.py"
DISPATCHER="$INSTALL_DIR/mediaproxy/proxydispatcher.py"
PROXY_PID="$RUNTIME_DIR/mediaproxy.pid"
DISPATCHER_PID="$RUNTIME_DIR/proxydispatcher.pid"

# Options for mediaproxy and dispatcher. Do not include --pid <pidfile>
# --pid <pidfile> will be added automatically if needed.
PROXY_OPTIONS="--ip=24.48.42.20 --listen=127.0.0.1"
DISPATCHER_OPTIONS="domain://sip.mycompany.com"

NAME="mediaproxy"
DESC="SER MediaProxy server"

test -f $PROXY      || exit 0
test -f $DISPATCHER || exit 0

if [ "$PROXY_PID" != "/var/run/mediaproxy.pid" ]; then
    PROXY_OPTIONS="--pid $PROXY_PID $PROXY_OPTIONS"
fi
if [ "$DISPATCHER_PID" != "/var/run/proxydispatcher.pid" ]; then
    DISPATCHER_OPTIONS="--pid $DISPATCHER_PID $DISPATCHER_OPTIONS"
fi

start() {
    echo -n "Starting $DESC: $NAME"
    $PROXY $PROXY_OPTIONS
    $DISPATCHER $DISPATCHER_OPTIONS
    echo "."
}

stop () {
    echo -n "Stopping $DESC: $NAME"
    kill `cat $PROXY_PID`
    kill `cat $DISPATCHER_PID`
    echo "."
}

case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    restart|force-reload)
        stop
        #sleep 1
        start
        ;;
    *)
        echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload}" >&2
        exit 1
        ;;
esac

exit 0



On Mon, 21 Feb 2005 13:39:10 +0800, Charles Wang <lazy.charles at gmail.com> wrote:
> Dear ALL:
> 
> I make the UA 1033 as busy status(pick up the phone and do nothing).
> 
> Then I try to make a call from 1011 to 1033. It should be redirect to
> a PSTN phone number( sip:0939749xxx at ser.xxx.net.tw ).
> I find it call failure and jump to failure_route[1], then swicth to
> route[3](for PSTN).
> But when I dump the package using ngrep. I can't find it try to
> connect PSTN trunk( xxx.xxx.190.243 is a CISCO 5300).
> I can find "SER: Connecting to PSTN....." message list at log file.
> Then the log display "SER: SIP Call On-Net section route(2)" message.
> It means that the call return to route[2] then failed.
> I guess that it stops or jump out route[3] after rewritehost(xxx.xxx.190.243).
> 
> Can anyone help me to trace the bug in the route[3]?
> 
> Best Regard
> Charles
> 
> Subset of ser.cfg about route[3:
> -------------------------------------------------------------------------------------------------------
> route[3] {
>         log(1, "SER: Demestic Call Off-Net section route(3)\n");
> 
>         # All Domestic Calls Go To CISCO 5300
>         if (method=="INVITE") {
>                 if (!proxy_authorize("", "subscriber")) {
>                         proxy_challenge("", "0");
>                         break;
>                 } else if (!check_from()) {
>                         log(1, "Spoofed SIP call attempt");
>                         sl_send_reply("403", "Use From=ID");
>                         break;
>                 } else if (!(is_from_local() || is_uri_host_local())) {
>                         sl_send_reply("403", "Please register to use our service");
>                         break;
>                 };
>                 # enable caller id blocking for PSTN calls
>                 if (isflagset(25)) {
>                         append_rpid_hf();
>                 };
>         };
>         # SIP->PSTN calls get 45 seconds to timeout
>         log(1, "SER: Connecting to PSTN.....\n");
>         avp_write("i:45", "inv_timeout");
>         rewritehost("61.220.190.243");
>         if (uri=~"[@:](192\.168\.|10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.)" &&
> !search("^Route:")){
>                 sl_send_reply("479", "We don't forward to private IP addresses");
>                 break;
>         };
>         if (method=="INVITE" || method=="ACK") {
>                 use_media_proxy();
>         };
>         if (isflagset(31)) {  # is voice mail?
>                 t_on_failure("1");
>         };
>         t_on_reply("1");
>         if (!t_relay()) {
>                 if (method=="INVITE" || method=="ACK") {
>                         end_media_session();
>                 };
>                 sl_reply_error();
>         };
> }
> 
> Dump using ngrep -d eth0 -W byline port 5060
> ------------------------------------------------------------------
> Notes: xxx.xxx.190.248              : is SER sip proxy
>        xxx.xxx.13.49                : is NAT
>        sip:1033 at xxx.xxx.13.49:33536 : location of 1033
>        sip:1011 at xxx.xxx.13.49:35700 : location of 1011
> 
> interface: eth0 (xxx.xxx.190.240/255.255.255.240)
> filter: ip and ( port 5060 )
> #
> U xxx.xxx.13.49:35700 -> xxx.xxx.190.248:5060
> INVITE sip:1033 at ser.xxx.net.tw SIP/2.0.
> Via: SIP/2.0/UDP
> 10.18.1.70:5060;rport;branch=z9hG4bK2754265110CD4289ACDA9EA0769C1A8F.
> From: 1011 <sip:1011 at ser.xxx.net.tw>;tag=3281269171.
> To: <sip:1033 at ser.xxx.net.tw>.
> Contact: <sip:1011 at 10.18.1.70:5060>.
> Call-ID: B6E73E25-87F9-40BB-A895-561E4ADE8AC8 at 10.18.1.70.
> CSeq: 26231 INVITE.
> Max-Forwards: 70.
> Content-Type: application/sdp.
> User-Agent: X-PRO build 1082.
> Content-Length: 264.
> .
> v=0.
> o=1011 46237906 46237906 IN IP4 10.18.1.70.
> s=X-PRO.
> c=IN IP4 10.18.1.70.
> t=0 0.
> m=audio 8000 RTP/AVP 8 3 98 97 101.
> a=rtpmap:8 pcma/8000.
> a=rtpmap:3 gsm/8000.
> a=rtpmap:98 iLBC/8000.
> a=rtpmap:97 speex/8000.
> a=rtpmap:101 telephone-event/8000.
> a=fmtp:101 0-15.
> 
> #
> U xxx.xxx.190.248:5060 -> xxx.xxx.13.49:35700
> SIP/2.0 407 Proxy Authentication Required.
> Via: SIP/2.0/UDP
> 10.18.1.70:5060;rport=35700;branch=z9hG4bK2754265110CD4289ACDA9EA0769C1A8F;received=xxx.xxx.13.49.
> From: 1011 <sip:1011 at ser.xxx.net.tw>;tag=3281269171.
> To: <sip:1033 at ser.xxx.net.tw>;tag=67771a809cdfb71129a699a517fbb1f0.7608.
> Call-ID: B6E73E25-87F9-40BB-A895-561E4ADE8AC8 at 10.18.1.70.
> CSeq: 26231 INVITE.
> Proxy-Authenticate: Digest realm="ser.xxx.net.tw",
> nonce="42196d5483841de0d6b79c7dfb4156e2c932e4cb".
> Server: Sip EXpress router (0.10.99-dev0 (i386/linux)).
> Content-Length: 0.
> Warning: 392 xxx.xxx.190.248:5060 "Noisy feedback tells:  pid=4199
> req_src_ip=xxx.xxx.13.49 req_src_port=35700
> in_uri=sip:1033 at ser.xxx.net.tw out_uri=sip:1033 at xxx.xxx.13.49:33536
> via_cnt==1".
> .
> 
> #
> U xxx.xxx.13.49:35700 -> xxx.xxx.190.248:5060
> ACK sip:1033 at ser.xxx.net.tw SIP/2.0.
> Via: SIP/2.0/UDP
> 10.18.1.70:5060;rport;branch=z9hG4bK2754265110CD4289ACDA9EA0769C1A8F.
> From: 1011 <sip:1011 at ser.xxx.net.tw>;tag=3281269171.
> To: <sip:1033 at ser.xxx.net.tw>;tag=67771a809cdfb71129a699a517fbb1f0.7608.
> Contact: <sip:1011 at 10.18.1.70:5060>.
> Call-ID: B6E73E25-87F9-40BB-A895-561E4ADE8AC8 at 10.18.1.70.
> CSeq: 26231 ACK.
> Max-Forwards: 70.
> Content-Length: 0.
> .
> 
> #
> U xxx.xxx.13.49:35700 -> xxx.xxx.190.248:5060
> INVITE sip:1033 at ser.xxx.net.tw SIP/2.0.
> Via: SIP/2.0/UDP
> 10.18.1.70:5060;rport;branch=z9hG4bK1BDE5BF2809C4223A13FC5B1A9AC21CC.
> From: 1011 <sip:1011 at ser.xxx.net.tw>;tag=3281269171.
> To: <sip:1033 at ser.xxx.net.tw>.
> Contact: <sip:1011 at 10.18.1.70:5060>.
> Call-ID: B6E73E25-87F9-40BB-A895-561E4ADE8AC8 at 10.18.1.70.
> CSeq: 26232 INVITE.
> Proxy-Authorization: Digest
> username="1011",realm="ser.xxx.net.tw",nonce="42196d5483841de0d6b79c7dfb4156e2c932e4cb",response="7004beab12b3ac6874c5cd86e5659930",uri="sip:1033 at ser.xxx.net.tw".
> Max-Forwards: 70.
> Content-Type: application/sdp.
> User-Agent: X-PRO build 1082.
> Content-Length: 264.
> .
> v=0.
> o=1011 46238507 46238507 IN IP4 10.18.1.70.
> s=X-PRO.
> c=IN IP4 10.18.1.70.
> t=0 0.
> m=audio 8000 RTP/AVP 8 3 98 97 101.
> a=rtpmap:8 pcma/8000.
> a=rtpmap:3 gsm/8000.
> a=rtpmap:98 iLBC/8000.
> a=rtpmap:97 speex/8000.
> a=rtpmap:101 telephone-event/8000.
> a=fmtp:101 0-15.
> 
> #
> U xxx.xxx.190.248:5060 -> xxx.xxx.13.49:35700
> SIP/2.0 100 trying -- your call is important to us.
> Via: SIP/2.0/UDP
> 10.18.1.70:5060;rport=35700;branch=z9hG4bK1BDE5BF2809C4223A13FC5B1A9AC21CC;received=xxx.xxx.13.49.
> From: 1011 <sip:1011 at ser.xxx.net.tw>;tag=3281269171.
> To: <sip:1033 at ser.xxx.net.tw>.
> Call-ID: B6E73E25-87F9-40BB-A895-561E4ADE8AC8 at 10.18.1.70.
> CSeq: 26232 INVITE.
> Server: Sip EXpress router (0.10.99-dev0 (i386/linux)).
> Content-Length: 0.
> Warning: 392 xxx.xxx.190.248:5060 "Noisy feedback tells:  pid=4201
> req_src_ip=xxx.xxx.13.49 req_src_port=35700
> in_uri=sip:1033 at ser.xxx.net.tw out_uri=sip:1033 at xxx.xxx.13.49:33536
> via_cnt==1".
> .
> 
> #
> U xxx.xxx.190.248:5060 -> xxx.xxx.13.49:33536
> INVITE sip:1033 at xxx.xxx.13.49:33536 SIP/2.0.
> Record-Route: <sip:xxx.xxx.190.248;ftag=3281269171;lr=on>.
> Via: SIP/2.0/UDP xxx.xxx.190.248;branch=z9hG4bKa7ac.b59d9107.0.
> Via: SIP/2.0/UDP
> 10.18.1.70:5060;received=xxx.xxx.13.49;rport=35700;branch=z9hG4bK1BDE5BF2809C4223A13FC5B1A9AC21CC.
> From: 1011 <sip:1011 at ser.xxx.net.tw>;tag=3281269171.
> To: <sip:1033 at ser.xxx.net.tw>.
> Contact: <sip:1011 at xxx.xxx.13.49:35700>.
> Call-ID: B6E73E25-87F9-40BB-A895-561E4ADE8AC8 at 10.18.1.70.
> CSeq: 26232 INVITE.
> Proxy-Authorization: Digest
> username="1011",realm="ser.xxx.net.tw",nonce="42196d5483841de0d6b79c7dfb4156e2c932e4cb",response="7004beab12b3ac6874c5cd86e5659930",uri="sip:1033 at ser.xxx.net.tw".
> Max-Forwards: 16.
> Content-Type: application/sdp.
> User-Agent: X-PRO build 1082.
> Content-Length: 264.
> .
> v=0.
> o=1011 46238507 46238507 IN IP4 10.18.1.70.
> s=X-PRO.
> c=IN IP4 10.18.1.70.
> t=0 0.
> m=audio 8000 RTP/AVP 8 3 98 97 101.
> a=rtpmap:8 pcma/8000.
> a=rtpmap:3 gsm/8000.
> a=rtpmap:98 iLBC/8000.
> a=rtpmap:97 speex/8000.
> a=rtpmap:101 telephone-event/8000.
> a=fmtp:101 0-15.
> 
> #
> U xxx.xxx.13.49:33536 -> xxx.xxx.190.248:5060
> SIP/2.0 486 Busy Here.
> Via: SIP/2.0/UDP xxx.xxx.190.248;branch=z9hG4bKa7ac.b59d9107.0.
> Via: SIP/2.0/UDP
> 10.18.1.70:5060;received=xxx.xxx.13.49;rport=35700;branch=z9hG4bK1BDE5BF2809C4223A13FC5B1A9AC21CC.
> Record-Route: <sip:xxx.xxx.190.248;ftag=3281269171;lr=on>.
> Call-ID: B6E73E25-87F9-40BB-A895-561E4ADE8AC8 at 10.18.1.70.
> CSeq: 26232 INVITE.
> From: 1011 <sip:1011 at ser.xxx.net.tw>;tag=3281269171.
> To: <sip:1033 at ser.xxx.net.tw>;tag=A8VnZRzqB2nyNgYQ.
> Contact: <sip:1033 at 10.18.1.102:1718>.
> Content-Length: 0.
> .
> 
> #
> U xxx.xxx.190.248:5060 -> xxx.xxx.13.49:33536
> ACK sip:1033 at xxx.xxx.13.49:33536 SIP/2.0.
> Via: SIP/2.0/UDP xxx.xxx.190.248;branch=z9hG4bKa7ac.b59d9107.0.
> From: 1011 <sip:1011 at ser.xxx.net.tw>;tag=3281269171.
> Call-ID: B6E73E25-87F9-40BB-A895-561E4ADE8AC8 at 10.18.1.70.
> To: <sip:1033 at ser.xxx.net.tw>;tag=A8VnZRzqB2nyNgYQ.
> CSeq: 26232 ACK.
> User-Agent: Sip EXpress router(0.10.99-dev0 (i386/linux)).
> Content-Length: 0.
> .
> 
> #
> U xxx.xxx.13.49:35700 -> xxx.xxx.190.248:5060
> .
> 
> #
> U xxx.xxx.13.49:35700 -> xxx.xxx.190.248:5060
> .
> 
> #
> U xxx.xxx.190.248:5060 -> xxx.xxx.13.49:35700
> SIP/2.0 408 Request Timeout.
> Via: SIP/2.0/UDP
> 10.18.1.70:5060;rport=35700;branch=z9hG4bK1BDE5BF2809C4223A13FC5B1A9AC21CC;received=xxx.xxx.13.49.
> From: 1011 <sip:1011 at ser.xxx.net.tw>;tag=3281269171.
> To: <sip:1033 at ser.xxx.net.tw>;tag=5f573bbafd260ada15def89f1b1724a2-6b7e.
> Call-ID: B6E73E25-87F9-40BB-A895-561E4ADE8AC8 at 10.18.1.70.
> CSeq: 26232 INVITE.
> Server: Sip EXpress router (0.10.99-dev0 (i386/linux)).
> Content-Length: 0.
> Warning: 392 xxx.xxx.190.248:5060 "Noisy feedback tells:  pid=4203
> req_src_ip=xxx.xxx.13.49 req_src_port=35700
> in_uri=sip:1033 at ser.xxx.net.tw out_uri=sip:1033 at xxx.xxx.13.49:33536
> via_cnt==0".
> .
> 
> #
> U xxx.xxx.13.49:35700 -> xxx.xxx.190.248:5060
> ACK sip:1033 at ser.xxx.net.tw SIP/2.0.
> Via: SIP/2.0/UDP
> 10.18.1.70:5060;rport;branch=z9hG4bK1BDE5BF2809C4223A13FC5B1A9AC21CC.
> From: 1011 <sip:1011 at ser.xxx.net.tw>;tag=3281269171.
> To: <sip:1033 at ser.xxx.net.tw>;tag=5f573bbafd260ada15def89f1b1724a2-6b7e.
> Contact: <sip:1011 at 10.18.1.70:5060>.
> Call-ID: B6E73E25-87F9-40BB-A895-561E4ADE8AC8 at 10.18.1.70.
> CSeq: 26232 ACK.
> Max-Forwards: 70.
> Content-Length: 0.
> .
> 
> #
> #
> U xxx.xxx.190.248:5060 -> xxx.xxx.13.49:35700
> ....
> #
> U xxx.xxx.190.248:5060 -> xxx.xxx.13.49:33536
> ....
> #
> U xxx.xxx.13.49:33536 -> xxx.xxx.190.248:5060
> ................
> #
> U xxx.xxx.13.49:35700 -> xxx.xxx.190.248:5060
> .
> 
> _______________________________________________
> Serusers mailing list
> serusers at lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serusers
>




More information about the sr-users mailing list