Can you help me, I received a SIP/2.0 475 Bad URI (475/SL) message and I don't understand I have fallowed the tutorial you've sent me: http://docs.huihoo.com/openser/tutorials/uac/ar01s06.html correcting few commands like t_relay_to_udp("GW_IP","GW_PORT"); --> t_relay("udp:GW_IP:GW_PORT");
You'll find below my conf and a ngrep command
Thanks
NB: I have changed id/password values
# -- uac params -- modparam("uac", "credential", "5674685998:saturne.alsion.com:JG6dzgyfd89F") modparam("uac","from_restore_mode","auto") # sequential requests and replies will be automatically updated based on stored original URI
...
if (method==INVITE && uri=~"0[0-9]*") { #uac_replace_from("sip:104@sip.test.fr"); # set failure route for authentication t_on_failure("3"); # reset flag to mark no authentication yet performed resetflag(7); # forward to PSTN t_relay("udp:saturne.alsion.com:5060"); exit; }; ...
failure_route[3] { # authentication reply received? if ( t_check_status("401|407") ) { # have we already tried to authenticate? if (isflagset(7)) { t_reply("503","Authentication failed"); exit; } if (uac_auth()) { # mark that auth was performed setflag(7); # trigger again the failure route t_on_failure("3"); # repeat the request with auth response this time append_branch(); t_relay(); } } }
Here is a ngep of the communication (what is interesting is the )
interface: eth1 (192.168.95.0/255.255.255.0) filter: (ip or ip6) and ( port 5060 ) # U 192.168.95.70:5060 -> 192.168.95.248:5060 INVITE sip:0677832974@sip.wifirst.fr:5060 SIP/2.0..Via: SIP/2.0/UDP 192.168.95.70:5060;branch=z9hG4bK4696815358658109209..From: "Bob Wifirst"<sip:102@ sip.wifirst.fr:5060;user=phone>;tag=c0a80101-3331e4..To: sip:0677832974@sip.wifirst.fr:5060;user=phone..Call-ID: 5d714ab-c0a80101-0-38@192.168.95.70 ..CSeq: 1 INVITE..Max-Forwards: 70..Supported: timer, replaces..Session-Expires: 1800..Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,PRACK,SUBSCRIBE,NOTIFY,UPD ATE,REFER,REGISTER,INFO..Contact: sip:102@192.168.95.70:5060;user=phone..User-Agent: THOMSON ST2030 hw0 fw1.50 00-0E-50-4E-AF-C4..Content-Type: appl ication/sdp..Content-Length: 271....v=0..o=102 3355109 3355109 IN IP4 192.168.95.70..s=-..c=IN IP4 192.168.95.70..t=0 0..m=audio 41000 RTP/AVP 8 0 18 4 97..a=rtpmap:8 PCMA/8000..a=rtpmap:0 PCMU/8000..a=rtpmap:18 G729/8000..a=rtpmap:4 G723/8000..a=rtpmap:97 telephone-event/8000..a=fmtp:97 0-15..a=sen drecv.. # U 192.168.95.248:5060 -> 87.98.201.114:5060 INVITE sip:0677832974@sip.wifirst.fr:5060 SIP/2.0..Record-Route: sip:192.168.95.248;lr=on;ftag=c0a80101-3331e4..Via: SIP/2.0/UDP 192.168.95.248;bran ch=z9hG4bKe28.c363a7e.0..Via: SIP/2.0/UDP 192.168.95.70:5060;branch=z9hG4bK4696815358658109209..From: "Bob Wifirst"<sip:102@sip.wifirst.fr:5060;user=p hone>;tag=c0a80101-3331e4..To: sip:0677832974@sip.wifirst.fr:5060;user=phone..Call-ID: 5d714ab-c0a80101-0-38@192.168.95.70..CSeq: 1 INVITE..Max-Forw ards: 10..Supported: timer, replaces..Session-Expires: 1800..Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,PRACK,SUBSCRIBE,NOTIFY,UPDATE,REFER,REGISTER,INFO..C ontact: sip:102@192.168.95.70:5060;user=phone..User-Agent: THOMSON ST2030 hw0 fw1.50 00-0E-50-4E-AF-C4..Content-Type: application/sdp..Content-Lengt h: 271....v=0..o=102 3355109 3355109 IN IP4 192.168.95.70..s=-..c=IN IP4 192.168.95.70..t=0 0..m=audio 41000 RTP/AVP 8 0 18 4 97..a=rtpmap:8 PCMA/8000 ..a=rtpmap:0 PCMU/8000..a=rtpmap:18 G729/8000..a=rtpmap:4 G723/8000..a=rtpmap:97 telephone-event/8000..a=fmtp:97 0-15..a=sendrecv.. # U 192.168.95.248:5060 -> 192.168.95.70:5060 SIP/2.0 100 Giving a try..Via: SIP/2.0/UDP 192.168.95.70:5060;branch=z9hG4bK4696815358658109209..From: "Bob Wifirst"<sip:102@sip.wifirst.fr:5060;user= phone>;tag=c0a80101-3331e4..To: sip:0677832974@sip.wifirst.fr:5060;user=phone..Call-ID: 5d714ab-c0a80101-0-38@192.168.95.70..CSeq: 1 INVITE..Server: OpenSER (1.2.1-tls (i386/linux))..Content-Length: 0.... # U 87.98.201.114:5060 -> 192.168.95.248:5060 SIP/2.0 100 Trying..Via: SIP/2.0/UDP 192.168.95.248:5060;branch=z9hG4bKe28.c363a7e.0;received=192.168.95.248..Via: SIP/2.0/UDP 192.168.95.70:5060;bran ch=z9hG4bK4696815358658109209..From: "Bob Wifirst"sip:102@sip.wifirst.fr:5060;user=phone;tag=c0a80101-3331e4..To: <sip:0677832974@sip.wifirst.fr:506 0;user=phone>..Call-ID: 5d714ab-c0a80101-0-38@192.168.95.70..CSeq: 1 INVITE..User-Agent: Asterisk PBX..Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER , SUBSCRIBE, NOTIFY..Contact: sip:0677832974@87.98.201.114..Content-Length: 0.... # U 87.98.201.114:5060 -> 192.168.95.248:5060 SIP/2.0 200 OK..Via: SIP/2.0/UDP 192.168.95.248:5060;branch=z9hG4bKe28.c363a7e.0;received=192.168.95.248..Via: SIP/2.0/UDP 192.168.95.70:5060;branch=z 9hG4bK4696815358658109209..Record-Route: sip:192.168.95.248:5060;lr=on;ftag=c0a80101-3331e4..From: "Bob Wifirst"<sip:102@sip.wifirst.fr:5060;user=ph one>;tag=c0a80101-3331e4..To: sip:0677832974@sip.wifirst.fr:5060;user=phone;tag=as62a15743..Call-ID: 5d714ab-c0a80101-0-38@192.168.95.70..CSeq: 1 IN VITE..User-Agent: Asterisk PBX..Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY..Contact: sip:0677832974@87.98.201.114..Content-T ype: application/sdp..Content-Length: 284....v=0..o=root 6041 6041 IN IP4 87.98.201.114..s=session..c=IN IP4 87.98.201.114..t=0 0..m=audio 12322 RTP/A VP 0 8 18 97..a=rtpmap:0 PCMU/8000..a=rtpmap:8 PCMA/8000..a=rtpmap:18 G729/8000..a=fmtp:18 annexb=no..a=rtpmap:97 telephone-event/8000..a=fmtp:97 0-16 ..a=silenceSupp:off - - - -.. # U 192.168.95.248:5060 -> 192.168.95.70:5060 SIP/2.0 200 OK..Via: SIP/2.0/UDP 192.168.95.70:5060;branch=z9hG4bK4696815358658109209..Record-Route: <sip:192.168.95.248:5060;lr=on;ftag=c0a80101-3331 e4>..From: "Bob Wifirst"sip:102@sip.wifirst.fr:5060;user=phone;tag=c0a80101-3331e4..To: sip:0677832974@sip.wifirst.fr:5060;user=phone;tag=as62a157 43..Call-ID: 5d714ab-c0a80101-0-38@192.168.95.70..CSeq: 1 INVITE..User-Agent: Asterisk PBX..Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE , NOTIFY..Contact: sip:0677832974@87.98.201.114..Content-Type: application/sdp..Content-Length: 284....v=0..o=root 6041 6041 IN IP4 87.98.201.114..s =session..c=IN IP4 87.98.201.114..t=0 0..m=audio 12322 RTP/AVP 0 8 18 97..a=rtpmap:0 PCMU/8000..a=rtpmap:8 PCMA/8000..a=rtpmap:18 G729/8000..a=fmtp:18 annexb=no..a=rtpmap:97 telephone-event/8000..a=fmtp:97 0-16..a=silenceSupp:off - - - -.. # U 192.168.95.70:5060 -> 192.168.95.248:5060 ACK sip:0677832974@87.98.201.114 SIP/2.0..Via: SIP/2.0/UDP 192.168.95.70:5060;branch=z9hG4bK4697925369758209219..From: "Bob Wifirst"<sip:102@sip.wifir st.fr:5060;user=phone>;tag=c0a80101-3331e4..To: sip:0677832974@sip.wifirst.fr:5060;user=phone;tag=as62a15743..Call-ID: 5d714ab-c0a80101-0-38@192.168 .95.70..CSeq: 1 ACK..Max-Forwards: 70..Route: sip:192.168.95.248:5060;lr=on;ftag=c0a80101-3331e4..User-Agent: THOMSON ST2030 hw0 fw1.50 00-0E-50-4E- AF-C4..Content-Length: 0.... # U 192.168.95.248:5060 -> 87.98.201.114:5060 ACK sip:0677832974@87.98.201.114 SIP/2.0..Record-Route: sip:192.168.95.248;lr=on;ftag=c0a80101-3331e4..Via: SIP/2.0/UDP 192.168.95.248;branch=z9hG4b Ke28.c363a7e.2..Via: SIP/2.0/UDP 192.168.95.70:5060;branch=z9hG4bK4697925369758209219..From: "Bob Wifirst"sip:102@sip.wifirst.fr:5060;user=phone;tag =c0a80101-3331e4..To: sip:0677832974@sip.wifirst.fr:5060;user=phone;tag=as62a15743..Call-ID: 5d714ab-c0a80101-0-38@192.168.95.70..CSeq: 1 ACK..Max-F orwards: 10..User-Agent: THOMSON ST2030 hw0 fw1.50 00-0E-50-4E-AF-C4..Content-Length: 0..P-hint: rr-enforced.... # U 87.98.201.114:5060 -> 192.168.95.248:5060 CANCEL :0677832974@87.98.201.114 SIP/2.0..Via: SIP/2.0/UDP 87.98.201.114:5060;branch=z9hG4bK7781eedb;rport..Route: <sip:192.168.95.248:5060;lr=on;ftag =c0a80101-3331e4>..From: sip:0677832974@sip.wifirst.fr:5060;user=phone..To: "Bob Wifirst"sip:102@sip.wifirst.fr:5060;user=phone;tag=c0a80101-3331e 4..Contact: sip:0677832974@87.98.201.114..Call-ID: 5d714ab-c0a80101-0-38@192.168.95.70..CSeq: 101 CANCEL..User-Agent: Asterisk PBX..Max-Forwards: 70 ..Content-Length: 0.... # U 192.168.95.248:5060 -> 87.98.201.114:5060 SIP/2.0 475 Bad URI (475/SL)..Via: SIP/2.0/UDP 87.98.201.114:5060;branch=z9hG4bK7781eedb;rport=5060..From: <sip:0677832974@sip.wifirst.fr:5060;user=ph one>..To: "Bob Wifirst"sip:102@sip.wifirst.fr:5060;user=phone;tag=c0a80101-3331e4..Call-ID: 5d714ab-c0a80101-0-38@192.168.95.70..CSeq: 101 CANCEL..S erver: OpenSER (1.2.1-tls (i386/linux))..Content-Length: 0.... # U 192.168.95.70:5060 -> 192.168.95.248:5060 BYE sip:0677832974@87.98.201.114 SIP/2.0..Via: SIP/2.0/UDP 192.168.95.70:5060;branch=z9hG4bK9842036470869314825..From: "Bob Wifirst"<sip:102@sip.wifir st.fr:5060;user=phone>;tag=c0a80101-3331e4..To: sip:0677832974@sip.wifirst.fr:5060;user=phone;tag=as62a15743..Call-ID: 5d714ab-c0a80101-0-38@192.168 .95.70..CSeq: 2 BYE..Max-Forwards: 70..Route: sip:192.168.95.248:5060;lr=on;ftag=c0a80101-3331e4..User-Agent: THOMSON ST2030 hw0 fw1.50 00-0E-50-4E- AF-C4..Content-Length: 0.... #
Taylor Carpenter a écrit :
Use uac_auth(). You need modaram() for the credentials and an entry in failure route for auth messages. Check out
http://docs.huihoo.com/openser/tutorials/uac/ar01s06.html
besides the uac module page.
On Jul 30, 2007, at 11:06 AM, Marc LEURENT wrote:
I have a SIP/PSTN provider with an account username/password. The address of the provider is sip.test.com
I would like to redirect phone calls to the gateway, but how is it possible to log in on the gateway and forward calls? Thank you for your replies
Best Regards,
I've tried:
if (uri=~"0[0-9][0-9]*@*") {
rewritehostport("username:password@sip.test.com"); # Rewrite the URI route(1); exit; }
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users
Users mailing list Users@openser.org http://openser.org/cgi-bin/mailman/listinfo/users