> Oops. No, it’s not a bug, it’s just that the URI isn’t the only value present in $ct.
>
> Try $(ct{nameaddr.uri}{uri.host})
Yup, that fixed it. Thanks again!
I have another question about how I’m applying these to some routing logic but I’ll start a new thread for that in a bit.
HI!
Seems to be, http_async client is not compatible with http2 servers.
I'm having like
kamailio_1 | 15(20) INFO: http_async_client [http_multi.c:238]:
debug_cb(): [cURL] Connection #0 to host relay-api.pbxservice.com left
intact
kamailio_1 | 15(20) ERROR: <core> [core/parser/parse_fline.c:264]:
parse_first_line(): parse_first_line: bad message (offset: 11)
kamailio_1 | 15(20) ERROR: <core> [core/parser/msg_parser.c:681]:
parse_msg(): ERROR: parse_msg: message=<HTTP/2 404
kamailio_1 | date: Thu, 14 Nov 2019 18:31:34 GMT
....
kamailio_1 | 15(20) ERROR: <core> [core/parser/msg_parser.c:337]:
parse_headers(): bad header field [(null)]
kamailio_1 | 15(20) ERROR: <core> [core/parser/msg_parser.c:1274]:
get_body(): failed to parse to end of headers
But plain http_client worked good (not async for sure)
kamailio 5.3.0
--
Best regards,
Igor
Greetings,
I'm trying to parse some URI info on Kamailio but i'm having some troubles
the URI transformations.
Here i have two examples of URIS from which i'm trying to extract
username(with user parameters included) and URI Parameters :
- sip:123456789;test=param@1.1.1.1
- sip:123456789;test=param@1.1.1.1;user=phone
In order to test this i made the following code :
$var(URI) = "sip:123456789;test=param@1.1.1.1";
xerr("DEBUG 1 : URI $var(URI)");
$var(User) = $(var(URI){uri.user});
$var(Parameters) = $(var(URI){uri.params});
xerr("DEBUG 1 : User = $var(User)");
xerr("DEBUG 1 : Parameters = $var(Parameters)");
$var(URI) = "sip:123456789;test=param@1.1.1.1;user=phone";
xerr("DEBUG 2 : URI $var(URI)"); ;
$var(User) = $(var(URI){uri.user});
$var(Parameters) = $(var(URI){uri.params});
xerr("DEBUG 2 : User = $var(User)");
xerr("DEBUG 2 : Parameters = $var(Parameters)");
The result is the following :
DEBUG 1 : URI sip:123456789;test=param@1.1.1.1
DEBUG 1 : User = 123456789;test=param
DEBUG 1 : Parameters =
DEBUG 2 : URI sip:123456789;test=param@1.1.1.1;user=phone
DEBUG 2 : User = 123456789
DEBUG 2 : Parameters = user=phone
If the URI has parameters, the User parameters won't be included in the
User part.
Is this a bug or is it working as intended? I'm running Kamailio 5.2.0 .
Thank you for your time.
Best Regards,
Duarte Rocha
Hello everyone,
I have a potentially silly beginners question: how can I parse the contact port field and act on it in my routing logic?
I know that the $ct variable contains the entire contact header and I can print it in an xlog() call. However, I’d like to do something like the following in my routing logic:
. . . SIP CONTENT
Contact: <sip:someaccount@192.168.86.104:5062>;expires=1800
. . . CONFIG LOGIC
#!define PORT_SERVICE1 5061
#!define PORT_SERVICE2 5062
route {
if ( src_port == PORT_SERVICE1 ) {
xlog(“L_INFO”, “Received $rm from SERVICE1\n”);
} else if ( src_port == PORT_SERVICE2 ) {
xlog(“L_INFO”, “Received $rm from SERVICE2\n”);
}
}
I realize that src_port is not the correct value to compare against. I want to compare against the originating contact’s port value.
How can I extract the port field from $ct?
Many thanks in advance and apologies for the beginners question. I’ve googled for what I think I’m trying to do without any real results on functions or tokenizers, etc. I’m using Kamailio 5.3.0.
Regards,
-Michael
I am using kamailio 5.3.
Ovidiu Sas, i will try this tomorrow today is bit late. Maybe it could work.
David Villasmil , i know i can use SQLOPS but i was thinking of easier
method of doing this.
By successful REGISTER i mean save only REGISTER attempt that authenticated
correctly at SIP server and in 200 OK a binding was returned.
Same if the binding is later removed i would like remove it from database.
I need this because when i run REGISTER over kamailio to destination SIP
server i see all register from same IP.
I need to be able to check what was the real source IP of client REGISTER.
Regards,
Tomasz
pt., 15 lis 2019 o 00:16 Mike from ApoloCore <mike(a)apolocore.com>
napisał(a):
> I am using kamailio 5.3.
>
> Ovidiu Sas, i will try this tomorrow today is bit late. Maybe it could
> work.
>
> David Villasmil , i know i can use SQLOPS but i was thinking of easier
> method of doing this.
> By successful REGISTER i mean save only REGISTER attempt that
> authenticated correctly at SIP server and in 200 OK a binding was returned.
> Same if the binding is later removed i would like remove it from database.
> I need this because when i run REGISTER over kamailio to destination SIP
> server i see all register from same IP.
> I need to be able to check what was the real source IP of client REGISTER.
>
> Regards,
> Tomasz
>
>
> czw., 14 lis 2019 o 23:33 Ovidiu Sas <osas(a)voipembedded.com> napisał(a):
>
>> Try to use save() when you process the 200 ok reply for REGISTER in
>> the reply route.
>>
>> Regards,
>> Ovidiu Sas
>>
>> On Thu, Nov 14, 2019 at 3:40 PM Voip support <voipexpert0(a)gmail.com>
>> wrote:
>> >
>> > I setup kamailio to forward REGISTER packets using dispatcher to two
>> servers main and backup.
>> >
>> > The routing logic is quite simple i use the dispatcher probing
>> mechanism to detect if my main dispatcher set id (one server) is active or
>> inactive once it detect a failure all packets are sent to secondary SIP
>> server to achieve High Availability.
>> >
>> > I am looking for module or a way to save into kamailio database client
>> information such as IP address, register username (from FROM header),
>> digest username (authorization username), call-id for successful
>> registration.
>> >
>> > I tried to use registrar module but once i used function
>> save("location") the client was registered on kamailio and packets was not
>> forwarded to main/secondary SIP server (like dispatcher stopped working,
>> the destination did not override).
>> >
>> > REGISTER is sent to SIP URI of kamailio.
>> >
>> > Please let me know if you have any idea how to make this data update in
>> database (insert an entry on fresh successfull REGISTER, delete on expired
>> or removed binding).
>> >
>> > Best regards,
>> > Tomasz
>> >
>> > _______________________________________________
>> > Kamailio (SER) - Users Mailing List
>> > sr-users(a)lists.kamailio.org
>> > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>>
>> --
>> VoIP Embedded, Inc.
>> http://www.voipembedded.com
>>
>> _______________________________________________
>> Kamailio (SER) - Users Mailing List
>> sr-users(a)lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>
I setup kamailio to forward REGISTER packets using dispatcher to two
servers main and backup.
The routing logic is quite simple i use the dispatcher probing mechanism to
detect if my main dispatcher set id (one server) is active or inactive once
it detect a failure all packets are sent to secondary SIP server to achieve
High Availability.
I am looking for module or a way to save into kamailio database client
information such as IP address, register username (from FROM header),
digest username (authorization username), call-id for
successful registration.
I tried to use registrar module but once i used function save("location")
the client was registered on kamailio and packets was not forwarded to
main/secondary SIP server (like dispatcher stopped working, the destination
did not override).
REGISTER is sent to SIP URI of kamailio.
Please let me know if you have any idea how to make this data update in
database (insert an entry on fresh successfull REGISTER, delete on expired
or removed binding).
Best regards,
Tomasz
Hi,
I have multiple Kamailio instances using dispatcher using alg “7” - hash
over the content of PVs string, both using the same dispatcher list.
Is it reasonable to expect both Kamailio, given the same hash_pvar, to
select the same host from the same set?
Looking at the source I do not see any reason why not, but I am getting
different results from the two Kamailio servers. The only difference
between them is different minor version numbers - 4.3.4 and 4.3.7
I want to ensure that calls with the same hash_pvar value go to the same
backend no matter which Kamailio processes the request.
Thanks!
-Barry Flanagan
Yep
version_table
Set the name of the table holding the table version. Useful if the
proxy is sharing a database within a project and during upgrades.
Default value is “version”.
Example of usage:
version_table="version44"
That's what I was looking for, perfect!
Yes, I added accountcode and notes to my table for internal use, was
just making notes on columns I need on the new version upgrade.
Thanks.
JR
On Tue, Jun 18, 2019 at 2:17 PM Daniel-Constantin Mierla
<miconda(a)gmail.com> wrote:
>
> Hello,
>
> like Alex said, you can have two version tables, one for each versions
> of kamailio you play with and use in config the core parameter to set
> the name of that table.
>
> I am actually writing to say that address table never had accountcode
> and notes columns. Likely they were added in your deployment for other
> purposes or either the default column names were changed. The default
> column names are listed at:
>
> -
> https://kamailio.org/docs/db-tables/kamailio-db-5.2.x.html#gen-db-address
>
> These were the same for rather long time, iirc the recent version number
> changed mainly due to with modifications done to the size, not due to
> new columns.
>
> Cheers,
> Daniel
>
> On 18.06.19 20:50, JR Richardson wrote:
> > Hey All,
> >
> > I'm doing some upgrades and noticed database table version numbers
> > have increased.
> >
> > database table adjustments:
> > | address | production ver 3 | upgrade 5.2 ver 6 | need to add
> > accountcode and notes column
> > | dispatcher | production ver 3 | upgrade 5.2 ver 4 | need to add attr column
> > | trusted | production ver 5 | upgrade 5.2 ver 6 | need to add
> > ruri_pattern and priority column
> >
> > I run mysql master/slave so I'm concerned about the master database
> > not having the correct version numbers or can I just update the
> > version number in the table when I do the upgrade of the kamailio
> > versions?
> >
> > Thanks.
> >
> > JR
I am troubleshooting intermittent latency on a server, several processes
will report slow action at the same time every now and then,
something odd it that some of the actions are most likely not using any
mutexes, I can not imagine how they can end up blocking unless the process
is actually suspended by the OS, however the CPU usage and load average is
quite low on this server.
Is there any reason why assigning to a PKG var could be delayed 3 seconds.
2019-11-13T21:58:04.018631614Z 23(42) WARNING: <core> [core/action.c:1586]:
run_actions(): alert - action [corefunc (16)] cfg
[/etc/kamailio/kamailio.cfg:115] took too long [2579486 us]
$var(reply) = 0; // I wonder how this can endup blocking ?
2019-11-13T21:58:04.018748710Z 42(61) WARNING: <core> [core/action.c:1586]:
run_actions(): alert - action [corefunc (16)] cfg
[/etc/kamailio/kamailio.cfg:221] took too long [2222010 us]
} // Samething here, simply exiting a scope
2019-11-13T21:58:04.015675095Z 11(30) WARNING: <core> [core/action.c:1586]:
run_actions(): alert - action [t_relay_cancel (24)] cfg
[/etc/kamailio/kamailio.cfg:86] took too long [2588818 us]
} if (!t_relay_cancel()) { // Indeed a t_relay_cancel
2019-11-13T21:58:04.018647988Z 26(45) WARNING: <core> [core/action.c:1586]:
run_actions(): alert - action [t_relay (24)] cfg
[/etc/kamailio/kamailio.cfg:289] took too long [2739366 us]
t_relay(); // Indeed a t_relay
2019-11-13T21:58:04.018651243Z 15(34) WARNING: <core> [core/action.c:1586]:
run_actions(): alert - action [sl_send_reply (26)] cfg
[/etc/kamailio/kamailio.cfg:112] took too long [2587812 us]
sl_send_reply("100", "Trying"); // Indeed a sl_send_reply
Not sure which mailing list is best for this question
Regards
Julien