Kannaiyan Natesan
2004-Jan-18 13:08 UTC
[Asterisk-Users] Asterisk as SIP Redirect Server -- Implemented - Not Working - Plz Help
I have coded chan_sip.c so that you can have // sip.conf register => username:password@somedomain.com/redirectconfig [redirectconfig] redirect=yes redirecturi=sip:12345@domain1.com redirecturi=sip:34556@domain2.com redirecturi=sip:87877@domain3.com .... so when you receive a call it will redirect to the alternating uri's with a SIP 300 Message. It works with the following sequence, INVITE -- Receives INVITE REDIRECT -- Sends 300 Successfully ACK -- Receives ACK But the actuall call is not redirected. Can anyone please help what is problem with the SIP redirection message and anyhelp to test this functionality please. You can download the source code from http://www.speak2world.com/asterisk/chan_sip.php Here is the procedure to compile and run it. 1. cd to /usr/src/asterisk/channels/ 2. Backup your existing chan_sip.c 3. replace the chan_sip.c with the current one 4. Type, "make install" when you receive a call, it should now pass the SIP 300 message to the caller which you can see with sip debug. Can anyone please help me, what could be the problem. Thanks in advance. Kannaiyan
Olle E. Johansson
2004-Jan-18 13:40 UTC
[Asterisk-Users] Asterisk as SIP Redirect Server -- Implemented - Not Working - Plz Help
Could you please explain what you want to do, why you want asterisk to register but not take the calls? You could take the calls into the dialplan (extensions.conf) and dial out from there with an agi script that performed the same thing. If you have canreinvite=yes, asterisk will leave the media back to the clients. It's not a redirect, but it's more Asterisk. Asterisk SIP channel is not designed as a SIP proxy so I believe this is hard to do. From the code it looks like a good attempt, but since you didn't include any debug output I don't know what did not work for you. Please send SIP DEBUG output. /O
Kannaiyan Natesan
2004-Jan-18 17:40 UTC
[Asterisk-Users] Re: Asterisk as SIP Redirect Server -- Implemented - Not Working - Plz Help
/O
Attached is the Debug information with the 300 Redirect implementation
with asterisk,
You can get the source code from
http://www.speak2world.com/asterisk/chan_sip.php
and when you compile and run it, you get the following info in the debug
o/p.
pbx*CLI> sip debug
SIP Debugging Enabled
pbx*CLI>
Sip read:
INVITE sip:rama@69.15.152.35 SIP/2.0
Max-Forwards: 10
Record-Route: <sip:8138799@195.37.77.101;ftag=3758033922;lr=on>
Via: SIP/2.0/UDP 195.37.77.101;branch=z9hG4bKe65c.9f9e1c54.1
Via: SIP/2.0/UDP 81.86.234.10:5060;branch=129db1b09b88fc97f8aedf0767db7b61.0
Session-Expires: 3600
From: <sip:88138730@iptel.org;user=phone>;tag=3758033922
To: <sip:8138799@iptel.org;user=phone>
Call-ID: 995233702@192.168.0.2
CSeq: 2 INVITE
Contact:
<sip:sip%3a88138730%40192.168.0.2%3a5060%3buser=phone%3btransport=udp@81.86.
234.10>
User-Agent: Cisco ATA 186 v3.0.0 atasip (031210A)
Proxy-Authorization: Digest
username="88138730",realm="iptel.org",nonce="400b262cb074761ee4458911df8b554
c31618ffc",uri="sip:8138799@iptel.org",response="751a3ae3f06961159af4178d6d9
43402"
Expires: 300
Allow: ACK, BYE, CANCEL, INVITE, NOTIFY, OPTIONS, REFER, REGISTER
Content-Type: application/sdp
Content-Length: 254
P-hint: USRLOC
v=0
o=8813730 1818418 1818418 IN IP4 81.86.234.10
s=ATA186 Call
c=IN IP4 81.86.234.10
t=0 0
m=audio 35566 RTP/AVP 0 4 8 101
a=rtpmap:0 PCMU/8000/1
a=rtpmap:4 G723/8000/1
a=rtpmap:8 PCMA/8000/1
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
18 headers, 11 lines
Transmitting (NAT):
SIP/2.0 300 Redirecting
Via: SIP/2.0/UDP
195.37.77.101;branch=z9hG4bKe65c.9f9e1c54.1;received=195.37.77.101
Via: SIP/2.0/UDP 81.86.234.10:5060;branch=129db1b09b88fc97f8aedf0767db7b61.0
From: <sip:88138730@iptel.org;user=phone>;tag=3758033922
To: <sip:8138799@iptel.org;user=phone>;tag=as6ad15254
Call-ID: 995233702@192.168.0.2
CSeq: 2 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER
Contact: <sip:14551@fwd.pulver.com>
Contact: <137830>
Content-Length: 0
to 195.37.77.101:5060
pbx*CLI>
Sip read:
ACK sip:rama@69.15.152.35 SIP/2.0
Via: SIP/2.0/UDP 195.37.77.101;branch=z9hG4bKe65c.9f9e1c54.1
From: <sip:88138730@iptel.org;user=phone>;tag=3758033922
Call-ID: 995233702@192.168.0.2
To: <sip:8138799@iptel.org;user=phone>;tag=as6ad15254
CSeq: 2 ACK
User-Agent: Sip EXpress router(0.8.12-tcp_nonb-tls (i386/linux))
Content-Length: 0
Kindly let me know if you need more information.
I have the confidence that I can make asterisk even as a very good SIP Proxy
might be like SER.
Kannaiyan