한국어

소프트스위치

온누리070 플레이스토어 다운로드
    acrobits softphone
     온누리 070 카카오 프러스 친구추가온누리 070 카카오 프러스 친구추가친추
     카카오톡 채팅 상담 카카오톡 채팅 상담카톡
    
     라인상담
     라인으로 공유

     페북공유

   ◎위챗 : speedseoul


  
     PAYPAL
     
     PRICE
     

pixel.gif

    before pay call 0088 from app


1.4.3.  lookup(domain [, flags [, aor]])

The functions extracts username from Request-URI and tries to find all contacts for the username in usrloc. If there are no such contacts, -1 will be returned. If there are such contacts, Request-URI will be overwritten with the contact that has the highest q value and optionally the rest will be appended to the message (depending on append_branches parameter value).

If the method_filtering option is enabled, the lookup function will return only the contacts that support the method of the processed request.

Meaning of the parameters is as follows:

  • domain - Name of table that should be used for the lookup.

  • flags(optional)

    • 'b' (no Branches) - this flag controls how lookup function processes multiple contacts. If there are multiple contacts for the given username in usrloc and this flag is not set, Request-URI will be overwritten with the highest-q rated contact and the rest will be appended to sip_msg structure and can be later used by tm for forking. If the flag is set, only Request-URI will be overwritten with the highest-q rated contact and the rest will be left unprocessed.

    • 'r' (bRanch lookup) - this flag enables searching through existing branches for aor's and expanding them to contacts. For example, you have got AOR A in your ruri but you also want to forward your calls to AOR B. In order to do this, you must put AOR B in a branch, and if this flag enabled, the function will also expand AOR B to contacts, which will be put back into the branches. The AOR's that were in branches before the function call shall be removed.

      WARNING: if you want this flag activated, the 'b' (no Branches) flag must not be set, because by setting that flag you won't allow lookup to write in a branch.

    • 'm' (Method filtering) - this flag tells if the contact filtering based on supported methods should be performed during lookup.

    • 'u' (User-Agent filtering) - this flag enables regexp filtering by user-agent. It's useful with enabled append_branches parameter. Regexp must follow the 'u' flag and must use format like 'u/regexp/'.

    • 'i' (Case insensitive search) - this flag enables case insensitive filtering for the 'u' flag.

    • 'e' (Use extended regexp) - this flag enables using of extended regexp format for the 'u' flag.

  • AOR (optional)- AOR to lookup for; if missing, the RURI is used as AOR; This must be a variable.

Return codes:

  • 1 - contacts found and returned.

    -1 - no contact found.

    -2 - contacts found, but method not supported.

    -3 - internal error during processing.

This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.

Example 1.19. lookup usage

...
lookup("location");  # simple lookup
   #or
lookup("location","m"); # lookup with method filtering
   #or
lookup("location","r"); #lookup with aor branch search;
						#all contacts except the first one shall be put
						#in the branches
   #or
lookup("location","u/phone/i"); # lookup with user-agent filtering
   #or
lookup("location","","$var(aor)"); # simple lookup with AOR from PV
switch ($retcode) {
    case -1:
    case -3:
        sl_send_reply("404", "Not Found");
        exit;
    case -2:
        sl_send_reply("405", "Not Found");
        exit;
};
...
조회 수 :
96907
등록일 :
2017.12.09
16:33:33 (*.160.88.18)
엮인글 :
http://www.webs.co.kr/index.php?document_srl=3312374&act=trackback&key=c13
게시글 주소 :
http://www.webs.co.kr/index.php?document_srl=3312374
List of Articles
번호 제목 글쓴이 날짜 조회 수
172 opensips Rtpengine installation configuration admin 2024-05-22 1360
171 Asterisk 에서 FreeSWITCH 전환 admin 2024-04-09 4374
170 OpenSIPS 이해 서비스 지원 admin 2024-04-09 4310
169 OpenSIPS install configuration support admin 2024-04-09 4309
168 opensips basic route script configuration admin 2023-08-13 11100
167 opensips-cli command admin 2023-08-07 11362
166 string trans opensips admin 2023-08-05 9480
165 opensips Push Notification configuration admin 2023-07-29 9588
164 opensips Call pickup configuration admin 2023-07-27 9514
163 t_relay opensips admin 2023-07-25 9520
162 debian 11 opensips 3.2 install command admin 2023-06-25 13703
161 Opensips Gateway between SIP and SMPP messages admin 2019-02-19 272287
160 smpp sms opensips admin 2019-02-19 17168
159 Busy Lamp Field (BLF) feature on Opensips 2.4.0 with Zoiper configuration admin 2018-05-29 26528
158 Documentation -> Tutorials -> WebSocket Transport using OpenSIPS admin 2018-05-17 22981
157 List of SIP response codes admin 2017-12-20 47133
156 opensips/modules/event_routing/ Push Notification Call pickup admin 2017-12-20 19786
155 opensips push notification How to detail file admin 2017-12-20 30035
154 OpenSIPS routing logic admin 2017-12-12 52001
153 OpenSIPS example configuration admin 2017-12-12 23179
152 opensips complete configuration example admin 2017-12-10 47481
151 Opensips1.6 ebook detail configuration and SIP signal and NAT etc file admin 2017-12-10 77446
150 dictionary.opensips radius admin 2017-12-09 101020
149 what is record_route() in opensips ? admin 2017-12-09 29490
148 what is loose_route() in opensips ? file admin 2017-12-09 29171
» in opensips what is lookup(domain [, flags [, aor]]) admin 2017-12-09 96907
146 in opensips db_does_uri_exist() what is admin 2017-12-09 23164
145 in opensips what is has_totag() admin 2017-12-09 28074
144 opensips exec module admin 2017-12-08 23499
143 opensips push notification How to admin 2017-12-07 26527