[Serusers] ser 0.9.0+rpid

Daniel-Constantin Mierla daniel at voice-system.ro
Thu Apr 21 00:14:12 CEST 2005


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