[OpenSIPS-Users] Voicemail doesn't work with Mediaproxy

osiris123d duane.larson at gmail.com
Thu Sep 10 23:54:46 CEST 2009


I have been trying to fix this for the last 4 days.  I have searched the
mailing list with the following keywords (mediaproxy rewritehostport one-way
audio, etc) and I find some posts that explain that my "200 ok" messages
need say that the "connection information" needs to point to my mediaproxy. 
I am trying to use fix_nated_sdp("3", "ip of mediaproxy"0), but I am sure I
am placing it and using it in the wrong spot in my script.

So here is the problem


When a user calls someone and they are busy or not there the caller will be
directed to voicemail by using the rewritehostport("ip of voicemail")
command.  The caller is nated behind a router.  The caller doesn't hear the
voicemail voice prompts, but the caller IS able to leave a voicemail and be
heard.  So there is one-way audio going on where the caller can't hear, but
voicemail can.  When I do a sniff I see that this is because the caller's
RTP is going directly to the Voicemail Servers Public IP address and the
Voicemails RTP is going to the Mediaproxy.
Here is the code in question
failure_route[1] {
        ##--
        ##-- If cancelled, exit. 
        ##--
        if (t_was_cancelled()) {
                exit;
        };
        ##--
        ##-- If busy send to the e-mail server, prefix the "b"
        ##-- character to indicate busy. 
        ##--
        if (t_check_status("486")) {
                revert_uri();

		append_hf("P-App-Name: voicemail\r\nP-App-Param:
Email-Address=blah.blahmail.com;Mode=both;usr=$tU;dom=@$td\r\n");

                rewritehostport("VoicemailIP");
                append_branch();
                route(1);
                exit;
        };
        ##--
        ##-- If timeout (408) or unavailable temporarily (480),
        ##-- prefix the uri with the "u"character to indicate 
        ##-- unanswered and send to the e-mail
        ##-- sever
        ##--
        if (t_check_status("408") || t_check_status("480")) {
                revert_uri();

		append_hf("P-App-Name: voicemail\r\nP-App-Param:
Email-Address=blah.blahmail.com;Mode=both;usr=$tU;dom=@$td\r\n");

                rewritehostport("VoicemailIP");
                append_branch();
                route(1);
                exit;
        };
}

onreply_route[1] {
        #
        #-- On-replay block routing --
        #
        if ((isbflagset(6) || isbflagset(7)) &&
(status=~"(180)|(183)|2[0-9][0-9]")) {
                xlog("L_INFO", "----- Inside OnReply Route 1 with bflag
being 6 or 7 and a bunch other stuff");
                if (search("^Content-Type:[ ]*application/sdp")) {
                        xlog("L_INFO", "----- Inside OnReply Route 1 with
content type equaling sdp");
                        append_hf("P-hint: onreply_route|usemediaproxy
\r\n");
                        use_media_proxy();
 
               };
        };

        if (client_nat_test("1")) {
                xlog("L_INFO", "----- Inside OnReply Route 1 and client nat
equaled 1");
                append_hf("P-hint: Onreply-route - fixcontact \r\n");
                fix_contact();
        };

        exit;
}


So how do I solve this issue?


-- 
View this message in context: http://n2.nabble.com/Voicemail-doesn-t-work-with-Mediaproxy-tp3618910p3618910.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.com.



More information about the Users mailing list