Module: sip-router
Branch: master
Commit: 5c00f5c2987b9cbdae7734db89019f6ef1d3f815
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=5c00f5c…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Wed Jun 24 23:55:16 2009 +0200
makefile: MAIN_NAME reverted
MAIN_NAME reverted to ser (should be changed _only_ when we agree
on the short name).
---
Makefile.defs | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Makefile.defs b/Makefile.defs
index 688eaa1..f262f43 100644
--- a/Makefile.defs
+++ b/Makefile.defs
@@ -100,7 +100,7 @@ export makefile_defs
$(info normal Makefile.defs exec)
# main binary name
-MAIN_NAME=sip-router
+MAIN_NAME=ser
#prefix for various configs and scripts
#config name/name-prefix for distributed configs
CFG_NAME=sip-router
On 06/25/2009 11:31 AM, Iñaki Baz Castillo wrote:
> El Jueves, 25 de Junio de 2009, Daniel-Constantin Mierla escribió:
>
>> Hello,
>>
>> several days ago I committed support for accessing components of xml
>> documents using pseudo-variables based on XPath syntax. The new
>> $xml(...) PV is implemented in the presence_xml module as it works with
>> xml docs and links libxml2.
>>
>> Short description in the cookbook:
>> https://sip-router.org/wiki/cookbooks/pseudo-variables/devel#presence_xml_p
>> seudo-variables
>>
>> As an example:
>> - publish has the body:
>>
>> <?xml version='1.0' encoding='UTF-8'?>
>> <presence xmlns='urn:ietf:params:xml:ns:pidf'
>> xmlns:dm='urn:ietf:params:xml:ns:pidf:data-model'
>> xmlns:rpid='urn:ietf:params:xml:ns:pidf:rpid'
>> xmlns:c='urn:ietf:params:xml:ns:pidf:cipid' entity='sip:daniel@asipto.com'>
>> <tuple id='t8b484917'>
>> <status><basic>open</basic></status>
>> </tuple>
>> <dm:person
>> id='p7562ef60'><rpid:activities><rpid:unknown/></rpid:activities></dm:perso
>> n> </presence>
>>
>> Getting the presence status:
>>
>> # this is needed because libxml2 cannot work with default no-prefix ns,
>> so we alias the "p" prefix.
>> modparam("presence_xml", "xml_ns", "p=urn:ietf:params:xml:ns:pidf")
>>
>> $xml(a=>doc) = $rb;
>> $xml(a=>xpath:/p:presence/p:tuple/p:status/p:basic)
>>
>> Next is to update the presence modules to be able to work with the
>> documents that have been updated in the config.
>>
>> Comments, opinions and improvements are welcome!
>>
>
> This is more than great!
>
> It would make possible exotic routing decissions based on presence status...
>
... or based on other content of the xml doc -- you may have there geo
positions and send it to the appropriate server.
> or perhaps not yet? I understand that this makes possible to extract XML nodes
> when processing a request, but would it be possible to extract them from the
> "presentity" table?
>
Yes, if you load it you can do it. For example, next piece of config is
valid as well:
$xml(a=>doc) = '<?xml version="1.0" encoding="UTF-8"?><presence
entity="abc"><mynode>abc</mynode></presence>';
xlog("$xml(a=>xpath:/presence/mynode)\n");
Probably not very clear in my first email, but you can change the xml
content:
$xml(a=>xpath:/presence/mynode) = "123";
Note that if you assigned the sip message body to $xml(name=>doc), body
does not get changed, the operations are done on a replica.
Cheers,
Daniel
> A simpler approach for what I mean would be having a mini API to get presence
> basic status (some module that connects to DB with "presentity" table):
>
> if ( is_presence_basic_status_open($ru) ) {
> ...route the MESSAGE...
> }
>
> XD
>
>
>
--
Daniel-Constantin Mierla
http://www.asipto.com/
HI all
i follow the instruction http://sip-router.org/wiki/migration/kamailio-3.0-config
but when i compile but get the error
[root@Vigor35 sip-router]# make all
config.mak loaded
Makefile.defs defs skipped
gcc -g -O9 -funroll-loops -Wcast-align -minline-all-stringops -falign-loops -ftree-vectorize -mtune=athlon64 -Wall   -DNAME='"ser"' -DVERSION='"2.1.0-dev23-make"' -DARCH='"i386"' -DOS='linux_' -DOS_QUOTED='"linux"' -DCOMPILER='"gcc 4.1.2"' -D__CPU_i386 -D__OS_linux -DSER_VER=2001000 -DCFG_DIR='"/usr/local/etc/ser/"' -DPKG_MALLOC -DSHM_MEM -DSHM_MMAP -DDNS_IP_HACK -DUSE_IPV6 -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES -DUSE_DNS_CACHE -DUSE_DNS_FAILOVER -DUSE_DST_BLACKLIST -DUSE_NAPTR -DDBG_QM_MALLOC -DUSE_TLS -DTLS_HOOKS -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 -DCC_GCC_LIKE_ASM -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM -DHAVE_SCHED_SETSCHEDULER -DHAVE_EPOLL -DHAVE_SIGIO_RT -DSIGINFO64_WORKARROUND -DUSE_FUTEX -DHAVE_SELECT  -c action.c -o action.o
In file included from parser/../mem/../futexlock.h:52,
                from parser/../mem/../lock_ops.h:85,
                from parser/../mem/shm_mem.h:76,
                from parser/../ut.h:67,
                from parser/../ip_addr.h:49,
                from parser/msg_parser.h:57,
                from select.h:38,
                from route_struct.h:47,
                from action.h:35,
                from action.c:58:
/usr/include/linux/futex.h:108: error: expected â)â before â*â token
/usr/include/linux/futex.h:112: error: expected â)â before â*â token
make: *** [action.o] Error 1
Hello,
several days ago I committed support for accessing components of xml
documents using pseudo-variables based on XPath syntax. The new
$xml(...) PV is implemented in the presence_xml module as it works with
xml docs and links libxml2.
Short description in the cookbook:
https://sip-router.org/wiki/cookbooks/pseudo-variables/devel#presence_xml_p…
As an example:
- publish has the body:
<?xml version='1.0' encoding='UTF-8'?>
<presence xmlns='urn:ietf:params:xml:ns:pidf'
xmlns:dm='urn:ietf:params:xml:ns:pidf:data-model'
xmlns:rpid='urn:ietf:params:xml:ns:pidf:rpid'
xmlns:c='urn:ietf:params:xml:ns:pidf:cipid' entity='sip:daniel@asipto.com'>
<tuple id='t8b484917'>
<status><basic>open</basic></status>
</tuple>
<dm:person
id='p7562ef60'><rpid:activities><rpid:unknown/></rpid:activities></dm:person>
</presence>
Getting the presence status:
# this is needed because libxml2 cannot work with default no-prefix ns,
so we alias the "p" prefix.
modparam("presence_xml", "xml_ns", "p=urn:ietf:params:xml:ns:pidf")
$xml(a=>doc) = $rb;
$xml(a=>xpath:/p:presence/p:tuple/p:status/p:basic)
Next is to update the presence modules to be able to work with the
documents that have been updated in the config.
Comments, opinions and improvements are welcome!
Cheers,
Daniel
--
Daniel-Constantin Mierla
http://www.asipto.com/