### Description
When trying to use the pseudovar $dns(xyz=>addr[0]) Kamailio script parser complains there is a syntax error and script won't start. However if a variable with value 0 is used, it works.
There is no reason why one should not access those indexes directly using the value 0.
Piece of code that does not work:
```
if(dns_query("$rd", "ddst")) {
$var(dest_ip) = $dns(ddst=>addr[0]); # We just need first IP
}
```
Piece of code that works:
```
if(dns_query("$rd", "ddst")) {
$…
[View More]var(i) = 0;
$var(dest_ip) = $dns(ddst=>addr[$var(i)]); # We just need first IP
}
```
I tried using the 0 with quotes, but no luck. I had to use a variable to access the index 0.
I have not tried the "type" attribute, maybe same problem can happen with it.
#### Reproduction
Try adding this piece of code to the script:
```
if(dns_query("$rd", "ddst")) {
$var(dest_ip) = $dns(ddst=>addr[0]); # We just need first IP
}
```
This will output this error when running kamailio -c:
```
0(22439) ERROR: ipops [ipops_pv.c:249]: pv_parse_dns_name(): invalid index [ddst=>addr[0]]
0(22439) ERROR: ipops [ipops_pv.c:261]: pv_parse_dns_name(): error at PV dns name: ddst=>addr[0]
0(22439) ERROR: <core> [core/pvapi.c:952]: pv_parse_spec2(): pvar "dns" has an invalid name param [ddst=>addr[0]]
0(22439) ERROR: <core> [core/pvapi.c:1107]: pv_parse_spec2(): wrong char [)/41] in [$dns(ddst=>addr[0])] at [18 (5)]
0(22439) CRITICAL: <core> [core/cfg.y:3508]: yyerror_at(): parse error in config file /etc/kamailio/routing.cfg, line 2398, column 20-38: Can't get from cache: $dns(ddst=>addr[0])
```
### Possible Solutions
Instead of direct index access with integer values, it is necessary to access it with a variable.
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
# kamailio -v
version: kamailio 5.2.2 (x86_64/linux) 67f967
flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144 MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: 67f967
compiled on 11:40:41 Mar 11 2019 with gcc 4.8.5
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2179
[View Less]
# Description
I want proxy MSRP messages via Kamailio.
To get it working for SIP calls (not WebRTC) need alter SDP `m=message` media connection information:
1. set IP address to Kamailio TLS socket;
1. set port to Kamailio TLS socket.
At preset time I cannot find way to do it.
Could you add function like `msrp_manage` (like `rtpengine_manage`) that update SDP (request and answer) to allow proxy MSRP session via Kamailio socket.
--
You are receiving this because you are subscribed to this …
[View More]thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2186
[View Less]
<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, …
[View More]tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [x] Commit message has the format required by CONTRIBUTING guide
- [x] Commits are split per component (core, individual modules, libs, utils, ...)
- [x] Each component has a single commit (if not, squash them into one commit)
- [x] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [ ] PR should be backported to stable branches
- [x] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
added add/del/get/flush rpc commands
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2177
-- Commit Summary --
* keepalive : added keepalive.add rpc command
* keepalive : added keepalive.del rpc command
* keepalive : added keepalive.get and keepalive.flush rpc commands
-- File Changes --
M src/modules/keepalive/keepalive_rpc.c (147)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2177.patchhttps://github.com/kamailio/kamailio/pull/2177.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/2177
[View Less]