@@ -577,7 +577,7 @@ struct mi_root* mi_usrloc_show_contact(struct mi_root *cmd, void *param)
577
577
ucontact_t * con ;
578
578
str * aor ;
579
579
int ret ;
580
- str use_sock_str ;
580
+ time_t t ;
581
581
582
582
node = cmd -> node .kids ;
583
583
if (node == NULL || node -> next == NULL || node -> next -> next != NULL )
@@ -593,6 +593,8 @@ struct mi_root* mi_usrloc_show_contact(struct mi_root *cmd, void *param)
593
593
if ( mi_fix_aor (aor )!= 0 )
594
594
return init_mi_tree ( 400 , "Domain missing in AOR" , 21 );
595
595
596
+ t = time (0 );
597
+
596
598
lock_udomain ( dom , aor );
597
599
598
600
ret = get_urecord ( dom , aor , & rec );
@@ -606,16 +608,6 @@ struct mi_root* mi_usrloc_show_contact(struct mi_root *cmd, void *param)
606
608
rpl = 0 ;
607
609
608
610
for ( con = rec -> contacts ; con ; con = con -> next ) {
609
- if (con -> sock ) {
610
- if (con -> sock -> adv_sock_str .len ) {
611
- use_sock_str = con -> sock -> adv_sock_str ;
612
- } else {
613
- use_sock_str = con -> sock -> sock_str ;
614
- }
615
- } else {
616
- use_sock_str .s = "NULL" ;
617
- use_sock_str .len = 4 ;
618
- }
619
611
620
612
if (VALID_CONTACT ( con , act_time )) {
621
613
if (rpl_tree == 0 ) {
@@ -626,28 +618,7 @@ struct mi_root* mi_usrloc_show_contact(struct mi_root *cmd, void *param)
626
618
rpl -> flags |= MI_IS_ARRAY ;
627
619
}
628
620
629
- node = addf_mi_node_child ( rpl , 0 , "Contact" , 7 ,
630
- "<%.*s>;q=%s;expires=%d;flags=0x%X;cflags=0x%X;socket=<%.*s>;"
631
- "callid=<%.*s>;"
632
- "methods=0x%X"
633
- "%s%.*s%s" /*received*/
634
- "%s%.*s%s" /*user-agent*/
635
- "%s%.*s%s" , /*path*/
636
- con -> c .len , ZSW (con -> c .s ),
637
- q2str (con -> q , 0 ), (int )(con -> expires - act_time ),
638
- con -> flags , con -> cflags ,
639
- use_sock_str .len ,use_sock_str .s ,
640
- con -> callid .len , ZSW (con -> callid .s ),
641
- con -> methods ,
642
- con -> received .len ?";received=<" :"" ,con -> received .len ,
643
- ZSW (con -> received .s ), con -> received .len ?">" :"" ,
644
- con -> user_agent .len ?";user_agent=<" :"" ,con -> user_agent .len ,
645
- ZSW (con -> user_agent .s ), con -> user_agent .len ?">" :"" ,
646
- con -> path .len ?";path=<" :"" , con -> path .len ,
647
- ZSW (con -> path .s ), con -> path .len ?">" :""
648
- );
649
- if (node == 0 )
650
- goto error ;
621
+ if (mi_add_aor_node (rpl , rec , t , 0 )!= 0 ) goto error ;
651
622
}
652
623
}
653
624
0 commit comments