Thanks! Thank you very very much for your help.

I’ll add the ngrep next time!

 

I’m absolutely new at kamailio and I’m doing the Subs on the main config file (/usr/local/etc/kamailio/kamailio.cfg) on the PSTN call detection route[PSTN] {:

 

if(!($rU=~"^(\+|00)[1-9][0-9]{3,20}$"))

                return;

                # only local users allowed to call

                if(from_uri!=myself) {

                               sl_send_reply("403", "Not Allowed");

                               exit;

                }

                if (strempty($sel(cfg_get.pstn.gw_port))) {

                               $ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip);

                } else {

                               $ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip) + ":"

                                                                              + $sel(cfg_get.pstn.gw_port);

                }

 

# modifications to acces env5

subst_uri('/^sip:00(.*)/sip:\1/i'); #append delete the 00

subst('/^Contact: (.*)>.*$/Contact: \1>/i');#delete the parameter that is anoying env5 on contact header

 

And I cannot find the msg_apply_changes(); part on that file, can you tell me where I can better do the subs, in which file?

 

I’m not actually moving the > just droping everything after it.

 

I’m sure there is a better option to change the contact header, would you have any suggestion?

 

Thanks in advanced

 

Helena

 

From: Daniel-Constantin Mierla [mailto:miconda@gmail.com]
Sent: jueves, 29 de agosto de 2013 15:49
To: Helena Garcia-Nieto; 'Kamailio (SER) - Users Mailing List'
Subject: Re: [SR-Users] Server silently droping Bye message.

 

ngrep output is preferred, because expanded wireshark has to much garbage around actuall sip message content. If you have the wireshark capture, then you can export pcap file and then use 'ngrep -qt -W byline -I file.pcap' to get pure text format for sip messages (then replace your ip addresses as needed).

Anyhow, for this case the problem resides in the contact header you send out. The alias parameter has to be before the '>' but your subst() moves the '>' after the initial contact uri, leaving the new parameter alias out of URI itself, resulting in being a header parameter.

One solution is to do subst() before record_route() in the config and after it execute:

msg_apply_changes();

Cheers,
Daniel

On 8/29/13 3:31 PM, Helena Garcia-Nieto wrote:

Sorry I thought I attached the complete trace, I captured it with wireshark on the server machine so I hope it is enough since you can see both sides.

 

Yes I realized the alias is added on the invite from the Kamailio to the PSTN GW:

 

Contact: <sip:AndroidAnumber@PrivateAndroidIP:35986;transport=tcp>;alias=PublicAndroidIP~35986~2

 

but it is not present on the BYE the PSTNGW send back to kamailio.

 

But kamailio has the information on the database, so I though it  may be able to send the message anyway.

 

Thanks

 

Helena

 



-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Trainings - Berlin, Oct 21-24; Miami, Nov 11-13, 2013
  - more details about Kamailio trainings at http://www.asipto.com -