[Serusers] ser 0.9.0+rpid

Daniel-Constantin Mierla daniel at voice-system.ro
Thu Apr 21 20:49:23 CEST 2005


You posted here the initial INVITE (from client to ser -- it has only 
one VIA header). You have to look at the forwarded INVITE. The 
apend_rpid_hf_p() has allocated some memory, which means that the AVP 
with RPID was found.

Daniel


On 04/21/05 18:25, raid at gmx.net wrote:

>hi
>
>i insert the code that you post
>
>ser log:
>
>ser[9485]: qm_free(0x8102340, 0x81484ec), called from authorize.c:
>get_ha1(103)
>ser[9485]: qm_free: freeing frag. 0x81484d4 alloc'ed from authorize.c:
>get_ha1(64)
>ser[9485]: HA1 string calculated: 5ce9b118d92408729639ab0c5781f32c
>Apr 21 17:05:57 sip /usr/local/sbin/ser[9485]: check_response(): Our result
>= 'f9535043d79cc979bab9d7a4d12df651'
>ser[9485]: check_response(): Authorization is OK
>ser[9485]: qm_malloc(0x403d4000, 34) called from usr_avp.c: add_avp(112)
>ser[9485]: qm_malloc(0x403d4000, 36) returns address 0x40591c60 frag.
>0x40591c48 (size=36) on 1 -th hit
>ser[9485]: generate_avps: set string AVP 'rpid = 54321'
>ser[9485]: qm_free(0x8102340, 0x8148568), called from res.c:
>free_columns(187)
>ser[9485]: qm_free: freeing frag. 0x8148550 alloc'ed from res.c:
>get_columns(58)
>ser[9485]: qm_free(0x8102340, 0x81485a0), called from res.c:
>free_columns(188)
>ser[9485]: qm_free: freeing frag. 0x8148588 alloc'ed from res.c:
>get_columns(64)
>ser[9485]: qm_free(0x8102340, 0x8148610), called from row.c: free_row(83)
>ser[9485]: qm_free: freeing frag. 0x81485f8 alloc'ed from row.c:
>convert_row(52)
>ser[9485]: qm_free(0x8102340, 0x81485d8), called from res.c: free_rows(129)
>ser[9485]: qm_free: freeing frag. 0x81485c0 alloc'ed from res.c:
>convert_rows(152)
>ser[9485]: qm_free(0x8102340, 0x8148524), called from res.c:
>free_result(249)
>ser[9485]: qm_free: freeing frag. 0x814850c alloc'ed from res.c:
>new_result(199)
>ser[9485]: ++++++++++++RPID*****************
>ser[9485]: qm_malloc(0x8102340, 68) called from rpid.c:
>append_rpid_hf_p(181)
>ser[9485]: qm_malloc(0x8102340, 68) returns address 0x8148660 frag.
>0x8148648 (size=124) on 1 -th hit
>
>
>but nothing was overwritten 
>
>
>INVITE sip:798622211 at sip.com SIP/2.0
>Via: SIP/2.0/UDP
>192.168.0.8:5060;rport;branch=z9hG4bK0D9AD35EC6134A2E9FC2BB2EEC68E3C7
>From: test <sip:test at sip.com>;tag=204182139
>To: <sip:798622211 at sip.com>
>Contact: <sip:test at 192.168.0.8:5060>
>Call-ID: A3AD4B58-0C75-432B-939B-6F8E0F5B7826 at 192.168.0.8
>CSeq: 57089 INVITE
>Proxy-Authorization: Digest
>username="test",realm="sip.com",nonce="4267c3270892339d82d6c238cbe075597dd1fdb5",response="f8bb90f3e87c02f70fedc03f7be4e574",uri="sip:798622211 at sip.com"
>Max-Forwards: 70
>Content-Type: application/sdp
>User-Agent: X-Lite release 1103m
>
>
>
>thanks for your patience
>
>regards
>raid
>
>  
>
>>to authenticate the INVITE you need to call proxy_authorize() -- you 
>>could use the next statement instead of last "if" block from your posted 
>>snippet:
>>
>>if (method=="INVITE")
>>{
>>	if (!proxy_authorize("", "subscriber"))
>>	{
>>		proxy_challenge("", "0");
>>		break;
>>	};
>>	log (1, "++++++++++++RPID*****************");              
>>	append_rpid_hf("", ";party=calling;id-type=subscriber;screen=yes");
>>};
>>
>>For SER version 0.9.0 or later, you can use avpops to load the value of 
>>rpid in an AVP without authenticating the INVITE. See the avp_db_load() 
>>function of the avpops module (http://www.voice-system.ro/docs/avpops/).
>>
>>Daniel
>>
>>
>>On 04/20/05 21:25, raid at gmx.net wrote:
>>
>>    
>>
>>>hi daniel
>>>
>>>thanks for answer
>>>
>>>i do this
>>>
>>>sip:~# serctl rpid add test 12345
>>>+-----------+-------+
>>>| username  | rpid  |
>>>+-----------+-------+
>>>| test      | 12345 |
>>>+-----------+-------+
>>>sip:~#
>>>
>>>if uac test register 
>>>
>>>ser log:
>>>
>>>ser[7665]: generate_avps: set string AVP 'rpid = 12345'
>>>ser[7665]: qm_free(0x8102340, 0x8140bc8), called from res.c:
>>>free_columns(187)
>>>ser[7665]: qm_free: freeing frag. 0x8140bb0 alloc'ed from res.c:
>>>get_columns(58)
>>>ser[7665]: qm_free(0x8102340, 0x813fda0), called from res.c:
>>>free_columns(188)
>>>ser[7665]: qm_free: freeing frag. 0x813fd88 alloc'ed from res.c:
>>>get_columns(64)
>>>ser[7665]: qm_free(0x8102340, 0x81424b8), called from row.c: free_row(83)
>>>ser[7665]: qm_free: freeing frag. 0x81424a0 alloc'ed from row.c:
>>>convert_row(52)
>>>ser[7665]: qm_free(0x8102340, 0x8140c00), called from res.c:
>>>      
>>>
>>free_rows(129)
>>    
>>
>>>ser[7665]: qm_free: freeing frag. 0x8140be8 alloc'ed from res.c:
>>>convert_rows(152)
>>>ser[7665]: qm_free(0x8102340, 0x81407a0), called from res.c:
>>>free_result(249)
>>>ser[7665]: qm_free: freeing frag. 0x8140788 alloc'ed from res.c:
>>>new_result(199)
>>>
>>>
>>>ser.cfg:
>>>
>>>##################################################################
>>>
>>>       if (!mf_process_maxfwd_header("10")) {
>>>               sl_send_reply("483", "Too Many Hops");
>>>               break;
>>>       };
>>>       if (msg:len > max_len) {
>>>               sl_send_reply("513", "Message Overflow");
>>>               break;
>>>       };
>>>
>>>       if (nat_uac_test("3")) {
>>>               if (method=="REGISTER" || (!search("^Record-Route:"))) {
>>>                       fix_nated_contact();
>>>                       if (method=="REGISTER") {
>>>                               fix_nated_register();
>>>                       } else if (method=="INVITE") {
>>>                               fix_nated_sdp("1");
>>>                       };
>>>                       force_rport();
>>>                       setflag(2);
>>>               };
>>>       };
>>>
>>>       if (method=="REGISTER") {
>>>               if (!www_authorize("", "subscriber")) {
>>>                       www_challenge("", "0");
>>>                       break;
>>>               };
>>>               if (!check_to()) {
>>>                       sl_send_reply("401", "Unauthorized");
>>>                       break;
>>>               };
>>>               if (is_user_in("From", "disabled")) {
>>>                       sl_send_reply("401", "Unauthorized");
>>>                       break;
>>>               };
>>>               if (!save("location")) {
>>>                       sl_reply_error();
>>>               };
>>>               break;
>>>       };
>>>
>>>       if (method=="INVITE" || method=="BYE") {
>>>               setflag(1);
>>>       };
>>>
>>>       if (method=="INVITE") record_route();
>>>
>>>       if (loose_route()) {
>>>               route(2);
>>>               break;
>>>       };
>>>
>>>       if (method=="INVITE") {
>>>              log (1, "++++++++++++RPID*****************");             
>>>append_rpid_hf("", ";party=calling;id-type=subscriber;screen=yes");
>>>      };
>>>
>>>####################################################################
>>>
>>>if uac call 1503 (1503 PSTN call)
>>>
>>>ser log:
>>>
>>>ser[7751]: ++++++++++++RPID*****************
>>>ser[7751]: append_rpid_hf: No rpid AVP
>>>ser[7751]: lookup(): '1503' Not found in usrloc
>>>ser[7751]: lookup(): '1503' Not found in usrloc
>>>ser[7751]: qm_malloc(0x8102340, 20) called from res.c: new_result(199)
>>>ser[7751]: qm_malloc(0x8102340, 20) returns address 0x813b5a8 frag.
>>>0x813b590 (size=24) on 1 -th hit
>>>
>>>
>>>sorry i do not understand
>>>
>>>thanks
>>>
>>>regards
>>>raid
>>>
>>>
>>> 
>>>
>>>      
>>>
>>>>>hi list
>>>>>
>>>>>please can someone explain to use ser with rpid
>>>>>
>>>>>where is the best place to insert "append_rpid_hf("<",
>>>>>">;party=calling;id-type=subscriber;screen=yes;privacy=off");"
>>>>>
>>>>>
>>>>>     
>>>>>
>>>>>          
>>>>>
>>>>after you authenticate the INVITE.
>>>>
>>>>Daniel
>>>>
>>>>   
>>>>
>>>>        
>>>>
>>>>>thanks
>>>>>
>>>>>regards
>>>>>raid
>>>>>
>>>>>
>>>>>
>>>>>     
>>>>>
>>>>>          
>>>>>
>>> 
>>>
>>>      
>>>
>
>  
>




More information about the sr-users mailing list