[SR-Users] gcc warning for t_cancel

2015-10-27 Thread Yasin CANER

  
  
Hello;
      There is a gcc warning for t_cancel.c at 46 line.-centos 6.6
  -2.6.32-504.23.4.el6.x86_64
  
  
  t_cancel.c:46: warning: missing braces around initializer
  t_cancel.c:46: warning: (near initialization for
  â_cancel_reason_map[0]â)
  
  
  i changed code to  like below but couldn't fixed
  
  
  
  typedef struct cancel_reason_map {
      int code;
      str text;
  } cancel_reason_map_t;
  
  static cancel_reason_map_t _cancel_reason_map[] = {
      {200, str_init("Answered elsewhere")},
      {0, 0}
  };
  
  
  t_cancel.c:47: warning: missing braces around initializer
  t_cancel.c:47: warning: (near initialization for
  â_cancel_reason_map[1].textâ)
  

-- 
  
  
  

  

  

  

  

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Routing outgoing call from asterisk to registered SIP provider

2015-10-27 Thread Bruno Salzano
Hello,
i've DID provider that require to register to it's server. I've been able
to configure this provider using kamailio and uac and to route all inbound
calls from DID provider to internal asterisk media server. All is working
great.

Now i need help to configure call routing from internal asterisk to the
external DID provider.

I've done something like:

route[LOCATION] {
if(is_method("INVITE")) {
route(FROMASTERISK);
route(TOASTERISK);
exit;
}
[...]
}

route[FROMASTERISK] {
if (ds_is_from_list()) {
xlog("L_INFO","[$fU@$si:$sp]{$rm} {$ru} Call from Media-Server Cluster\n");
rtpengine_manage("direction=internal direction=external replace-origin
replace-session-connection trust-address");
$ru = "sip:TESTING_NUMBER@EXTERNAL_PROVIDER_IP";
route(RELAY);
exit;
}
}

It seems that when i route the call outbound, i get a 407. So i would like
to react to this using uac_auth() as described here:
http://kamailio.org/docs/modules/4.3.x/modules/uac.html#uac.f.uac_auth()

Is this the right way? Can someone help me, giving hints and some working
example?

Using kamailio 4.3.3 with rtpengine 4.1.0

Best regards,
Bruno
-- 
The life is short.. live at your best!
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Problems with dispatcher module | feature disabled

2015-10-27 Thread Alessio Casco
Hello!

We noticed today an issue with the kamailio loadbalancing.

Basically kamailio is not considering if an host is up or not, backends are
set always as "FLAGS: AP" even if the host is down.

I see this when the proxy starts :

ERROR: dispatcher [dispatcher.c:768]: ds_warn_fixup(): failover functions
used, but required AVP parameters are NULL -- feature disabled

These the parameters I have set:

# - dispatcher params -
modparam("dispatcher", "list_file", "/etc/kamailio/dispatcher.list")
modparam("dispatcher", "dst_avp", "$avp(dsdst)")
modparam("dispatcher", "grp_avp", "$avp(dsgrp)")
modparam("dispatcher", "cnt_avp", "$avp(dscnt)")
modparam("dispatcher", "ds_ping_method", "OPTIONS")
modparam("dispatcher", "ds_ping_reply_codes", "class=2;class=3;code=404")
modparam("dispatcher", "ds_ping_from", "sip:pr...@sip.nexmo.com")
modparam("dispatcher", "ds_ping_interval", 20)
modparam("dispatcher", "ds_probing_threshold", 1)
modparam("dispatcher", "ds_probing_mode", 1)
modparam("dispatcher", "ds_hash_size", 10)
modparam("dispatcher", "ds_hash_expire", 3600)
modparam("dispatcher", "ds_hash_initexpire", 60)
modparam("dispatcher", "ds_hash_check_interval", 10)
modparam("dispatcher", "use_default", 0)
modparam("dispatcher", "attrs_pvname", "$avp(carrierattr)")
modparam("dispatcher", "setid_pvname", "$avp(carriergroup)")
modparam("dispatcher", "flags", 2)

I use 4.3.3, I think this issue started after upgrading from 4.3.1 but I
can't say for sure.

Can someone please give us some advices on this?

Thanks
Alessio
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] sqlite errors

2015-10-27 Thread Timo Teras
On Mon, 26 Oct 2015 19:43:52 +0100
nadie  wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Hello, sorry for the question. Kamailio 4.3.3, debian Jessie:
> 
> Kamailio with sqlite all work correctly
> 
> but syslog tells:
> ...
> Oct 26 19:36:01 voip /usr/sbin/kamailio[2643]: ERROR: db_sqlite
> [dbase.c:489]: db_sqlite_commit(): sqlite commit failed: attempt to
> write a readonly database

This sums it up. Trying to write to read-only db.

Check that the file permissions so that kamailio user/group can write
to it. And that the filesystem is mounted read/write.

/Timo


pgpSVOY8Qwkad.pgp
Description: OpenPGP digital signature
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] gcc warning for t_cancel

2015-10-27 Thread Daniel-Constantin Mierla
Hello,

thanks, I push a patch for it, can you try with latest master branch and
report if you compiler is happy now?

I wonder why clang never reported the warning for this situation.

Cheers,
Daniel

On 27/10/15 09:03, Yasin CANER wrote:
> Hello;
> There is a gcc warning for t_cancel.c at 46 line.-centos 6.6
> -2.6.32-504.23.4.el6.x86_64
>
>
> t_cancel.c:46: warning: missing braces around initializer
> t_cancel.c:46: warning: (near initialization for â_cancel_reason_map[0]â)
>
>
> i changed code to  like below but couldn't fixed
>
>
> 
> typedef struct cancel_reason_map {
> int code;
> str text;
> } cancel_reason_map_t;
>
> static cancel_reason_map_t _cancel_reason_map[] = {
> {200, str_init("Answered elsewhere")},
> {0, 0}
> };
> 
>
> t_cancel.c:47: warning: missing braces around initializer
> t_cancel.c:47: warning: (near initialization for
> â_cancel_reason_map[1].textâ)
>
> -- 
> 
>
>
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Book: SIP Routing With Kamailio - http://www.asipto.com
Kamailio Advanced Training, Nov 30-Dec 2, Berlin - http://asipto.com/kat

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Routing outgoing call from asterisk to registered SIP provider

2015-10-27 Thread Daniel Tryba
On Tuesday 27 October 2015 07:36:15 Bruno Salzano wrote:
> It seems that when i route the call outbound, i get a 407. So i would like
> to react to this using uac_auth() as described here:
> http://kamailio.org/docs/modules/4.3.x/modules/uac.html#uac.f.uac_auth()
> 
> Is this the right way? Can someone help me, giving hints and some working
> example?

Based on the info you have given I'd say this is correct. The working code is 
in the URL you provide. Adding a specific failure route in the FROMASTERISK 
when ds_is_from_list matches to the uac_auth() function is the way to go.


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] dmq_usrloc for writing to DB on one machine

2015-10-27 Thread Sebastian Damm
Hi,

when inspecting dmq a bit further, I found that in fact there is an
autodiscovery built in. When I told registrar 1 and registrar 2 to send to
receiver, and told receiver to only send to itself, everything worked.
Until the receiver went offline. Then it got disabled by the registrars and
no packets got replicated anymore after it came back online until the
registrars were restarted, too.

Since we don't want this situation, I told the receiver to send to a dns
record containing all registrars. This way, after the receiver came back
up, the registrars got notified and started replicating their usrloc again.
But they didn't send to the receiver only, but also to the other registrar.

Since we have quite an amount of registration traffic on the registrars
(and actually there are more than two of them), we don't want to send this
traffic multiple times through our network.

Is there any way we can force the dmq module to send only to the configured
receiver?

Best Regards,
Sebastian
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] gcc warning for t_cancel

2015-10-27 Thread ycaner
Hello Daniel.
it is ok , there is no warning about it
Thanks.



--
View this message in context: 
http://sip-router.1086192.n5.nabble.com/gcc-warning-for-t-cancel-tp142621p142633.html
Sent from the Users mailing list archive at Nabble.com.

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Routing outgoing call from asterisk to registered SIP provider

2015-10-27 Thread Bruno Salzano
Thank you. I'll try and let you know.

Bruno

2015-10-27 11:41 GMT+01:00 Daniel Tryba :

> On Tuesday 27 October 2015 07:36:15 Bruno Salzano wrote:
> > It seems that when i route the call outbound, i get a 407. So i would
> like
> > to react to this using uac_auth() as described here:
> > http://kamailio.org/docs/modules/4.3.x/modules/uac.html#uac.f.uac_auth()
> >
> > Is this the right way? Can someone help me, giving hints and some working
> > example?
>
> Based on the info you have given I'd say this is correct. The working code
> is
> in the URL you provide. Adding a specific failure route in the FROMASTERISK
> when ds_is_from_list matches to the uac_auth() function is the way to go.
>
>
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>



-- 
The life is short.. live at your best!
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Routing between 2 domains

2015-10-27 Thread kai.ohnacker
Hello Daniel (and of course the whole community :)),

thanks for the reply. Now it works in most cases.
But I have one SIP client which handles the SIP communication very accurate and 
this client is actual internal registered. If I make a call from an external 
client to this internal client the following error is coming.
Error message: INVITE message: Remote host '193.16.163.58' is not matching with 
configured register server '203.207.111.58' or proxy server
And no call is possible.
If I change this special client with another SIP client it  works, but I can 
see in the debugging information that the SIP server is not routing in the 
desired way.
In the INVITE message the URI is not with the URI from the internal network 
(debugging information below) and this is the reason the special client is 
responding with "Error message". In the SDP the URI IP address is correct.
My question is: Is it possible to change the URI in the To header to the right 
domain?


Cheers,
Kai Ohnacker



My setting is:
Kamailio with two interfaces in two domains.
Internal: 203.207.111.58
External: 193.16.163.58

My config:
Route{
 if(is_method("REGISTER")) {
if(dst_ip==203.207.111.58){
setbflag(20);
}else{
setbflag(21);
}
}
}

And
Route [NATMANAGE]

if(dst_ip==203.207.111.58 && isbflagset(20)){
rtpproxy_manage("coii");
}else if(dst_ip==203.207.111.58 && isbflagset(21)){
rtpproxy_manage("coie");
}else if(dst_ip==193.16.163.58 && isbflagset(20)){
rtpproxy_manage("corei");
}else if(dst_ip==193.16.163.58 && isbflagset(21)){
rtpproxy_manage("coee");
}



Debugging information at the destination client (internal):

INVITE sip:8000@10.99.217.42:5060 SIP/2.0
Record-Route: 
Record-Route: 
Via: SIP/2.0/UDP 
203.207.111.58;branch=z9hG4bK9ed6.83de5667d5ceb951adb58a0f7d6909cd.0
Via: SIP/2.0/UDP 
193.16.163.39:38771;rport=44934;branch=z9hG4bK802b882b077be511bce30c32c5410478
From: "PhonerLite" ;tag=2462361638
To: sip:8000@193.16.163.58 <- this URI IP is wrong. It should be 
8000@203.207.111.58
Call-ID: 802B882B-077B-E511-BCE1-0C32C5410478@172.16.216.174
CSeq: 37 INVITE
Contact: 
Allow: INVITE, OPTIONS, ACK, BYE, CANCEL, INFO, NOTIFY, MESSAGE, UPDATE
Max-Forwards: 69
Supported: 100rel, replaces, from-change
P-Early-Media: supported
User-Agent: SIPPER for PhonerLite
P-Preferred-Identity: 
Content-Type: application/sdp
Content-Length: 331

v=0
o=- 618137597 1 IN IP4 203.207.111.58
s=SIPPER for PhonerLite
c=IN IP4 203.207.111.58
t=0 0
m=audio 20038 RTP/AVP 9 8 0 107 101
a=rtpmap:9 G722/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:107 opus/48000/2
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ssrc:636280517
a=sendrecv
a=nortpproxy:yes


---
11:57:25,299: T: 203.207.111.58:5060 (UDP)
SIP/2.0 200 OK
Via: SIP/2.0/UDP 
203.207.111.58;branch=z9hG4bK9ed6.83de5667d5ceb951adb58a0f7d6909cd.0
Via: SIP/2.0/UDP 
193.16.163.39:38771;rport=44934;branch=z9hG4bK802b882b077be511bce30c32c5410478
Record-Route: 
Record-Route: 
From: "PhonerLite" ;tag=2462361638
To: ;tag=802b882b077be511b35b430b8303a094
Call-ID: 802B882B-077B-E511-BCE1-0C32C5410478@172.16.216.174
CSeq: 37 INVITE
Contact: 
Content-Type: application/sdp
Allow: INVITE, OPTIONS, ACK, BYE, CANCEL, INFO, NOTIFY, MESSAGE, UPDATE
Supported: replaces, from-change
Server: SIPPER for PhonerLite
Content-Length:   309

v=0
o=- 2073314527 1 IN IP4 10.99.217.42 <- client specific IP address
s=SIPPER for PhonerLite
c=IN IP4 10.99.217.42
t=0 0
m=audio 5062 RTP/AVP 8 107 0 9 101
a=rtpmap:9 G722/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:107 opus/48000/2
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ssrc:906481595
a=sendrecv


Von: Daniel-Constantin Mierla [mailto:mico...@gmail.com]
Gesendet: Mittwoch, 21. Oktober 2015 12:57
An: Ohnacker, Kai [CBC] ; sr-users@lists.sip-router.org
Betreff: Re: AW: [SR-Users] Routing between 2 domains

Hello,

I spotted at least one issue: you set the branch flag (with setbflag()) but 
then you test message/transaction flags with isflagset() -- to test branch 
flags you have to use isbflagset().

Cheers,
Daniel
On 21/10/15 11:42, kai.ohnac...@cbc.de wrote:
Hello Daniel,

thanks for the reply. I try out your suggestion, but this is not working. There 
is no sound transmitted and the connection ended after 23 seconds (I think a 
timer is expired).
Scenario is:
Kamailio route all internal calls only internal (external vice versa)
Kamailio route all internal to external through rtpproxy (also vice versa)

INT_IP: 203.207.111.58
EXT_IP: 193.16.163.58

Here my code:
request_route {
if(is_method("REGISTER")) {
if(dst_ip==203.207.111.58){
setbflag(20);
}else{
setbflag(21

Re: [SR-Users] Routing outgoing call from asterisk to registered SIP provider

2015-10-27 Thread Infinicalls Infinicalls
> It seems that when i route the call outbound, i get a 407. So i would like
> to react to this using uac_auth() as described here:
> http://kamailio.org/docs/modules/4.3.x/modules/uac.html#uac.f.uac_auth()
>
> Is this the right way? Can someone help me, giving hints and some working
> example?

Using uac_auth() is the perfect way to send calls to external
provider, if you want to authorise the user. If your provider provides
IP based auth, you don't need uac_auth() and you can simply terminate
using the PSTN gw.

I am not if this answers your question fully,. I myself a newbie here.
Tried and got a code working both for PSTN with/without uac_auth.

regards
Ganesh Kumar

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] gcc warning for t_cancel

2015-10-27 Thread Daniel-Constantin Mierla
Hello, ok, thank for reporting back!

Daniel

On 27/10/15 12:26, ycaner wrote:
> Hello Daniel.
> it is ok , there is no warning about it
> Thanks.
>
>
>
> --
> View this message in context: 
> http://sip-router.1086192.n5.nabble.com/gcc-warning-for-t-cancel-tp142621p142633.html
> Sent from the Users mailing list archive at Nabble.com.
>
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Book: SIP Routing With Kamailio - http://www.asipto.com
Kamailio Advanced Training, Nov 30-Dec 2, Berlin - http://asipto.com/kat


___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Problems with dispatcher module | feature disabled

2015-10-27 Thread Daniel-Constantin Mierla
Hello,

it looks like sock_avp parameter has to be set -- it is there before
4.3.0 release, as I could spot in 'git blame' for dispatcher.c:768.

Not sure is really needed for failover, I will check its usage when I
get first chance.

http://kamailio.org/docs/modules/stable/modules/dispatcher.html#dispatcher.p.sock_avp

Cheers,
DAniel

On 26/10/15 17:00, Alessio Casco wrote:
>
> Hello!
>
> We noticed today an issue with the kamailio loadbalancing.
>
> Basically kamailio is not considering if an host is up or not,
> backends are set always as "FLAGS: AP" even if the host is down.
>
> I see this when the proxy starts :
>
> ERROR: dispatcher [dispatcher.c:768]: ds_warn_fixup(): failover
> functions used, but required AVP parameters are NULL -- feature disabled
>
> These the parameters I have set:
>
> # - dispatcher params -
> modparam("dispatcher", "list_file", "/etc/kamailio/dispatcher.list")
> modparam("dispatcher", "dst_avp", "$avp(dsdst)")
> modparam("dispatcher", "grp_avp", "$avp(dsgrp)")
> modparam("dispatcher", "cnt_avp", "$avp(dscnt)")
> modparam("dispatcher", "ds_ping_method", "OPTIONS")
> modparam("dispatcher", "ds_ping_reply_codes", "class=2;class=3;code=404")
> modparam("dispatcher", "ds_ping_from", "sip:pr...@sip.nexmo.com
> ")
> modparam("dispatcher", "ds_ping_interval", 20)
> modparam("dispatcher", "ds_probing_threshold", 1)
> modparam("dispatcher", "ds_probing_mode", 1)
> modparam("dispatcher", "ds_hash_size", 10)
> modparam("dispatcher", "ds_hash_expire", 3600)
> modparam("dispatcher", "ds_hash_initexpire", 60)
> modparam("dispatcher", "ds_hash_check_interval", 10)
> modparam("dispatcher", "use_default", 0)
> modparam("dispatcher", "attrs_pvname", "$avp(carrierattr)")
> modparam("dispatcher", "setid_pvname", "$avp(carriergroup)")
> modparam("dispatcher", "flags", 2)
>
> I use 4.3.3, I think this issue started after upgrading from 4.3.1 but
> I can't say for sure.
>
> Can someone please give us some advices on this?
>
> Thanks
> Alessio
>
>
>
> ___
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users@lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Book: SIP Routing With Kamailio - http://www.asipto.com
Kamailio Advanced Training, Nov 30-Dec 2, Berlin - http://asipto.com/kat

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Routing outgoing call from asterisk to registered SIP provider

2015-10-27 Thread Bruno Salzano

Hello Daniel,

Il 27/10/15 11:41, Daniel Tryba ha scritto:

On Tuesday 27 October 2015 07:36:15 Bruno Salzano wrote:

It seems that when i route the call outbound, i get a 407. So i would like
to react to this using uac_auth() as described here:
http://kamailio.org/docs/modules/4.3.x/modules/uac.html#uac.f.uac_auth()

Is this the right way? Can someone help me, giving hints and some working
example?

Based on the info you have given I'd say this is correct. The working code is
in the URL you provide. Adding a specific failure route in the FROMASTERISK
when ds_is_from_list matches to the uac_auth() function is the way to go.
I got it working. It required me to enable the track_cseq_updates in 
dialog module and use uac_auth(). Actually my config is the following:


route[FROMASTERISK] {
if (ds_is_from_list()) {
xlog("L_INFO","[$fU@$si:$sp]{$rm} {$ru} Call from Media-Server 
Cluster\n");
rtpengine_manage("direction=internal direction=external 
replace-origin replace-session-connection trust-address");

uac_replace_from("", "sip:NUMBER@HOST");
route(RELAY);
exit;
}
}


failure_route[TRUNKAUTH] {
xlog("L_INFO","TRUNKAUTH FAILURE ROUTE");
if (t_is_canceled()) {
exit;
}
if(t_check_status("401|407")) {
xlog("L_INFO", "Got 401/407 sending uac_auth() and t_relay()");
$avp(auser) = "USERNAME";
$avp(apass) = "SECRET";
$avp(arealm) = "REALM";
uac_auth();
t_relay();
exit;
}
}

Now I've just last question on this topic: what's the best way to 
replace credentials (USERNAME, SECRET, REALM) from db?

I've to manage also the uac_replace_from.
What I want is to avoid to change the configuration everytime a new 
trunk is added.


Best Regards,
Bruno



___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users




___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users