Hello. I finally was able to change the R-URI for a particular call. I made a simple test program like this one:
echo "$*" >/usr/local/etc/ser/redirec.log num=1111234567 >>/usr/local/etc/ser/redirec.log echo sip:$num@mysip.domain.com exit 0
So every call is "translated" to the number indicated in the program. At this point i have a question.
I saw the sip debug for a call made to my SER. And i realized that the authorization is still made with the original called number. Then when the INVITE goes to outgoing gateway i see that uri changed, as i expected, but all the other paramters are intact. You can see it in this INVITE message (outgoing INVITE from SER).
INVITE sip:1111234567@gw1.mydomain.com:5060 SIP/2.0 Record-Route: sip:0012012287000@mysip.domain.com;ftag=2c425f59a4;lr=on Via: SIP/2.0/UDP mysip.domain.com;branch=z9hG4bK03b6.f1684071.0 Via: SIP/2.0/UDP xx.xx.148.242:5060;branch=z9hG4bK2c425f59a4249 From: sip:5555832351@mysip.domain.com;tag=2c425f59a4 To: sip:0012012287000@mysip.domain.com Call-ID: 2c239842-ca97-5f35-81590002a400f1e9xx.xx.148.242 CSeq: 249 INVITE Supported: timer, replaces Min-SE: 1800 Date: Sat, 28 May 2005 07:52:12 GMT User-Agent: AddPac SIP Gateway Contact: sip:5555832351@xx.xx.148.242 Accept: application/sdp..Proxy-Authorization: Digest username="javier", realm="mysip.domain.com", nonce="417981a87eebd1f4cc0db371a", uri="sip:0012012287000@mysip.domain.com", qop=auth, nc=00000001, cnonce="0c85cf88", response="3b96cb278bfc2c898297c6568a9", algorithm=MD5 Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, UPDATE, REFER, NOTIFY Content-Type: application/sdp Content-Length: 241 Max-Forwards: 69 P-hint: GATEWAY.. v=0 o=5555832351 1117266732 1117266732 IN IP4 xx.xx.148.242 s=AddPac Gateway SDP c=IN IP4 xx.xx.148.242 t=1117266732 0 m=audio 23230 RTP/AVP 18 101 a=rtpmap:18 G729/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-15 a=ptime:20
Do i have to append something else?. I'm not really sure about this. Here is the part when i call exec_dset()
# Llamada a Rutina Externa para cambio de numero if (method=="INVITE") { exec_dset("/usr/local/etc/ser/redirect.sh"); };
is at the beggining of my ser.cfg
Here is part of my routing configuration.
if ( (uri=~"^sip:111.*@.*") | (uri=~"^sip:333.*@.*") | (uri=~"^sip:0.*@.*") ){ if (method=="INVITE") { log(1,"FORWARDING : Llamada hacia plataforma H.323\n"); route(1); break; }; };
Then
route[1] {
rewritehostport("gw1.mydomain.com:5060"); append_hf("P-hint: GATEWAY\r\n");
t_relay(); break; };
I really hope that someone can help me here! Thanks in advance.
Ricardo.
-----Mensaje original----- De: Ricardo Martinez [mailto:rmartinez@redvoiss.net] Enviado el: Viernes, 22 de Octubre de 2004 15:12 Para: 'serusers@lists.iptel.org' Asunto: [Serusers] exec_dset() question.
Hello. I'm trying to use the exec_dset() command to call an external application that rewrite the Request-URI. What i want to know if it's possible to take the value of the original R-URI by the exec_dset( ) and then according to the external application rewrite the value. Notice that the important thing here is know the original value of the R-URI. I have been searching in the mail list but i could not find anything related. Hope that someone can help me. Thanks in advance.
Best Regards.
Ricardo Martinez Ogalde
_______________________________________________ Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers