pjsip如何js判断使rem动态变化contact是否有变化

[ios]pjsip 接收短信
注意事项: 本文中文内容可能为机器翻译,如要查看英文原文请点击上面连接.
任何人都知道任何有关如何设置 pjsip 客户端接收邮件的好例子。我可以从使用的客户端发送的消息:
pjsua_im_send(sip_acc_id, &to, NULL, &msgbody, NULL, NULL);
到任何号码。
但我也不知道要做什么来入的已注册的 sip 帐户接收邮件。
任何信息将不胜感激。
注: 我只可以使用 pjsip 和任何其他库。
编辑:我发现了一些新的东西:
(然而所有此文档说传入消息这是:
16.1.2 接收消息
应用模块就会收到传入消息请求以外任何对话框。传入消息请求对话框的内会通知到通过on_tsx_state()回调对话框的对话框的用法。
其中仍然不亮多的光线如何处理传入的邮件。
261.txt" rel="nofollow">http://www.ietf.org/rfc/rfstatic void on_pager(pjsua_call_id call_id, const pj_str_t *from, const pj_str_t *to, const pj_str_t *contact, const pj_str_t *mime_type, const pj_str_t *body) {
NSLog(@"****************
on_pager called
**********************");
AppDelegate *app = (AppDelegate *)[AppDelegate sharedApplication];
pjsua_call_
pjsua_call_get_info(call_id, &ci);
PJ_UNUSED_ARG(call_id);
PJ_UNUSED_ARG(to);
PJ_UNUSED_ARG(contact);
PJ_UNUSED_ARG(mime_type);
[app ring];
//PJ_LOG(3,(THIS_FILE, "MESSAGE from %.*s: %.*s (%.*s)", (int)from-&slen, from-&ptr, (int)text-&slen, text-&ptr, (int)mime_type-&slen, mime_type-&ptr));
postMessageStateNotification(call_id, &ci);
Edit2:我被告知 on_pager 函数需要使用此功能。因此,不幸的是我试过但仍然没有成功。
这里是自己做了什么:
/* Initialize application callbacks */
app_config-&cfg.cb.on_call_state = &on_call_
app_config-&cfg.cb.on_call_media_state = &on_call_media_
app_config-&cfg.cb.on_incoming_call = &on_incoming_
app_config-&cfg.cb.on_reg_state = &on_reg_
app_config-&cfg.cb.on_pager = &on_
和 on_pager 执行:
static void on_pager(pjsua_call_id call_id, const pj_str_t *from, const pj_str_t *to, const pj_str_t *contact, const pj_str_t *mime_type, const pj_str_t *body) {
NSLog(@"****************
on_pager called
**********************");
AppDelegate *app = (AppDelegate *)[AppDelegate sharedApplication];
pjsua_call_
pjsua_call_get_info(call_id, &ci);
PJ_UNUSED_ARG(call_id);
PJ_UNUSED_ARG(to);
PJ_UNUSED_ARG(contact);
PJ_UNUSED_ARG(mime_type);
[app ring];
//PJ_LOG(3,(THIS_FILE, "MESSAGE from %.*s: %.*s (%.*s)", (int)from-&slen, from-&ptr, (int)text-&slen, text-&ptr, (int)mime_type-&slen, mime_type-&ptr));
postMessageStateNotification(call_id, &ci);
我在等应用程序调用 on_pager 时收到一条消息,但它没有。on_incoming_call不过,是否会被调用。
解决方法 1:
结果出来,自己做了什么是正确的和它是只是一个与服务器的问题。现在工作接收消息 !
总结一下,基本上:
当为 sip 注册:
app_config-&cfg.cb.on_pager = &on_
这将注册为收到短信后调用的 on_pager() 函数。剩下的就看你怎么办在该函数内部。
这是函数头:
static void on_pager(pjsua_call_id call_id, const pj_str_t *from, const pj_str_t *to, const pj_str_t *contact, const pj_str_t *mime_type, const pj_str_t *body)
一切都是自我解释为函数参数等。总之感谢每个人都想 !
App_config 的 pjsua_init() 函数内传递。
此外,在 sipStartup() 中我们注册 iOS 的 NSNotification 函数。
/***** SIP ********/
- (BOOL)sipStartup
kSIPCallState
= @"CallState";
kSIPRegState
= @"RegState";
kSIPMwiInfo
= @"MWIInfo";
if (_app_config.pool)
return YES;
self.networkActivityIndicatorVisible = YES;
if (sip_startup(&_app_config) != PJ_SUCCESS)
self.networkActivityIndicatorVisible = NO;
return NO;
self.networkActivityIndicatorVisible = NO;
CTTelephonyNetworkInfo *phoneInfo = [[CTTelephonyNetworkInfo alloc] init];
CTCarrier *phoneCarrier = [phoneInfo subscriberCellularProvider];
NSLog(@"Carrier = %@", phoneCarrier);
[self checkForConnection];
receiveCallTask = [[UIApplication sharedApplication]
beginBackgroundTaskWithExpirationHandler:^{
//timer = [NSTimer scheduledTimerWithTimeInterval:5.0 target:self selector:@selector(checkForConnection) userInfo:nil repeats:YES];
/** Call management **/
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(processCallState:)
name: kSIPCallState object:nil];
/** Registration management */
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(processRegState:)
name: kSIPRegState object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(processMessageState:)
name:kSIPMwiInfo object:nil];
return YES;
和 processMessageState: 下面是:
- (void)processMessageState:(NSNotification *)notification
NSLog(@"*****
processMessageState is called
NSNumber *value = [[ notification userInfo] objectForKey:@"CallID"];
pjsua_call_id callId = [value intValue];
int state = [[[ notification userInfo] objectForKey:@"Event"] intValue];
switch (state) {
case PJSIP_EVENT_UNKNOWN:
NSLog(@"unknown event");
case PJSIP_EVENT_TIMER:
NSLog(@"timer event");
case PJSIP_EVENT_RX_MSG:
NSLog(@"received --& rx_msg");
case PJSIP_EVENT_TX_MSG:
NSLog(@"tx_msg");
case PJSIP_EVENT_TRANSPORT_ERROR:
NSLog(@"msg transport error");
case PJSIP_EVENT_TSX_STATE:
NSLog(@"event tsx state");
case PJSIP_EVENT_USER:
NSLog(@"event user");
NSLog(@"processMessageState was called");mailing list archives
AST-: Remote Crash Vulnerability in PJSIP channel driver
From: &Asterisk Security Team& &security () asterisk org&
Date: Thu, 20 Nov :50 -0600
Asterisk Project Security Advisory - AST-
Remote Crash Vulnerability in PJSIP channel driver
Nature of Advisory
Denial of Service
Susceptibility
Remote Unauthenticated Sessions
Exploits Known
Reported On
17 November 2014
Reported By
Joshua Colp
20 November 2014
Last Updated On
November 20, 2014
Advisory Contact
Joshua Colp &jcolp AT digium DOT com&
Description
When handling an INVITE with Replaces message the
res_pjsip_refer module incorrectly assumes that it will be
operating on a channel that has just been created. If the
INVITE with Replaces message is sent in-dialog after a
session has been established this assumption will be
incorrect. The res_pjsip_refer module will then hang up a
channel that is actually owned by another thread. When this
other thread attempts to use the just hung up channel it
will end up using freed channel which will likely cause a
Resolution
If REFER support is not required the res_pjsip_refer module
can be unloaded to limit exposure otherwise the
res_pjsip_refer module has been patched so it will not allow
an in-dialog INVITE with Replaces message to be processed.
Affected Versions
Asterisk Open Source
All versions
Asterisk Open Source
All versions
Corrected In
Asterisk Open Source
12.7.1, 13.0.1
Asterisk Project Security Advisories are posted at
This document may be supersed if so, the latest
version will be posted at
Revision History
Revisions Made
November 20 2014
Joshua Colp
Initial Revision
Asterisk Project Security Advisory - AST-
Copyright (c) 2014 Digium, Inc. All Rights Reserved.
Permission is hereby granted to distribute and publish this advisory in its
original, unaltered form.
Current thread:
AST-: Remote Crash Vulnerability in PJSIP channel driver Asterisk Security Team (Nov 20)当前位置: >>>
pjsip协议栈中定时器的实现详解
pjsip中管理定时器的数据结构是堆,是采用小顶堆来实现的,该堆为一棵完全二叉树,该完全二叉树采用顺序结构(即是数组)实现。
SIP中的用于超市重传或其他用途的定时器(timer)很多,令人头大,很久以前就想到如何实现这些定时器,以前用C
coding的时候,就是简单地sleep一下来延时。今天仔细分析了pjsip栈中定时器的实现源代码。灰常兴奋地看了...
pjsip也是借鉴别人的实现方法,这在其官网上,作者如是说。
pjsip中管理定时器的数据结构是堆,是采用小顶堆来实现的,该堆为一棵完全二叉树,该完全二叉树采用顺序结构(即是数组)实现。
对于每一个定时器,pjsip中用一个定时器实体结构体来描述,该实体结构体如下:
&&&struct&pj_timer_entry&{&&&&&&&&&&&&&&void&*user_&&&&&&&&&&&&&&&int&&&&&&&&&&&&&&pj_timer_heap_callback&*&&&&&&&&&&&&&&pj_timer_id_t&_timer_&&&&&&&&&&&&&&pj_time_val&_timer_&};&
注释已经很清楚了,不细说啦......
&&& 另一个很重要的实体结构是延时的时间结构体,其包括时间的s和ms两个域:
&&&&&typedef&struct&pj_time_val&{&&&&&&&&&&long&&&&&&&&&&&&&&&long&&&&&&}&pj_time_&
&& 上述说了小顶堆,以及定时器实体,还有时间结构,那么究竟怎么实现定时功能呢?
不说大家也猜得到,我们必须提供某种机制来判断定时器是否timeout,怎么判断?pjsip中采用轮询的方式,不断轮询定时器堆(定时器实体构成一个定时器小顶堆)根元素,来判断是否超时的。
&& 首先,pj_timer_heap_create()创建定时器堆;
然后,pj_timer_heap_schedule()来调度定时器,也就是插入到定时器堆中,该函数实现堆的基本操作,一旦一个定时器结构体加入堆,就开始计时,此时,该加入的定时器结构体记录了入堆的当前时刻加上延时时间,也就是将来的定时到的某个时刻;
然后,pj_timer_heap_poll()在某线程或者主线程中不断轮询定时器堆的根元素,并且获取轮询时候的当前时刻,用它来和根元素的超时刻比较,如果根元素的记录时刻小于当前时刻,那么该定时器超时,然后将其从堆中删掉,并调用回调函数,进行超时操作。
上述的定时精度不能说十分准确,单基本够用。
其实定时器的实现原理很简单,就是创建一种机制来判断当前时刻某定时器是否超时。这个过程是个循环的过程。曾经用c语言采用sleep的方式实现定时,使用函数指针来传回调函数为用户提供API,但是精度远不如上述方式。
(责任编辑:落鹤生)
本站文章除注明转载外,均为本站原创或编译欢迎任何形式的转载,但请务必注明出处,尊重他人劳动,同学习共成长。转载请注明:文章转载自:罗索实验室 []
本文出处:百度博客 作者:chenjily
------分隔线----------------------------
将本文分享到微信
使用该AEC算法要注意两点:1)延时要小,因为算法默认滤波器长...
访问http://192.168.11.75:8080/player.html,可以播放。用三星P7500安卓平...
我一直认为,工程师,尤其 是一线的,是最接近真相的人,也是...
今天尝试编写了一个基于 v4l2 的摄像头应用, 目前仅仅实现从摄...
onvif规范的实现:成功实现ONVIF协议RTSP-Video-Stream与OnvifDeviceMana...
onvif规范的实现:server端Discovery实现,通过OnvifTestTool12.06测试:网...; PJSIP Configuration Samples and Quick Reference
; This file has several very basic configuration examples, to serve as a quick
; reference to jog your memory when you need to write up a new configuration.
; It is not intended to teach PJSIP configuration or serve as an exhaustive
; reference of options and potential scenarios.
; This file has two main sections.
; First, manually written examples to serve as a handy reference.
; Second, a list of all possible PJSIP config options by section. This is
; pulled from the XML config help. It only shows the synopsis for every item.
; If you want to see more detail please check the documentation sources
; mentioned at the top of this file.
; Documentation
; The official documentation is at http://wiki.asterisk.org
; You can read the XML configuration help via Asterisk command line with
; "config show help res_pjsip", then you can drill down through the various
; sections and their options.
;========!!!!!!!!!!!!!!!!!!!
SECURITY NOTICE
!!!!!!!!!!!!!!!!!!!!===========
; At a minimum please read the file "README-SERIOUSLY.bestpractices.txt",
; located in the Asterisk source directory before starting Asterisk.
; Otherwise you risk allowing the security of the Asterisk system to be
; compromised. Beyond that please visit and read the security information on
; the wiki at: https://wiki.asterisk.org/wiki/x/EwFB
; A few basics to pay attention to:
; Anonymous Calls
; By default anonymous inbound calls via PJSIP are not allowed. If you want to
; route anonymous calls you'll need to define an endpoint named "anonymous".
; res_pjsip_endpoint_identifier_anonymous.so handles that functionality so it
; must be loaded. It is not recommended to accept anonymous calls.
; Access Control Lists
; See the example ACL configuration in this file. Read the configuration help
; for the section and all of its options. Look over the samples in acl.conf
; and documentation at https://wiki.asterisk.org/wiki/x/uA80AQ
; If possible, restrict access to only networks and addresses you trust.
; Dialplan Contexts
; When defining configuration (such as an endpoint) that links into
; dialplan configuration, be aware of what that dialplan does. It's easy to
; accidentally provide access to internal or outbound dialing extensions which
; could cost you severely. The "context=" line in endpoint configuration
; determines which dialplan context inbound calls will enter into.
;=============================================================================
; Overview of Configuration Section Types Used in the Examples
; * Transport "transport"
* Configures res_pjsip transport layer interaction.
; * Endpoint "endpoint"
* Configures core SIP functionality related to SIP endpoints.
; * Authentication "auth"
* Stores inbound or outbound authentication credentials for use by trunks,
endpoints, registrations.
; * Address of Record "aor"
* Stores contact information for use by endpoints.
; * Endpoint Identification "identify"
* Maps a host directly to an endpoint
; * Access Control List "acl"
* Defines a permission list or references one stored in acl.conf
; * Registration "registration"
* Contains information about an outbound SIP registration
; * Phone Provisioning "phoneprov"
* Contains information needed by res_phoneprov for autoprovisioning
; The following sections show example configurations for various scenarios.
; Most require a couple or more configuration types configured in concert.
;=============================================================================
; Naming of Configuration Sections
; Configuration section names are denoted with enclosing brackets,
; e.g. [6001]
; In most cases, you can name a section whatever makes sense to you. For example
; you might name a transport [transport-udp-nat] to help you remember how that
; section is being used. However, in some cases, ("endpoint" and "aor" types)
; the section name has a relationship to its function.
; Depending on the modules loaded, Asterisk can match SIP requests to an
; endpoint or aor in a few ways:
; 1) Match a section name for endpoint type sections to the username in the
"From" header of inbound SIP requests.
; 2) Match a section name for aor type sections to the username in the "To"
header of inbound SIP REGISTER requests.
; 3) With an identify type section configured, match an inbound SIP request of
any type to an endpoint or aor based on the IP source address of the
; Note that sections can have the same name as long as their "type" options are
; set to different values. In most cases it makes sense to have associated
; configuration sections use the same name, as you'll see in the examples within
; this file.
;===============EXAMPLE TRANSPORTS============================================
; A few examples for potential transport options.
; For the NAT transport example, be aware that the options starting with
; the prefix "external_" will only apply to communication with addresses
; outside the range set with "local_net=".
; IPv6: For endpoints using IPv6, remember to set "rtp_ipv6=yes" so that the RTP
; engine will also be able to bind to an IPv6 address.
; You can have more than one of any type of transport, as long as it doesn't
; use the same resources (bind address, port, etc) as the others.
; Basic UDP transport
;[transport-udp]
;type=transport
;protocol=udp,tcp,tls,ws,wss
;bind=0.0.0.0
; UDP transport behind NAT
;[transport-udp-nat]
;type=transport
;protocol=udp
;bind=0.0.0.0
;local_net=192.0.2.0/24
;external_media_address=203.0.113.1
;external_signaling_address=203.0.113.1
; Basic IPv6 UDP transport
;[transport-udp-ipv6]
;type=transport
;protocol=udp
; Example IPv4 TLS transport
;[transport-tls]
;type=transport
;protocol=tls
;bind=0.0.0.0
;cert_file=/path/mycert.crt
;priv_key_file=/path/mykey.key
;cipher=ADH-AES256-SHA,ADH-AES128-SHA
;method=tlsv1
;===============OUTBOUND REGISTRATION WITH OUTBOUND AUTHENTICATION============
; This is a simple registration that works with some SIP trunking providers.
; You'll need to set up the auth example "mytrunk_auth" below to enable outbound
; authentication. Note that we "outbound_auth=" use for outbound authentication
; instead of "auth=", which is for inbound authentication.
; If you are registering to a server from behind NAT, be sure you assign a transport
; that is appropriately configured with NAT related settings. See the NAT transport example.
; "contact_user=" sets the SIP contact header's user portion of the SIP URI
; this will affect the extension reached in dialplan when the far end calls you at this
; registration. The default is 's'.
; If you would like to enable line support and have incoming calls related to this
; registration go to an endpoint automatically the "line" and "endpoint" options must
; be set. The "endpoint" option specifies what endpoint the incoming call should be
; associated with.
;[mytrunk]
;type=registration
;transport=transport-udp
;outbound_auth=mytrunk_auth
;server_uri=sip:
;client_uri=sip:@
;contact_user=
;retry_interval=60
;forbidden_retry_interval=600
;expiration=3600
;endpoint=mytrunk
;[mytrunk_auth]
;type=auth
;auth_type=userpass
;password=
;username=
;===============ENDPOINT CONFIGURED AS A TRUNK, OUTBOUND AUTHENTICATION=======
; This is one way to configure an endpoint as a trunk. It is set up with
; "outbound_auth=" to enable authentication when dialing out through this
; endpoint. There is no inbound authentication set up since a provider will
; not normally authenticate when calling you.
; The identify configuration enables IP address matching against this endpoint.
; For calls from a trunking provider, the From user may be different every time,
; so we want to match against IP address instead of From user.
; If you want the provider of your trunk to know where to send your calls
; you'll need to use an outbound registration as in the example above this
; section.
; At a basic level configure the endpoint with a transport that is set up
; with the appropriate NAT settings. There may be some additional settings you
; need here based on your NAT/Firewall scenario. Look to the CLI config help
; "config show help res_pjsip endpoint" or on the wiki for other NAT related
; options and configuration. We've included a few below.
; Endpoints use one or more AOR sections to store their contact details.
; You can define multiple contact addresses in SIP URI format in multiple
; "contact=" entries.
;[mytrunk]
;type=endpoint
;transport=transport-udp
;context=from-external
;disallow=all
;allow=ulaw
;outbound_auth=mytrunk_auth
;aors=mytrunk
;A few NAT relevant options that may come in handy.
;force_rport=It's a good idea to read the configuration help for each
;direct_media=of these options.
;ice_support=yes
;[mytrunk]
;contact=sip:198.51.100.1:5060
;contact=sip:198.51.100.2:5060
;[mytrunk]
;type=identify
;endpoint=mytrunk
;match=198.51.100.1
;match=198.51.100.2
;=============ENDPOINT CONFIGURED AS A TRUNK, INBOUND AUTH AND REGISTRATION===
; Here we are allowing a remote device to register to Asterisk and requiring
; that they authenticate for registration and calls.
; You'll note that this configuration is essentially the same as configuring
; an endpoint for use with a SIP phone.
;type=endpoint
;context=from-external
;disallow=all
;allow=ulaw
;transport=transport-udp
;auth=7000
;aors=7000
;type=auth
;auth_type=userpass
;password=7000
;username=7000
;max_contacts=1
;===============ENDPOINT CONFIGURED FOR USE WITH A SIP PHONE==================
; This example includes the endpoint, auth and aor configurations. It
; requires inbound authentication and allows registration, as well as references
; a transport that you'll need to uncomment from the previous examples.
; Uncomment one of the transport lines to choose which transport you want. If
; not specified then the default transport chosen is the first defined transport
; in the configuration file.
; Modify the "max_contacts=" line to change how many unique registrations to allow.
; Use the "contact=" line instead of max_contacts= if you want to statically
; define the location of the device.
; If using the TLS enabled transport, you may want the "media_encryption=sdes"
; option to additionally enable SRTP, though they are not mutually inclusive.
; Use the "rtp_ipv6=yes" option if you want to utilize RTP over an ipv6 transport.
; If this endpoint were remote, and it was using a transport configured for NAT
; then you likely want to use "direct_media=no" to prevent audio issues.
;type=endpoint
;transport=transport-udp
;context=from-internal
;disallow=all
;allow=ulaw
;allow=gsm
;auth=6001
;aors=6001
; A few more transports to pick from, and some related options below them.
;transport=transport-tls
;media_encryption=sdes
;transport=transport-udp-ipv6
;rtp_ipv6=yes
;transport=transport-udp-nat
;direct_media=no
; MWI related options
;aggregate_mwi=yes
;mailboxes=6001@default,7001@default
;mwi_from_user=6001
; Extension and Device state options
;device_state_busy_at=1
;allow_subscribe=yes
;sub_min_expiry=30
;type=auth
;auth_type=userpass
;password=6001
;username=6001
;max_contacts=1
;contact=sip:.2.1:5060
;===============ENDPOINT BEHIND NAT OR FIREWALL===============================
; This example assumes your transport is configured with a public IP and the
; endpoint itself is behind NAT and maybe a firewall, rather than having
; Asterisk behind NAT. For the sake of simplicity, we'll assume a typical
; VOIP phone. The most important settings to configure are:
* direct_media, to ensure Asterisk stays in the media path
* rtp_symmetric and force_rport options to help the far-end NAT/firewall
; Depending on the settings of your remote SIP device or NAT/firewall device
; you may have to experiment with a combination of these settings.
; If both Asterisk and the remote phones are a behind NAT/firewall then you'll
; have to make sure to use a transport with appropriate settings (as in the
; transport-udp-nat example).
;type=endpoint
;transport=transport-udp
;context=from-internal
;disallow=all
;allow=ulaw
;auth=6002
;aors=6002
;direct_media=no
;rtp_symmetric=yes
;force_rport=yes
;rewrite_contact= necessary if endpoint does not know/register public ip:port
;ice_support=This is specific to clients that support NAT traversal
for media via ICE,STUN,TURN. See the wiki at:
https://wiki.asterisk.org/wiki/x/D4FHAQ
for a deeper explanation of this topic.
;type=auth
;auth_type=userpass
;password=6002
;username=6002
;max_contacts=2
;============EXAMPLE ACL CONFIGURATION==========================================
; The ACL or Access Control List section defines a set of permissions to permit
; or deny access to various address or addresses. Alternatively it references an
; ACL configuration already set in acl.conf.
; The ACL configuration is independent of individual endpoint configuration and
; operates on all inbound SIP communication using res_pjsip.
; Reference an ACL defined in acl.conf.
;acl=example_named_acl1
; Reference a contactacl specifically.
;contact_acl=example_contact_acl1
; Define your own ACL here in pjsip.conf and
; permit or deny by IP address or range.
;deny=0.0.0.0/0.0.0.0
;permit=209.16.236.0/24
;deny=209.16.236.1
; Restrict based on Contact Headers rather than IP.
; Define options multiple times for various addresses or use a comma-delimited string.
;contact_deny=0.0.0.0/0.0.0.0
;contact_permit=209.16.236.0/24
;contact_permit=209.16.236.1
;contact_permit=209.16.236.2,209.16.236.3
; Restrict based on Contact Headers rather than IP and use
; advanced syntax. Note the bang symbol used for "NOT", so we can deny
; 209.16.236.12/32 within the permit= statement.
;contact_deny=0.0.0.0/0.0.0.0
;contact_permit=209.16.236.0
;permit=209.16.236.0/24, !209.16.236.12/32
;============EXAMPLE RLS CONFIGURATION==========================================
;Asterisk provides support for RFC 4662 Resource List Subscriptions. This allows
;for an endpoint to, through a single subscription, subscribe to the states of
;multiple resources. Resource lists are configured in pjsip.conf using the
;resource_list configuration object. Below is an example of a resource list that
;allows an endpoint to subscribe to the presence of alice, bob, and carol.
;[my_list]
;type=resource_list
;list_item=alice
;list_item=bob
;list_item=carol
;event=presence
;The "event" option in the resource list corresponds to the SIP event-package
;that the subscribed resources belong to. A resource list can only provide states
;for resources that belong to the same event-package. This means that you cannot
;create a list that is a combination of presence and message-summary resources,
;for instance. Any event-package that Asterisk supports can be used in a resource
;list (presence, dialog, and message-summary). Whenever support for a new event-
;package is added to Asterisk, support for that event-package in resource lists
;will automatically be supported.
;The "list_item" options indicate the names of resources to subscribe to. The
;way these are interpreted is event-package specific. For instance, with presence
;list_items, hints in the dialplan are looked up. With message-summary list_items,
;mailboxes are looked up using your installed voicemail provider (app_voicemail
;by default). Note that in the above example, the list_item options were given
;one per line. However, it is also permissible to provide multiple list_item
;options on a single line (e.g. list_item = alice,bob,carol).
;In addition to the options presented in the above configuration, there are two
;more configuration options that can be set.
; * full_state: dictates whether Asterisk should always send the states of
all resources in the list at once. Defaults to "no". You should only set
this to "yes" if you are interoperating with an endpoint that does not
behave correctly when partial state notifications are sent to it.
; * notification_batch_interval: By default, Asterisk will send a NOTIFY request
immediately when a resource changes state. This option causes Asterisk to
start batching resource state changes for the specified number of milliseconds
after a resource changes states. This way, if multiple resources change state
within a brief interval, Asterisk can send a single NOTIFY request with all
of the state changes reflected in it.
;There is a limitation to the size of resource lists in Asterisk. If a constructed
;notification from Asterisk will exceed 64000 bytes, then the message is deemed
;too large to send. If you find that you are seeing error messages about SIP
;NOTIFY requests being too large to send, consider breaking your lists into
;sub-lists.
;============EXAMPLE PHONEPROV CONFIGURATION================================
; Before configuring provisioning here, see the documentation for res_phoneprov
; and configure phoneprov.conf appropriately.
; For each user to be autoprovisioned, a [phoneprov] configuration section
; must be created.
At a minimum, the 'type', 'PROFILE' and 'MAC' variables must
All other variables are optional.
; Example:
;type=phon must be specified as 'phoneprov'
;endpoint=1000 Required only if automatic setting of
USERNAME, SECRET, DISPLAY_NAME and CALLERID
are needed.
;PROFILE=d required
;MAC=deadbeef4 required
;SERVER= A standard variable
;TIMEZONE=America/D A standard variable
;MYVAR=som A user confdigured variable
; If the phoneprov sections have common variables, it is best to create a
; phoneprov template.
The example below will produce the same configuration
; as the one specified above except that MYVAR will be overridden for
; the specific user.
; Example:
;[phoneprov_defaults](!)
;type=phon must be specified as 'phoneprov'
;PROFILE=d required
;SERVER= A standard variable
;TIMEZONE=America/D A standard variable
;MYVAR=som A user configured variable
;[1000](phoneprov_defaults)
;endpoint=1000 Required only if automatic setting of
USERNAME, SECRET, DISPLAY_NAME and CALLERID
are needed.
;MAC=deadbeef4 required
;MYVAR=someOTHER A user confdigured variable
; To have USERNAME and SECRET automatically set, the endpoint
; specified here must in turn have an outbound_auth section defined.
; Fuller example:
;type=endpoint
;outbound_auth=1000-auth
;callerid=My Name &&
;transport=transport-udp-nat
;[1000-auth]
;type=auth
;auth_type=userpass
;username=myname
;password=mysecret
;[phoneprov_defaults](!)
;type=phon must be specified as 'phoneprov'
;PROFILE=s required
;SERVER= A standard variable
;TIMEZONE=America/D A standard variable
;MYVAR=som A user configured variable
;[1000](phoneprov_defaults)
;endpoint=1000 Required only if automatic setting of
USERNAME, SECRET, DISPLAY_NAME and CALLERID
are needed.
;MAC=deadbeef4 required
;MYVAR=someUSER A user confdigured variable
;LABEL=1000 A standard variable
; The previous sections would produce a template substitution map as follows:
;MAC=deadbeef4added by pp1000
;USERNAME=myautomatically added by 1000-auth username
;SECRET=myseautomatically added by 1000-auth password
;PROFILE=somadded by defaults
;SERVER=added by defaults
;SERVER_PORT=5060added by defaults
;MYVAR=someUSERadded by defaults but overdidden by user
;CALLERID=automatically added by 1000 callerid
;DISPLAY_NAME=My Nautomatically added by 1000 callerid
;TIMEZONE=America/Dadded by defaults
;TZOFFSET=252100automatically calculated by res_phoneprov
;DST_ENABLE=1automatically calculated by res_phoneprov
;DST_START_MONTH=3automatically calculated by res_phoneprov
;DST_START_MDAY=9automatically calculated by res_phoneprov
;DST_START_HOUR=3automatically calculated by res_phoneprov
;DST_END_MONTH=11automatically calculated by res_phoneprov
;DST_END_MDAY=2automatically calculated by res_phoneprov
;DST_END_HOUR=1automatically calculated by res_phoneprov
;ENDPOINT_ID=1000automatically added by this module
;AUTH_ID=1000-automatically added by this module
;TRANSPORT_ID=transport-udp-automatically added by this module
;LABEL=1000 added by user
; MODULE PROVIDING BELOW SECTION(S): res_pjsip
;==========================ENDPOINT SECTION OPTIONS=========================
;[endpoint]
SYNOPSIS: Endpoint
;100rel= Allow support for RFC3262 provisional ACK tags (default:
;aggregate_mwi=
(default: "yes")
;allow= ; Media Codec s to allow (default: "")
;aors= AoR s to be used with the endpoint (default: "")
;auth= Authentication Object s associated with the endpoint (default: "")
;callerid= CallerID information for the endpoint (default: "")
;callerid_privacy=allowed_not_ Default privacy level (default: "allowed_not_screened")
;callerid_tag= Internal id_tag for the endpoint (default: "")
;context= Dialplan context for inbound sessions (default:
"default")
;direct_media_glare_mitigation= Mitigation of direct media re INVITE
glare (default: "none")
;direct_media_method= Direct Media method type (default: "invite")
;connected_line_method= Connected line method type (default:
;direct_media= Determines whether media may flow directly between
endpoints (default: "yes")
;disable_direct_media_on_nat= Disable direct media session refreshes when
NAT obstructs the media session (default:
;disallow= Media Codec s to disallow (default: "")
;dtmf_mode=rfc4733 DTMF mode (default: "rfc4733")
;media_address= IP address used in SDP for media handling (default: "")
;force_rport= Force use of return port (default: "yes")
;ice_support= Enable the ICE mechanism to help traverse NAT (default: "no")
;identify_by= Way s for Endpoint to be identified (default:
"username")
;redirect_method= How redirects received from an endpoint are handled
(default: "user")
;mailboxes= Mailbox es to be associated with (default: "")
;moh_suggest= Default Music On Hold class (default: "default")
;moh_passthrough= Pass Music On Hold through using SIP re-invites with sendonly
when placing on hold and sendrecv when taking off hold
;outbound_auth= ; Authentication object used for outbound requests (default:
;outbound_proxy= Proxy through which to send requests a full SIP URI
must be provided (default: "")
;rewrite_contact= Allow Contact header to be rewritten with the source
IP address port (default: "no")
;rtp_ipv6= Allow use of IPv6 for RTP traffic (default: "no")
;rtp_symmetric= Enforce that RTP must be symmetric (default: "no")
;send_diversion= Send the Diversion header conveying the diversion
information to the called user agent (default: "yes")
;send_pai= Send the P Asserted Identity header (default: "no")
;send_rpid= Send the Remote Party ID header (default: "no")
;rpid_immediate= Send connected line updates on unanswered incoming calls immediately. (default: "no")
;timers_min_se=90 Minimum session timers expiration period (default:
;timers= Session timers for SIP packets (default: "yes")
;timers_sess_expires=1800 Maximum session timer expiration period
(default: "1800")
;transport= Desired transport configuration (default: "")
;trust_id_inbound= Accept identification information received from this
endpoint (default: "no")
;trust_id_outbound= Send private identification details to the endpoint
(default: "no")
;type= Must be of type endpoint (default: "")
;use_ptime= Use Endpoint s requested packetisation interval (default:
;use_avpf= Determines whether res_pjsip will use and enforce usage of
AVPF for this endpoint (default: "no")
;media_encryption= Determines whether res_pjsip will use and enforce
usage of media encryption for this endpoint (default:
;media_encryption_optimistic= Use encryption if possible but don't fail the call
; if not possible.
;inband_progress= Determines whether chan_pjsip will indicate ringing
using inband progress (default: "no")
;call_group= The numeric pickup groups for a channel (default: "")
;pickup_group= The numeric pickup groups that a channel can pickup (default:
;named_call_group= The named pickup groups for a channel (default: "")
;named_pickup_group= The named pickup groups that a channel can pickup
(default: "")
;device_state_busy_at=0 ; The number of in use channels which will cause busy
to be returned as device state (default: "0")
;t38_udptl= Whether T 38 UDPTL support is enabled or not (default: "no")
;t38_udptl_ec= T 38 UDPTL error correction method (default: "none")
;t38_udptl_maxdatagram=0 T 38 UDPTL maximum datagram size (default:
;fax_detect= Whether CNG tone detection is enabled (default: "no")
;t38_udptl_nat= Whether NAT support is enabled on UDPTL sessions
(default: "no")
;t38_udptl_ipv6= Whether IPv6 is used for UDPTL Sessions (default:
;tone_zone= Set which country s indications to use for channels created
for this endpoint (default: "")
;language= Set the default language to use for channels created for this
endpoint (default: "")
;one_touch_recording= Determines whether one touch recording is allowed for
this endpoint (default: "no")
;record_on_feature= The feature to enact when one touch recording
is turned on (default: "automixmon")
;record_off_feature= The feature to enact when one touch recording
is turned off (default: "automixmon")
;rtp_engine= Name of the RTP engine to use for channels created
for this endpoint (default: "asterisk")
;allow_transfer= Determines whether SIP REFER transfers are allowed
for this endpoint (default: "yes")
;sdp_owner=- String placed as the username portion of an SDP origin o line
(default: "-")
;sdp_session=A String used for the SDP session s line (default:
"Asterisk")
;tos_audio=0 DSCP TOS bits for audio streams (default: "0")
;tos_video=0 DSCP TOS bits for video streams (default: "0")
;cos_audio=0 Priority for audio streams (default: "0")
;cos_video=0 Priority for video streams (default: "0")
;allow_subscribe= Determines if endpoint is allowed to initiate
subscriptions with Asterisk (default: "yes")
;sub_min_expiry=0 The minimum allowed expiry time for subscriptions
initiated by the endpoint (default: "0")
;from_user= Username to use in From header for requests to this endpoint
(default: "")
;mwi_from_user= ; Username to use in From header for unsolicited MWI NOTIFYs to
this endpoint (default: "")
;from_domain= Domain to user in From header for requests to this endpoint
(default: "")
;dtls_verify= Verify that the provided peer certificate is valid (default:
;dtls_rekey=0 Interval at which to renegotiate the TLS session and rekey
the SRTP session (default: "0")
;dtls_cert_file= Path to certificate file to present to peer (default:
;dtls_private_key= Path to private key for certificate file (default:
;dtls_cipher= Cipher to use for DTLS negotiation (default: "")
;dtls_ca_file= Path to certificate authority certificate (default: "")
;dtls_ca_path= Path to a directory containing certificate authority
certificates (default: "")
;dtls_setup= Whether we are willing to accept connections connect to the
other party or both (default: "")
;dtls_fingerprint= ; Hash to use for the fingerprint placed into SDP
(default: "SHA-256")
;srtp_tag_32= Determines whether 32 byte tags should be used instead of 80
byte tags (default: "no")
;set_var= Variable set on a channel involving the endpoint. For multiple
; channel variables specify multiple 'set_var'(s)
;==========================AUTH SECTION OPTIONS=========================
SYNOPSIS: Authentication type
;auth_type= Authentication type (default: "userpass")
;nonce_lifetime=32 Lifetime of a nonce associated with this
authentication config (default: "32")
;md5_cred= MD5 Hash used for authentication (default: "")
;password= PlainText password used for authentication (default: "")
;realm= ; SIP realm for endpoint (default: "")
;type= Must be auth (default: "")
;username= Username to use for account (default: "")
;==========================DOMAIN_ALIAS SECTION OPTIONS=========================
;[domain_alias]
SYNOPSIS: Domain Alias
;type= Must be of type domain_alias (default: "")
;domain= Domain to be aliased (default: "")
;==========================TRANSPORT SECTION OPTIONS=========================
;[transport]
SYNOPSIS: SIP Transport
;async_operations=1 Number of simultaneous Asynchronous Operations
(default: "1")
;bind= IP Address and optional port to bind to for this transport (default:
;ca_list_file= File containing a list of certificates to read TLS ONLY
(default: "")
;ca_list_path= Path to directory containing certificates to read TLS ONLY.
PJProject version 2.4 or higher is required for this option to
; be used.
(default: "")
;cert_file= Certificate file for endpoint TLS ONLY
Will read .crt or .pem file but only uses cert,
a .key file must be specified via priv_key_file
(default: "")
;cipher= Preferred cryptography cipher names TLS ONLY (default: "")
;domain= Domain the transport comes from (default: "")
;external_media_address= External IP address to use in RTP handling
(default: "")
;external_signaling_address= External address for SIP signalling (default:
;external_signaling_port=0 External port for SIP signalling (default:
;method= Method of SSL transport TLS ONLY (default: "")
;local_net= Network to consider local used for NAT purposes (default: "")
;password= Password required for transport (default: "")
;priv_key_file= ; Private key file TLS ONLY (default: "")
;protocol= Protocol to use for SIP traffic (default: "udp")
;require_client_cert= Require client certificate TLS ONLY (default: "")
;type= Must be of type transport (default: "")
;verify_client= ; Require verification of client certificate TLS ONLY (default:
;verify_server= ; Require verification of server certificate TLS ONLY (default:
;tos=0 Enable TOS for the signalling sent over this transport (default: "0")
;cos=0 Enable COS for the signalling sent over this transport (default: "0")
;websocket_write_timeout=100 Default write timeout to set on websocket
transports. This value may need to be adjusted
for connections where Asterisk must write a
substantial amount of data and the receiving
clients are slow to process the received
information. Valu default
is 100 ms.
;==========================AOR SECTION OPTIONS=========================
SYNOPSIS: The configuration for a location of an endpoint
;contact= Permanent contacts assigned to AoR (default: "")
;default_expiration=3600 Default expiration time in seconds for
contacts that are dynamically bound to an AoR
(default: "3600")
;mailboxes= Mailbox es to be associated with (default: "")
;maximum_expiration=7200 Maximum time to keep an AoR (default: "7200")
;max_contacts=0 ; Maximum number of contacts that can bind to an AoR (default:
;minimum_expiration=60 Minimum keep alive time for an AoR (default: "60")
;remove_existing= Determines whether new contacts replace existing ones
(default: "no")
;type= Must be of type aor (default: "")
;qualify_frequency=0 Interval at which to qualify an AoR (default: "0")
;authenticate_qualify= Authenticates a qualify request if needed
(default: "no")
;outbound_proxy= Outbound proxy used when sending OPTIONS request
(default: "")
;==========================SYSTEM SECTION OPTIONS=========================
SYNOPSIS: Options that apply to the SIP stack as well as other system-wide settings
;timer_t1=500 Set transaction timer T1 value milliseconds (default: "500")
;timer_b=32000 Set transaction timer B value milliseconds (default: "32000")
;compact_headers= Use the short forms of common SIP header names
(default: "no")
;threadpool_initial_size=0 Initial number of threads in the res_pjsip
threadpool (default: "0")
;threadpool_auto_increment=5 The amount by which the number of threads is
incremented when necessary (default: "5")
;threadpool_idle_timeout=60 Number of seconds before an idle thread
should be disposed of (default: "60")
;threadpool_max_size=0 Maximum number of threads in the res_pjsip threadpool
A value of 0 indicates no maximum (default: "0")
;disable_tcp_switch= Disable automatic switching from UDP to TCP transports
if outgoing request is too large.
See RFC 3261 section 18.1.1.
; Disabling this option has been known to cause interoperability
; issues, so disable at your own risk.
(default: "yes")
;type= Must be of type system (default: "")
;==========================GLOBAL SECTION OPTIONS=========================
SYNOPSIS: Options that apply globally to all SIP communications
;max_forwards=70 Value used in Max Forwards header for SIP requests
(default: "70")
;type= Must be of type global (default: "")
;user_agent=Asterisk PBX SVN-branch-12-r404375 Value used in User Agent
header for SIP requests and
Server header for SIP
responses (default: "Asterisk
PBX SVN-branch-12-r404375")
;default_outbound_endpoint=default_outbound_ Endpoint to use when
sending an outbound
request to a URI
without a specified
endpoint (default: "d
efault_outbound_endpo
;debug= Enable/Disable SIP debug logging.
Valid options include yes|no
or a host address (default: "no")
;keep_alive_interval=20 ; The interval (in seconds) at which to send keepalive
messages on all active connection-oriented transports
(default: "0")
;endpoint_identifier_order=ip,username,anonymous
The order by which endpoint identifiers are given priority.
Identifier names are derived from res_pjsip_endpoint_identifier_*
modules. (default: ip,username,anonymous)
; MODULE PROVIDING BELOW SECTION(S): res_pjsip_acl
;==========================ACL SECTION OPTIONS=========================
SYNOPSIS: Access Control List
;acl= List of IP ACL section names in acl conf (default: "")
;contact_acl= List of Contact ACL section names in acl conf (default: "")
;contact_deny= List of Contact header addresses to deny (default: "")
;contact_permit= List of Contact header addresses to permit (default:
;deny= List of IP addresses to deny access from (default: "")
;permit= List of IP addresses to permit access from (default: "")
;type= Must be of type acl (default: "")
; MODULE PROVIDING BELOW SECTION(S): res_pjsip_outbound_registration
;==========================REGISTRATION SECTION OPTIONS=========================
;[registration]
SYNOPSIS: The configuration for outbound registration
;auth_rejection_permanent= Determines whether failed authentication
challenges are treated as permanent failures
(default: "yes")
;client_uri= Client SIP URI used when attemping outbound registration
(default: "")
;contact_user= Contact User to use in request (default: "")
;expiration=3600 Expiration time for registrations in seconds
(default: "3600")
;max_retries=10 ; Maximum number of registration attempts (default: "10")
;outbound_auth= ; Authentication object to be used for outbound registrations
(default: "")
;outbound_proxy= Outbound Proxy used to send registrations (default:
;retry_interval=60 Interval in seconds between retries if outbound
registration is unsuccessful (default: "60")
;forbidden_retry_interval=0 Interval used when receiving a 403 Forbidden
response (default: "0")
;server_uri= SIP URI of the server to register against (default: "")
;transport= Transport used for outbound authentication (default: "")
;type= Must be of type registration (default: "")
; MODULE PROVIDING BELOW SECTION(S): res_pjsip_endpoint_identifier_ip
;==========================IDENTIFY SECTION OPTIONS=========================
;[identify]
SYNOPSIS: Identifies endpoints via source IP address
;endpoint= Name of Endpoint (default: "")
;match= ; IP addresses or networks to match against (default: "")
;type= Must be of type identify (default: "")
;========================PHONEPROV_USER SECTION OPTIONS=======================
;[phoneprov]
SYNOPSIS: Contains variables for autoprovisioning each user
;endpoint= The endpoint from which to gather username, secret, etc. (default: "")
;PROFILE= The name of a profile configured in phoneprov.conf (default: "")
;MAC= The mac address for this user (default: "")
;OTHERVAR= Any other name value pair to be used in templates (default: "")
Common variables include LINE, LINEKEYS, etc.
See phoneprov.conf.sample for others.
;type= Must be of type phoneprov (default: "")
Generated on Thu Apr 16 06:34:43 2015 for Asterisk - The Open Source Telephony Project by&

我要回帖

更多关于 判断mysql数据表变化 的文章

 

随机推荐