[Serusers] Why SER query MySQL x times for the same thing?

Bogdan-Andrei IANCU iancu at fokus.fraunhofer.de
Wed Nov 10 11:47:39 CET 2004


Jan Janak wrote:
> The configuration file seems to be OK, you have just one is_user_in
> function call in the file and the SIP message dumps show only one INVITE
> message coming to SER -- that means SER will query the database for the
> group membership only once.
> 
> Is there possibly any other traffic (INVITE messages) than can trigger
> the query at the same time ?

In the network capture, I see a filter(1919) was used. I could hide 
other messages. Also can be some traffic on loopback interface.

bogdan

> 
>   Jan.
> 
> On 09-11 15:03, Rodrigo P. Telles wrote:
> 
>>-----BEGIN PGP SIGNED MESSAGE-----
>>Hash: SHA1
>>
>>Hi Jan,
>>
>>Thanks for your answer!
>>See the attached files (ser.cfg and ngrep dump).
>>PS: Of corse I did some modifications in that files just to protect our
>>Network.
>>If you want the original files I can send to your personal e-mail.
>>
>>Thanks again.
>>
>>Jan Janak wrote:
>>| Could you send the whole config file and also SIP message dumps ?
>>|
>>|   Jan.
>>|
>>| On 08-11 18:18, Rodrigo P. Telles wrote:
>>|
>>|>Hi folks,
>>|>
>>|>I've been having litle troubles with SER.
>>|>When I offhook my BT100 and called another phone, I saw in
>>|>my log file that SER query the MySQL 3 or more times for the same
>>|>thing (in this case, about group membership) and the same for log 
>>messages.
>>|>I tried to flag the action but it doens't work.
>>|>
>>|>I think that the real problem is that I'm missing some thing
>>|>in my configuration or I just didn't understand the call flow in SER.
>>|>any ideas?
>>|>
>>|>I'm sending part of my ser.cfg, I hope it helps.
>>|>===================================
>>|>record_route();
>>|>
>>|>if (method=="INVITE" && !isflagset(11)) {
>>|>~                        log(1, "Voicemail is enable? ");
>>|>~                        if (is_user_in("To", "voicemail")) {
>>|>~                                log(1, "Yes\n");
>>|>~                                setflag(8);
>>|>~                                t_on_failure("1");
>>|>~                        } else {
>>|>~                                log(1, "No\n");
>>|>~                        }
>>|>
>>|>~                        # native SIP destinations are handled using our 
>>USRLOC DB
>>|>~                        if (!lookup("location")) {
>>|>~                                #sl_send_reply("404", "Not Found");
>>|>~                                if (uri=~"sip:[0-9]{4,6}@") {
>>|>~                                        if (!radius_proxy_authorize("")) 
>>{
>>|>~                                                proxy_challenge("", "0");
>>|>~                                                sl_send_reply("403", 
>>"That's not
>>|>your home");
>>|>~                                                break;
>>|>~                                        };
>>|>~                                        rewriteuser("901");
>>|>~                                        rewritehostport("x.y.z.w:5060");
>>|>~                                        log(1, "Not found\n");
>>|>~                                        t_relay();
>>|>~                                        break;
>>|>~                                } else {
>>|>~                                        route(1);
>>|>~                                        break;
>>|>~                                };
>>|>~                        };
>>|>~                        setflag(11);
>>|>};
>>|>=========================================
>>|>Thanks in advance.
>>|>
>>|>--
>>|>============================================
>>|>Rodrigo P. Telles <telles at devel-it.com.br>
>>|>Project Manager
>>|>Devel-IT - http://www.devel-it.com.br
>>|>TDKOM Group
>>|>============================================
>>|>
>>|>_______________________________________________
>>|>Serusers mailing list
>>|>serusers at lists.iptel.org
>>|>http://lists.iptel.org/mailman/listinfo/serusers
>>|>
>>|
>>|
>>|
>>
>>- --
>>============================================
>>Rodrigo P. Telles <telles at devel-it.com.br>
>>Gerente de Projetos
>>Devel-IT - http://www.devel-it.com.br
>>Grupo TDKOM
>>============================================
>>-----BEGIN PGP SIGNATURE-----
>>Version: GnuPG v1.0.7 (GNU/Linux)
>>
>>iD8DBQFBkPhEiLK8unYgEMQRArnLAKCCkhYncvM4jgOmenYhoOM94Sz+lwCeLaMe
>>ugGOf/J334pWDu2U0b5U+AQ=
>>=2krN
>>-----END PGP SIGNATURE-----
> 
> 
>>interface: eth0 (200.xxx.yyy.www/255.255.255.x)
>>filter: ip and ( port 5060 )
>>match: 1919
>>#####
>>U 192.168.0.91:44863 -> 192.168.0.65:5060
>>  INVITE sip:2020 at ser.server.net SIP/2.0..Via: SIP/2.0/UDP 10.0.0.2:44863;branch=z9hG4bKc2c125fc7680ccf0..Fr
>>  om: "Telles 2" <sip:1919 at ser.server.net>;tag=ef9d331f5bca723c..To: <sip:2020 at ser.server.net>..Contact: <sip:19
>>  19 at 10.0.0.2:44863>..Call-ID: e0b16e3a3d427e23 at 10.0.0.2..CSeq: 33385 INVITE..User-Agent: Grandstream BT
>>  100 1.0.5.11..Max-Forwards: 70..Allow: INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE..Content-Ty
>>  pe: application/sdp..Content-Length: 394....v=0..o=1919@ 8000 8000 IN IP4 10.0.0.2..s=SIP Call..c=IN IP4 1
>>  72.16.22.2..t=0 0..m=audio 20390 RTP/AVP 99 18 4 0 8 9 2 15 101..a=rtpmap:99 iLBC/8000..a=fmtp:99 mode=20..a
>>  =rtpmap:18 G729/8000..a=rtpmap:4 G723/8000..a=rtpmap:0 PCMU/8000..a=rtpmap:8 PCMA/8000..a=rtpmap:9 G722/8000
>>  ..a=rtpmap:2 G726-32/8000..a=rtpmap:15 G728/8000..a=ptime:20..a=rtpmap:101 telephone-event/8000..a=fmtp:101 
>>  0-11..                                                                                                      
>>#
>>U 192.168.0.65:5060 -> 192.168.0.91:44863
>>  SIP/2.0 100 trying -- your call is important to us..Via: SIP/2.0/UDP 10.0.0.2:44863;branch=z9hG4bKc2c125f
>>  c7680ccf0;rport=44863;received=192.168.0.91..From: "Telles 2" <sip:1919 at ser.server.net>;tag=ef9d331f5bca723
>>  c..To: <sip:2020 at ser.server.net>..Call-ID: e0b16e3a3d427e23 at 10.0.0.2..CSeq: 33385 INVITE..Server: Sip EXpr
>>  ess router (0.8.14 (i386/linux))..Content-Length: 0..Warning: 392 192.168.0.65:5060 "Noisy feedback tells:
>>    pid=20180 req_src_ip=192.168.0.91 req_src_port=44863 in_uri=sip:2020 at ser.server.net out_uri=sip:2020 at 192.
>>  168.0.87:5060 via_cnt==1"....                                                                             
>>#
>>U 192.168.0.65:5060 -> 192.168.0.87:5060
>>  INVITE sip:2020 at 192.168.0.87:5060 SIP/2.0..Record-Route: <sip:2020 at 192.168.0.65;ftag=ef9d331f5bca723c;lr
>>  =on>..Via: SIP/2.0/UDP 192.168.0.65;branch=z9hG4bK54.23f86f66.0..Via: SIP/2.0/UDP 10.0.0.2:44863;rport=
>>  44863;received=192.168.0.91;branch=z9hG4bKc2c125fc7680ccf0..From: "Telles 2" <sip:1919 at ser.server.net>;tag=
>>  ef9d331f5bca723c..To: <sip:2020 at ser.server.net>..Contact: <sip:1919 at 192.168.0.91:44863>..Call-ID: e0b16e3a3
>>  d427e23 at 10.0.0.2..CSeq: 33385 INVITE..User-Agent: Grandstream BT100 1.0.5.11..Max-Forwards: 69..Allow: IN
>>  VITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE..Content-Type: application/sdp..Content-Length: 397.
>>  .P-hint: fixed NAT contact for request..P-hint: request forced to mediaproxy....v=0..o=1919@ 8000 8000 IN IP4
>>   10.0.0.2..s=SIP Call..c=IN IP4 192.168.0.67..t=0 0..m=audio 35566 RTP/AVP 99 18 4 0 8 9 2 15 101..a=rt
>>  pmap:99 iLBC/8000..a=fmtp:99 mode=20..a=rtpmap:18 G729/8000..a=rtpmap:4 G723/8000..a=rtpmap:0 PCMU/8000..a=r
>>  tpmap:8 PCMA/8000..a=rtpmap:9 G722/8000..a=rtpmap:2 G726-32/8000..a=rtpmap:15 G728/8000..a=ptime:20..a=rtpma
>>  p:101 telephone-event/8000..a=fmtp:101 0-11..                                                               
>>#
>>U 192.168.0.87:5060 -> 192.168.0.65:5060
>>  SIP/2.0 100 Trying..To: <sip:2020 at ser.server.net>..From: "Telles 2" <sip:1919 at ser.server.net>;tag=ef9d331f5bca
>>  723c..Call-ID: e0b16e3a3d427e23 at 10.0.0.2..CSeq: 33385 INVITE..Via: SIP/2.0/UDP 192.168.0.65;branch=z9hG
>>  4bK54.23f86f66.0..Via: SIP/2.0/UDP 10.0.0.2:44863;rport=44863;received=192.168.0.91;branch=z9hG4bKc2c12
>>  5fc7680ccf0..Record-Route: <sip:2020 at 192.168.0.65;ftag=ef9d331f5bca723c;lr=on>..Server: Sipura/SPA2000-2.0
>>  .10(e)..Content-Length: 0....                                                                               
>>#
>>U 192.168.0.87:5060 -> 192.168.0.65:5060
>>  SIP/2.0 180 Ringing..To: <sip:2020 at ser.server.net>;tag=3033786eec83f67bi0..From: "Telles 2" <sip:1919 at ser.serv
>>  er.net>;tag=ef9d331f5bca723c..Call-ID: e0b16e3a3d427e23 at 10.0.0.2..CSeq: 33385 INVITE..Via: SIP/2.0/UDP 19
>>  2.168.65;branch=z9hG4bK54.23f86f66.0..Via: SIP/2.0/UDP 10.0.0.2:44863;rport=44863;received=192.168.
>>  0.91;branch=z9hG4bKc2c125fc7680ccf0..Record-Route: <sip:2020 at 192.168.0.65;ftag=ef9d331f5bca723c;lr=on>..Se
>>  rver: Sipura/SPA2000-2.0.10(e)..Content-Length: 0....                                                       
>>#
>>U 192.168.0.65:5060 -> 192.168.0.91:44863
>>  SIP/2.0 180 Ringing..To: <sip:2020 at ser.server.net>;tag=3033786eec83f67bi0..From: "Telles 2" <sip:1919 at ser.serv
>>  er.net>;tag=ef9d331f5bca723c..Call-ID: e0b16e3a3d427e23 at 10.0.0.2..CSeq: 33385 INVITE..Via: SIP/2.0/UDP 10
>>  .0.0.2:44863;rport=44863;received=192.168.0.91;branch=z9hG4bKc2c125fc7680ccf0..Record-Route: <sip:2020@
>>  192.168.0.65;ftag=ef9d331f5bca723c;lr=on>..Server: Sipura/SPA2000-2.0.10(e)..Content-Length: 0....        
>>##
>>U 192.168.0.87:5060 -> 192.168.0.65:5060
>>  SIP/2.0 200 OK..To: <sip:2020 at ser.server.net>;tag=3033786eec83f67bi0..From: "Telles 2" <sip:1919 at ser.server.ne
>>  t>;tag=ef9d331f5bca723c..Call-ID: e0b16e3a3d427e23 at 10.0.0.2..CSeq: 33385 INVITE..Via: SIP/2.0/UDP 192.168
>>  .0.65;branch=z9hG4bK54.23f86f66.0..Via: SIP/2.0/UDP 10.0.0.2:44863;rport=44863;received=192.168.0.91;
>>  branch=z9hG4bKc2c125fc7680ccf0..Record-Route: <sip:2020 at 192.168.0.65;ftag=ef9d331f5bca723c;lr=on>..Contact
>>  : Someone NET <sip:2020 at 192.168.0.87:5060>..Server: Sipura/SPA2000-2.0.10(e)..Content-Length: 244..Allo
>>  w: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER..Supported: x-sipura..Content-Type: application/sd
>>  p....v=0..o=- 10523026 10523026 IN IP4 192.168.0.87..s=-..c=IN IP4 192.168.0.87..t=0 0..m=audio 16408 RT
>>  P/AVP 18 100 101..a=rtpmap:18 G729a/8000..a=rtpmap:100 NSE/8000..a=rtpmap:101 telephone-event/8000..a=fmtp:1
>>  01 0-15..a=ptime:30..a=sendrecv..                                                                           
>>#
>>U 192.168.0.65:5060 -> 192.168.0.91:44863
>>  SIP/2.0 200 OK..To: <sip:2020 at ser.server.net>;tag=3033786eec83f67bi0..From: "Telles 2" <sip:1919 at ser.server.ne
>>  t>;tag=ef9d331f5bca723c..Call-ID: e0b16e3a3d427e23 at 10.0.0.2..CSeq: 33385 INVITE..Via: SIP/2.0/UDP 10.0.
>>  0.2:44863;rport=44863;received=192.168.0.91;branch=z9hG4bKc2c125fc7680ccf0..Record-Route: <sip:2020 at 192.1
>>  68.0.65;ftag=ef9d331f5bca723c;lr=on>..Contact: Someone NET <sip:2020 at 192.168.0.87:5060>..Server: Sipu
>>  ra/SPA2000-2.0.10(e)..Content-Length: 244..Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER..Su
>>  pported: x-sipura..Content-Type: application/sdp..P-hint: response forced to mediaproxy....v=0..o=- 10523026
>>   10523026 IN IP4 192.168.0.87..s=-..c=IN IP4 192.168.0.67..t=0 0..m=audio 35566 RTP/AVP 18 100 101..a=rt
>>  pmap:18 G729a/8000..a=rtpmap:100 NSE/8000..a=rtpmap:101 telephone-event/8000..a=fmtp:101 0-15..a=ptime:30..a
>>  =sendrecv..                                                                                                 
>>#
>>U 192.168.0.91:44863 -> 192.168.0.65:5060
>>  ACK sip:2020 at 192.168.0.87:5060 SIP/2.0..Via: SIP/2.0/UDP 10.0.0.2:44863;branch=z9hG4bK7246a42746efbbc5.
>>  .Route: <sip:2020 at 192.168.0.65;ftag=ef9d331f5bca723c;lr=on>..From: "Telles 2" <sip:1919 at ser.server.net>;tag
>>  =ef9d331f5bca723c..To: <sip:2020 at ser.server.net>;tag=3033786eec83f67bi0..Contact: <sip:1919 at 10.0.0.2:44863
>>  >..Call-ID: e0b16e3a3d427e23 at 10.0.0.2..CSeq: 33385 ACK..User-Agent: Grandstream BT100 1.0.5.11..Max-Forwa
>>  rds: 70..Allow: INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE..Content-Length: 0....            
>>#
>>U 192.168.0.65:5060 -> 192.168.0.87:5060
>>  ACK sip:2020 at 192.168.0.87:5060 SIP/2.0..Record-Route: <sip:2020 at 192.168.0.65;ftag=ef9d331f5bca723c;lr=on
>>  >..Via: SIP/2.0/UDP 192.168.0.65;branch=0..Via: SIP/2.0/UDP 10.0.0.2:44863;rport=44863;received=192.168
>>  .0.91;branch=z9hG4bK7246a42746efbbc5..From: "Telles 2" <sip:1919 at ser.server.net>;tag=ef9d331f5bca723c..To: 
>>  <sip:2020 at ser.server.net>;tag=3033786eec83f67bi0..Contact: <sip:1919 at 192.168.0.91:44863>..Call-ID: e0b16e3a
>>  3d427e23 at 10.0.0.2..CSeq: 33385 ACK..User-Agent: Grandstream BT100 1.0.5.11..Max-Forwards: 69..Allow: INVI
>>  TE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE..Content-Length: 0..P-hint: fixed NAT contact for requ
>>  est....                                                                                                     
>>######
>>U 192.168.0.91:44863 -> 192.168.0.65:5060
>>  BYE sip:2020 at 192.168.0.87:5060 SIP/2.0..Via: SIP/2.0/UDP 10.0.0.2:44863;branch=z9hG4bK63b83d2965c75b38.
>>  .Route: <sip:2020 at 192.168.0.65;ftag=ef9d331f5bca723c;lr=on>..From: "Telles 2" <sip:1919 at ser.server.net>;tag
>>  =ef9d331f5bca723c..To: <sip:2020 at ser.server.net>;tag=3033786eec83f67bi0..Contact: <sip:1919 at 10.0.0.2:44863
>>  >..Call-ID: e0b16e3a3d427e23 at 10.0.0.2..CSeq: 33386 BYE..User-Agent: Grandstream BT100 1.0.5.11..Max-Forwa
>>  rds: 70..Allow: INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE..Content-Length: 0....            
>>#
>>U 192.168.0.65:5060 -> 192.168.0.87:5060
>>  BYE sip:2020 at 192.168.0.87:5060 SIP/2.0..Record-Route: <sip:2020 at 192.168.0.65;ftag=ef9d331f5bca723c;lr=on
>>  >..Via: SIP/2.0/UDP 192.168.0.65;branch=z9hG4bK24.615e1d66.0..Via: SIP/2.0/UDP 10.0.0.2:44863;rport=448
>>  63;received=192.168.0.91;branch=z9hG4bK63b83d2965c75b38..From: "Telles 2" <sip:1919 at ser.server.net>;tag=ef9
>>  d331f5bca723c..To: <sip:2020 at ser.server.net>;tag=3033786eec83f67bi0..Contact: <sip:1919 at 192.168.0.91:44863>
>>  ..Call-ID: e0b16e3a3d427e23 at 10.0.0.2..CSeq: 33386 BYE..User-Agent: Grandstream BT100 1.0.5.11..Max-Forwar
>>  ds: 69..Allow: INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE..Content-Length: 0..P-hint: fixed N
>>  AT contact for request....                                                                                  
>>#
>>U 192.168.0.87:5060 -> 192.168.0.65:5060
>>  SIP/2.0 200 OK..To: <sip:2020 at ser.server.net>;tag=3033786eec83f67bi0..From: "Telles 2" <sip:1919 at sip.server.ne
>>  t>;tag=ef9d331f5bca723c..Call-ID: e0b16e3a3d427e23 at 10.0.0.2..CSeq: 33386 BYE..Via: SIP/2.0/UDP 192.168.
>>  0.65;branch=z9hG4bK24.615e1d66.0..Via: SIP/2.0/UDP 10.0.0.2:44863;rport=44863;received=192.168.0.91;bra
>>  nch=z9hG4bK63b83d2965c75b38..Record-Route: <sip:2020 at 192.168.0.65;ftag=ef9d331f5bca723c;lr=on>..Server: Si
>>  pura/SPA2000-2.0.10(e)..Content-Length: 0....                                                               
>>#
>>U 192.168.0.65:5060 -> 192.168.0.91:44863
>>  SIP/2.0 200 OK..To: <sip:2020 at ser.server.net>;tag=3033786eec83f67bi0..From: "Telles 2" <sip:1919 at sip.server.ne
>>  t>;tag=ef9d331f5bca723c..Call-ID: e0b16e3a3d427e23 at 10.0.0.2..CSeq: 33386 BYE..Via: SIP/2.0/UDP 10.0.0.
>>  2:44863;rport=44863;received=192.168.0.91;branch=z9hG4bK63b83d2965c75b38..Record-Route: <sip:2020 at 192.168.
>>  0.65;ftag=ef9d331f5bca723c;lr=on>..Server: Sipura/SPA2000-2.0.10(e)..Content-Length: 0....                
>>#




More information about the sr-users mailing list