Update….
I figured out why it was screwing up with
the offline users… that append_branch(); statement was screwing it up
(sensible when u think about it really). Take it out all is fine.
However, still struggling with correct
technique for using mediaproxy with vm. It seems to be mainly be a problem
with failure routes….. If anyone has any immediate suggestions, let me
know…. Otherwise I will have a more detailed look tomorrow and post a
more detailed description.
On a further note, I have an interesting
conundrum… hopefully someone has found a way round this:
All users have an alphanumeric address + a
4 digit numerical alias. I am trying to use asterisk for vm primarily because
it allows users to dial in and retrieve their mail. To that end, I decided to
store their VM boxes as the numerical alias. Herein lies the problem… If
I call, for example, 1000@xxxxx then vm works correctly – the 1000 is
passed to asterisk which does the lookup. If I call admin@xxxxxxx then
obviously it doesn’t work…. The vm box admin does not exist in
asterisk. If I miss off the revert_uri(); statement, things are slightly
better, but the wrong way around… if I call 1000, the alias lookup takes
place and admin@xxxxx is passed to asterisk. However, this does not help me…
as although always passing asterisk the same username, if a user dials in they
cant enter “admin” as the mailbox from a normal phone. What I really
need is the opposite of revert_uri in this case… something which will
always use the alias…I could use some external script to do a dblookup
and then modify the uri but that seems a bit messy, im sure there must be a way
in ser to do it… any ideas are very welcome.
Many tnanks again,
Dave
From:
serusers-bounces@iptel.org [mailto:serusers-bounces@lists.iptel.org] On Behalf Of
Sent: 24 August 2004 17:02
To: serusers@lists.iptel.org
Subject: [Serusers] Voicemail
wierdness
Hey all,
Another wierdness for a sunny tuesday afternoon....
Have been using ser and * quite successfully so far, and am not into the stage
of testing voicemail. Currently I am using * with mysql vm
storage. I have a failure route which affter the fr_timer expires, does:
failure_route[4] {
# If we've got here, it means that a call timer has expired, and the user is in the
# voicemail group. Therefore we're going to try and hand off the call to the Asterisk
# voicemail system.
revert_uri();
rewritehostport("asterisk.dev.inmarsat.com:5060");
log (1, "VOICEMAIL: VM-Divert --> Handing off to Asterisk\n");
append_branch();
append_urihf("CC-Diversion: ", "\r\n");
t_relay();
break;
}
This works great for normal users who are registered but not
answering their phone (or indeed are busy it seems - i havent' worked out how
to configure this behaviour -- any suggestions?).
However, i have two problems:
(1) If the call is from Nonnat UA --> SER -->
Mediaproxy --> Nat UA
|
\/
Asterisk VM
then the Nonnat UA doesn't get audio from asterisk vm. I
think this has somethign to do with mediaproxy trying to proxy the vm
request when it shouldnt and not knwoing where to send it - again, any
suggestions?
(2) The most annoying issue at the moment is for offline
users. It seems logical that if you have an offline user (one that has
been found in the subscriber db but just isnt' registered at the moment) you
might want their address to divert to vm. However, no amount of fiddling
has enabled be to use a failure route for this, and i'm not sure why. In
desperation i just created a new route block to handle it - the same as above,
but called route[4] instead of failure_route. This at least forwards the
request correctly. However, all i get is "The p...." and then the
media stream cuts out, and * console shows the channel has been hung up.
Below is the ngrep. For some reason two INVITE reuqests are sent
from ser(.136) to *(.137) and i'm not sure why. Notice also that a CANCEL
is generated, which corresponds to the media stream dying almost as soon as it
starts, but again i'm not sure why....
If anyone has anyideas... if you need to look at the ser.cfg
then let me know. I'm sure there must be a mor elegant way of handling vm but
im not sure what it is at the moment!
Dave
U 161.30.94.151:2378 -> 161.30.94.136:5060
INVITE sip:1000@sip.dev.inmarsat.com SIP/2.0..From:
sip:test3@sip.dev.inmarsat.com;tag=2c24948..T
o: sip:1000@sip.dev.inmarsat.com..Call-Id: call-1093359137-28@161.30.94.151..Cseq:
1 INVITE..Cont
act: <sip:test3@161.30.94.151>..Content-Type:
application/sdp..Content-Length: 308..Accept-Langua
ge: en..Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY,
REGISTER, SUBSCRIBE..Supported:
sip-cc, sip-cc-01, timer, replaces..User-Agent: Pingtel/2.1.11
(VxWorks)..Date: Tue, 24 Aug 2004
14:52:19 GMT..Via: SIP/2.0/UDP 161.30.94.151....v=0..o=Pingtel 5 5 IN
IP4 161.30.94.151..s=phone-
call..c=IN IP4 161.30.94.151..t=0 0..m=audio 8766 RTP/AVP 96 97 0 8 18
98..a=rtpmap:96 eg711u/800
0/1..a=rtpmap:97 eg711a/8000/1..a=rtpmap:0 pcmu/8000/1..a=rtpmap:8
pcma/8000/1..a=rtpmap:18 g729/
8000/1..a=fmtp:18 annexb=no..a=rtpmap:98 telephone-event/8000/1..
#
U 161.30.94.136:5060 -> 161.30.94.151:5060
SIP/2.0 407 Proxy Authentication Required..From: sip:test3@sip.dev.inmarsat.com;tag=2c24948..To:
sip:1000@sip.dev.inmarsat.com;tag=9d060f1cca80def62c99c3e616c718b0.21f2..Call-Id:
call-1093359137
-28@161.30.94.151..Cseq: 1
INVITE..Via: SIP/2.0/UDP 161.30.94.151..Proxy-Authenticate: Digest rea
lm="sip.dev.inmarsat.com",
nonce="412b574f5e5a864751e3e96fb32f3f7a4929a17a"..Server: Sip EXpress
router (0.8.14 (i386/linux))..Content-Length: 0..Warning: 392
161.30.94.136:5060 "Noisy feedback
tells: pid=25819 req_src_ip=161.30.94.151 req_src_port=2378
in_uri=sip:1000@sip.dev.inmarsat.com
out_uri=sip:admin@sip.dev.inmarsat.com via_cnt==1"....
#
U 161.30.94.151:2378 -> 161.30.94.136:5060
ACK sip:1000@sip.dev.inmarsat.com SIP/2.0..Contact: sip:test3@161.30.94.151..From:
sip:test3@sip.
dev.inmarsat.com;tag=2c24948..To:
sip:1000@sip.dev.inmarsat.com;tag=9d060f1cca80def62c99c3e616c71
8b0.21f2..Call-Id: call-1093359137-28@161.30.94.151..Cseq:
1 ACK..Accept-Language: en..User-Agent
: Pingtel/2.1.11 (VxWorks)..Date: Tue, 24 Aug 2004 14:52:19 GMT..Via:
SIP/2.0/UDP 161.30.94.151..
Content-Length: 0....
#
U 161.30.94.151:2378 -> 161.30.94.136:5060
INVITE sip:1000@sip.dev.inmarsat.com SIP/2.0..From: sip:test3@sip.dev.inmarsat.com;tag=2c24948..T
o: sip:1000@sip.dev.inmarsat.com..Call-Id: call-1093359137-28@161.30.94.151..Cseq:
2 INVITE..Cont
act: <sip:test3@161.30.94.151>..Content-Type: application/sdp..Content-Length:
308..Accept-Langua
ge: en..Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY,
REGISTER, SUBSCRIBE..Supported:
sip-cc, sip-cc-01, timer, replaces..User-Agent: Pingtel/2.1.11
(VxWorks)..Date: Tue, 24 Aug 2004
14:52:19 GMT..Proxy-Authorization: DIGEST USERNAME="test3",
REALM="sip.dev.inmarsat.com", NONCE="
412b574f5e5a864751e3e96fb32f3f7a4929a17a",
URI="sip:1000@sip.dev.inmarsat.com", RESPONSE="520ee04
3cedf1c3d2ccbc0fa05101d2c"..Via: SIP/2.0/UDP 161.30.94.151....v=0..o=Pingtel
5 5 IN IP4 161.30.94
.151..s=phone-call..c=IN IP4 161.30.94.151..t=0 0..m=audio 8766 RTP/AVP
96 97 0 8 18 98..a=rtpmap
:96 eg711u/8000/1..a=rtpmap:97 eg711a/8000/1..a=rtpmap:0
pcmu/8000/1..a=rtpmap:8 pcma/8000/1..a=r
tpmap:18 g729/8000/1..a=fmtp:18 annexb=no..a=rtpmap:98
telephone-event/8000/1..
#
U 161.30.94.136:5060 -> 161.30.94.151:5060
SIP/2.0 100 trying -- your call is important to us..From:
sip:test3@sip.dev.inmarsat.com;tag=2c24
948..To: sip:1000@sip.dev.inmarsat.com..Call-Id: call-1093359137-28@161.30.94.151..Cseq:
2 INVITE
..Via: SIP/2.0/UDP 161.30.94.151..Server: Sip EXpress router (0.8.14
(i386/linux))..Content-Lengt
h: 0..Warning: 392 161.30.94.136:5060 "Noisy feedback tells:
pid=25827 req_src_ip=161.30.94.151
req_src_port=2378 in_uri=sip:1000@sip.dev.inmarsat.com
out_uri=sip:1000@asterisk.dev.inmarsat.com
:5060 via_cnt==1"....
#
U 161.30.94.136:5060 -> 161.30.94.137:5060
INVITE sip:1000@asterisk.dev.inmarsat.com:5060 SIP/2.0..Max-Forwards:
10..Record-Route: <sip:1000
@161.30.94.136;ftag=2c24948;lr=on>..From:
sip:test3@sip.dev.inmarsat.com;tag=2c24948..To: sip:100
0@sip.dev.inmarsat.com..Call-Id:
call-1093359137-28@161.30.94.151..Cseq:
2 INVITE..Contact: <sip:
test3@161.30.94.151>..Content-Type:
application/sdp..Content-Length: 308..Accept-Language: en..Al
low: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, REGISTER,
SUBSCRIBE..Supported: sip-cc, si
p-cc-01, timer, replaces..User-Agent: Pingtel/2.1.11 (VxWorks)..Date:
Tue, 24 Aug 2004 14:52:19 G
MT..Proxy-Authorization: DIGEST USERNAME="test3",
REALM="sip.dev.inmarsat.com", NONCE="412b574f5e
5a864751e3e96fb32f3f7a4929a17a",
URI="sip:1000@sip.dev.inmarsat.com", RESPONSE="520ee043cedf1c3d2
ccbc0fa05101d2c"..Via: SIP/2.0/UDP
161.30.94.136;branch=z9hG4bK4773.683f9521.0..Via: SIP/2.0/UDP
161.30.94.151..CC-Diversion:
sip:1000@sip.dev.inmarsat.com....v=0..o=Pingtel 5 5 IN IP4 161.30.94
.151..s=phone-call..c=IN IP4 161.30.94.151..t=0 0..m=audio 8766 RTP/AVP
96 97 0 8 18 98..a=rtpmap
:96 eg711u/8000/1..a=rtpmap:97 eg711a/8000/1..a=rtpmap:0
pcmu/8000/1..a=rtpmap:8 pcma/8000/1..a=r
tpmap:18 g729/8000/1..a=fmtp:18 annexb=no..a=rtpmap:98
telephone-event/8000/1..
#
U 161.30.94.136:5060 -> 161.30.94.137:5060
INVITE sip:1000@asterisk.dev.inmarsat.com:5060 SIP/2.0..Max-Forwards:
10..Record-Route: <sip:1000
@161.30.94.136;ftag=2c24948;lr=on>..From:
sip:test3@sip.dev.inmarsat.com;tag=2c24948..To: sip:100
0@sip.dev.inmarsat.com..Call-Id:
call-1093359137-28@161.30.94.151..Cseq:
2 INVITE..Contact: <sip:
test3@161.30.94.151>..Content-Type:
application/sdp..Content-Length: 308..Accept-Language: en..Al
low: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, REGISTER,
SUBSCRIBE..Supported: sip-cc, si
p-cc-01, timer, replaces..User-Agent: Pingtel/2.1.11 (VxWorks)..Date:
Tue, 24 Aug 2004 14:52:19 G
MT..Proxy-Authorization: DIGEST USERNAME="test3", REALM="sip.dev.inmarsat.com",
NONCE="412b574f5e
5a864751e3e96fb32f3f7a4929a17a",
URI="sip:1000@sip.dev.inmarsat.com", RESPONSE="520ee043cedf1c3d2
ccbc0fa05101d2c"..Via: SIP/2.0/UDP
161.30.94.136;branch=z9hG4bK4773.683f9521.1..Via: SIP/2.0/UDP
161.30.94.151..CC-Diversion:
sip:1000@sip.dev.inmarsat.com....v=0..o=Pingtel 5 5 IN IP4 161.30.94
.151..s=phone-call..c=IN IP4 161.30.94.151..t=0 0..m=audio 8766 RTP/AVP
96 97 0 8 18 98..a=rtpmap
:96 eg711u/8000/1..a=rtpmap:97 eg711a/8000/1..a=rtpmap:0 pcmu/8000/1..a=rtpmap:8
pcma/8000/1..a=r
tpmap:18 g729/8000/1..a=fmtp:18 annexb=no..a=rtpmap:98
telephone-event/8000/1..
#
U 161.30.94.137:5060 -> 161.30.94.136:5060
SIP/2.0 100 Trying..Via: SIP/2.0/UDP
161.30.94.136;branch=z9hG4bK4773.683f9521.0..Via: SIP/2.0/UD
P 161.30.94.151..From: sip:test3@sip.dev.inmarsat.com;tag=2c24948..To:
sip:1000@sip.dev.inmarsat.
com;tag=as78a37589..Call-ID: call-1093359137-28@161.30.94.151..CSeq:
2 INVITE..User-Agent: Asteri
sk PBX..Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER..Contact:
<sip:1000@161.30.94.137>..Conte
nt-Length: 0....
#
U 161.30.94.137:5060 -> 161.30.94.136:5060
SIP/2.0 100 Trying..Via: SIP/2.0/UDP
161.30.94.136;branch=z9hG4bK4773.683f9521.1..Via: SIP/2.0/UD
P 161.30.94.151..From: sip:test3@sip.dev.inmarsat.com;tag=2c24948..To:
sip:1000@sip.dev.inmarsat.
com;tag=as78a37589..Call-ID: call-1093359137-28@161.30.94.151..CSeq:
2 INVITE..User-Agent: Asteri
sk PBX..Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER..Contact:
<sip:1000@161.30.94.137>..Conte
nt-Length: 0....
#
U 161.30.94.137:5060 -> 161.30.94.136:5060
SIP/2.0 200 OK..Via: SIP/2.0/UDP 161.30.94.136;branch=z9hG4bK4773.683f9521.0..Via:
SIP/2.0/UDP 16
1.30.94.151..Record-Route:
<sip:1000@161.30.94.136;ftag=2c24948;lr=on>..From: sip:test3@sip.dev.i
nmarsat.com;tag=2c24948..To:
sip:1000@sip.dev.inmarsat.com;tag=as78a37589..Call-ID: call-10933591
37-28@161.30.94.151..CSeq:
2 INVITE..User-Agent: Asterisk PBX..Allow: INVITE, ACK, CANCEL, OPTION
S, BYE, REFER..Contact: <sip:1000@161.30.94.137>..Content-Type:
application/sdp..Content-Length:
288....v=0..o=root 2063 2063 IN IP4 161.30.94.137..s=session..c=IN IP4
161.30.94.137..t=0 0..m=au
dio 10248 RTP/AVP 18 0 97 3 98..a=rtpmap:18 G729/8000..a=rtpmap:0
PCMU/8000..a=rtpmap:97 iLBC/800
0..a=rtpmap:3 GSM/8000..a=rtpmap:98 telephone-event/8000..a=fmtp:98
0-16..a=silenceSupp:off - - -
-..
#
U 161.30.94.136:5060 -> 161.30.94.151:5060
SIP/2.0 200 OK..Via: SIP/2.0/UDP 161.30.94.151..Record-Route:
<sip:1000@161.30.94.136;ftag=2c2494
8;lr=on>..From: sip:test3@sip.dev.inmarsat.com;tag=2c24948..To:
sip:1000@sip.dev.inmarsat.com;tag
=as78a37589..Call-ID: call-1093359137-28@161.30.94.151..CSeq:
2 INVITE..User-Agent: Asterisk PBX.
.Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER..Contact:
<sip:1000@161.30.94.137>..Content-Type
: application/sdp..Content-Length: 288....v=0..o=root 2063 2063 IN IP4
161.30.94.137..s=session..
c=IN IP4 161.30.94.137..t=0 0..m=audio 10248 RTP/AVP 18 0 97 3
98..a=rtpmap:18 G729/8000..a=rtpma
p:0 PCMU/8000..a=rtpmap:97 iLBC/8000..a=rtpmap:3 GSM/8000..a=rtpmap:98
telephone-event/8000..a=fm
tp:98 0-16..a=silenceSupp:off - - - -..
#
U 161.30.94.136:5060 -> 161.30.94.137:5060
CANCEL sip:1000@asterisk.dev.inmarsat.com:5060 SIP/2.0..Via: SIP/2.0/UDP
161.30.94.136;branch=z9h
G4bK4773.683f9521.1..From:
sip:test3@sip.dev.inmarsat.com;tag=2c24948..Call-Id: call-1093359137-2
8@161.30.94.151..To:
sip:1000@sip.dev.inmarsat.com..Cseq: 2 CANCEL..User-Agent: Sip EXpress route
r(0.8.14 (i386/linux))..Content-Length: 0....
#
U 161.30.94.137:5060 -> 161.30.94.136:5060
SIP/2.0 200 OK..Via: SIP/2.0/UDP
161.30.94.136;branch=z9hG4bK4773.683f9521.1..From: sip:test3@sip
.dev.inmarsat.com;tag=2c24948..To:
sip:1000@sip.dev.inmarsat.com;tag=as78a37589..Call-ID: call-10
93359137-28@161.30.94.151..CSeq:
2 CANCEL..User-Agent: Asterisk PBX..Allow: INVITE, ACK, CANCEL,
OPTIONS, BYE, REFER..Contact:
<sip:1000@161.30.94.137>..Content-Length: 0....
#
U 161.30.94.151:2394 -> 161.30.94.136:5060
ACK sip:1000@161.30.94.136;ftag=2c24948;lr=on SIP/2.0..Route:
<sip:1000@161.30.94.137>..Contact:
sip:test3@161.30.94.151..From:
sip:test3@sip.dev.inmarsat.com;tag=2c24948..To: sip:1000@sip.dev.i
nmarsat.com;tag=as78a37589..Call-Id: call-1093359137-28@161.30.94.151..Cseq:
2 ACK..Accept-Langua
ge: en..User-Agent: Pingtel/2.1.11 (VxWorks)..Date: Tue, 24 Aug 2004
14:52:19 GMT..Via: SIP/2.0/U
DP 161.30.94.151..Content-Length: 0....
#
U 161.30.94.136:5060 -> 161.30.94.137:5060
ACK sip:1000@161.30.94.137 SIP/2.0..Max-Forwards: 10..Contact:
sip:test3@161.30.94.151..From: sip
:test3@sip.dev.inmarsat.com;tag=2c24948..To:
sip:1000@sip.dev.inmarsat.com;tag=as78a37589..Call-I
d: call-1093359137-28@161.30.94.151..Cseq:
2 ACK..Accept-Language: en..User-Agent: Pingtel/2.1.11
(VxWorks)..Date: Tue, 24 Aug 2004 14:52:19 GMT..Via: SIP/2.0/UDP
161.30.94.136;branch=0..Via: SI
P/2.0/UDP 161.30.94.151..Content-Length: 0....
exit