I have decided to do Hunting DIY. I needed some help with the cfg script part and using a database dip.
Say I do the db dip
sql_xquery("ca", "call usp_GetHuntBranches( '$rU', '$rd');", "ra");that will return the uri/q pairs and I will add using append_branch dynamically.
How do I do the looping in the script?
I have 2 ways to deliver the list via the sp.
- Rows with uri and q values. easiest
- Single row with variable paired fields like say ur1,q1,ur2,q2 etc etc
Questions :
- Can the script handle sql_xquery with multiple rows. If so, can I get a code snippet or example that show me how to iterate through. Is there a "while" loop capability in the script?
- Is there a "substring" or "split" function in the script that could allow me to get the data as a single text with uri and q separated by a \ or |.
- Or is there a document that explains the various generic functions I can use the cfg script area.
KD
Hi All,
We are looking to enable nathelpers keepalive timeout parameter where it
will remove an aor's contact if it doesn't receive a reply from the ua.
The problem we have is that our registrar's are seperated from our
proxies, so this means nathelper is sending options messages via the
proxy to the ua. In this case, if the us has lost connectivity, the
kamailio proxy sends a 408 Request Timeout back to the registrar and the
nathelper module sees that as a response to the initial options message
it sends, so it never actually removes the contact from the location table.
Is there a way I can stop the proxy from sending any responses for these
specific nat ping/options messages, or, is there a way I can tell the
nathelper modules that a 408 response should be treated as the ua being
down and then after the timeout interval remove the contact from the
location table?
I've had a read of the nathelper, tm and sl modules but I didnt see
anything that jumps out at me that I could achieve one or the other
possible solutions I mentioned above.
Does anyone have any suggestions or pointers on how we can achieve this
with the registrars being seperate from the edge proxies.
Any pointrs/tips etc would be greatly appreciated.
Thanks
I am tackling Hunting and see that there are two functions recommended to accomplish this. Before I jump into using them I wanted to know a bit about each regard to the call flow.
>From where does t_load_contacts() load contacts and how does it order then in case of a serial fork flow,
Is there a generic way of doing it say with a loop in the script. Docs on these two functions are a bit cryptic for me
H
My scenario is
UA <====> Kamailio <====> Freeswitch
UA calls a number. Kam delivers to FS and FS plays a wav file.
My problem is that Kam relays the 200 OK from FS back to UA without change and UA ACKs back to FS because the FS IP is in the Contact Header.
- Why does Kam not change the contact header since the ACK should come back to Kam
- If this is normal what do I need to do to change the contact header for the 200K to the UA to make this work.
KD
Hello
I have a call with not passed ACK by Kamailio. http://prntscr.com/jhtobo
Same behaviour i looked before when SIP endpoint contact string is wrong
In this call look as contact string correct is correct (packets 7 and 8)
and i not understand why ACK (packet 9) not passed to callee.
Could you help me understand this.
PCAP file is create using homer tracer and TCP transport packets is stored
as UDP.
Sergey
Not sure if it's a default Kamailio behavior or something I'm doing wrong...
When receiving a negative reply for an INVITE (more like in the 5xx range),
proxy doesn't relay the message to the originator but instead issues it's
own "500 Service Unavailable".
That doesn't happen, from observations so far, to "603 Declined" or "486
Busy Here" or "404 Not Found" or "200 OK" replies.
*For example, here's the negative reply proxy receives from the callee:*
2018/05/14 10:52:37.716627 65.XX.XX.166:5060 -> 65.XX.XX.167:5060
SIP/2.0 503 Service Unavailable
Via: SIP/2.0/UDP
65.xx.xx.167;branch=z9hG4bK9223.00b4f3143d245a895c4bb6a107add258.0;received=65.xx.xx.167;rport=5060
Via: SIP/2.0/UDP
205.xx.xx.221;received=205.xx.xx.221;rport=5060;branch=z9hG4bKQ4XpXga0vgZ8B
From: "514XXXXXXX" <sip: 514XXXXXXX @205.xx.xx.221>;tag=tXj0NHrje9jNS
To: <sip:450XXXXXXX@65.xx.xx.167>;tag=as18e452b7
Call-ID: 48eac296-d229-1236-a685-005056a149a4
CSeq: 122818714 INVITE
Server: Asterisk
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO,
PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
X-Asterisk-HangupCause: Subscriber absent
X-Asterisk-HangupCauseCode: 20
Content-Length: 0
*Here's what the originator gets in the final message:*
2018/05/14 10:52:37.718143 65.xx.xx.167:5060 -> 205.xx.xx.221:5060
SIP/2.0 500 Service Unavailable
Via: SIP/2.0/UDP
205.xx.xx.221;rport=5060;branch=z9hG4bKQ4XpXga0vgZ8B;received=205.xx.xx.221
From: "514XXXXXXX" <sip:514XXXXXXX@205.xx.xx.221>;tag=tXj0NHrje9jNS
To: <sip:450XXXXXXX@65.xx.xx.167>;tag=31a2c69b5d434ef4a60796e26f568bf0-9343
Call-ID: 48eac296-d229-1236-a685-005056a149a4
CSeq: 122818714 INVITE
Server: Kamailio 5.1
Content-Length: 0
I'd like any reply to be relayed back as is, unless I do some
t_check_status() => t_reply() for specific reasons (which I have none at
this point).
Thanks
Sergiu
Hi to all,
I have some troubles with acc_db module and acc_cdrs table.
First scenario:
Alice calls Bob and after a while, when a call is established, Alice hangs up, sending a BYE. The acc_cdrs table is filled up with the right data:
* src_user, src_domain, src_ip are from Alice account (the caller)
* dst_user etc etc are from Bob account (the callee)
In this scenario all works as expected: the src data are from who starts the call, and the dst data are from who receives the call.
In the following scenario src and dst data are inverted.
Alice calls Bob and after a while, when a call is established, Bob hangs up, sending a BYE. The acc_cdrs table now is:
* src_user, src_domain, src_ip are from Bob account (the callee that sends the BYE message)
* dst_user etc etc are from Alice account (the caller that receives the BYE)
This is the intended behavior or I’m missing something? How I can record the CDR data with the right CALLER and CALLEE data ?
Emanuele
Hey there,
I am currently using the UAC module to maintain remote registrations. I am just curious if it is possible to register new users immediately rather than waiting for reg_timer_interval? I am not seeing any functionality like that but just wondering if I am missing something or if it would be possible to add in. For example an RPC command that takes a key and instantly registers that user.
Thanks,
Greg
I am trying to simulate a Broadsoft feature that blips the extension with a single ring that basically heralds the user that their extension has CF turned on. I know parallel forking can do that. But how do I set the fr timer on the call to the extension @ just 1 ring (5 seconds) and let the other one the default timeout set in fr_inv_timer.
KD