Hello

 

I used the set_body function

 

Content-Length: 192.

Content-Type: Content-Type: application/sdp.

Server: Belcenter SIP Voice Gateway.

.

v=0.

o=XX 10 10 IN IP4 192.168.1.1.

s=XX.

c=IN IP4 192.168.1.1.

t=0 0.

m=audio 0 RTP/AVP 8 101.

a=rtpmap:8 PCMA/8000.

a=rtpmap:101 telephone-event/8000.

a=fmtp:101 0-15.

a=sendrecv.

a=ptime:20

 

still not engaged L

 

 

---------------------

        $var(body)="v=0\r\no=XX 10 10 IN IP4 192.168.1.1\r\ns=XX\r\nc=IN IP4 192.168.1.1\r\nt=0 0\r\nm=audio 0 RTP/AVP 8 101";

        $var(body2)="a=rtpmap:8 PCMA/8000\r\na=rtpmap:101 telephone-event/8000\r\na=fmtp:101 0-15\r\na=sendrecv\r\na=ptime:20";

       set_body("$var(body)\r\n$var(body2)", "Content-Type: application/sdp");

 

        msg_apply_changes();

 

        rtpproxy_manage("corbf");

 

De : Daniel-Constantin Mierla [mailto:miconda@gmail.com]
Envoyé : jeudi 27 juillet 2017 13:35
À : Nicolas Breuer <Nicolas.Breuer@belcenter.biz>; Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org>
Objet : Re: [SR-Users] Add SDP Body

 

Hello,

there is a dedicated function to set the body, do not use append_hf(), because kamailio doesn't detect there is a change of the body and content length is 0.

Cheers,
Daniel

On 27.07.17 13:25, Nicolas Breuer wrote:

Hello Daniel,

 

I added this

 

if (status=~"[1][8][0-3]"){

        setflag(22);

        if (is_method("INVITE")) {

        xlog("L_NOTICE", " No SDP");

        append_hf("Content-Type: application/sdp\r\n");

        append_hf("\r\n");

        append_hf("v=0\r\n");

        append_hf("o=XX 10 10 IN IP4    217.112.180.9\r\n");

        append_hf("s=XX \r\n");

        append_hf("c=IN IP4 217.121.180.9\r\n");

        append_hf("t=0 0\r\n");

        append_hf("m=audio 0 RTP/AVP 8 101\r\n");

        append_hf("a=rtpmap:8 PCMA/8000\r\n");

        append_hf("a=rtpmap:101 telephone-event/8000\r\n");

        append_hf("a=fmtp:101 0-15\r\n");

        append_hf("a=sendrecv\r\n");

        append_hf("a=ptime:20\r\n");

        msg_apply_changes();

 

        rtpproxy_manage("corbf");

 

        #rtpproxy_stream2uac("/root/wait.wav", "-1");

 

        }

 

 

Seems that proxy was not engaged. -> The port is not altered..

Trace :

 

Allow: INVITE,ACK,CANCEL,BYE,REGISTER,REFER,INFO,SUBSCRIBE,NOTIFY,PRACK,UPDATE,OPTIONS,MESSAGE,PUBLISH.

Content-Length: 0.

Content-Type: application/sdp.

Server: Belcenter SIP Voice Gateway.

.

v=0.

o=XX 10 10 IN IP4 217.112.180.9.

s=XX .

c=IN IP4 217.121.180.9.

t=0 0.

m=audio 0 RTP/AVP 8 101.

a=rtpmap:8 PCMA/8000.

a=rtpmap:101 telephone-event/8000.

a=fmtp:101 0-15.

a=sendrecv.

a=ptime:20.

.

 

 

 

De : Daniel-Constantin Mierla [mailto:miconda@gmail.com]
Envoyé : jeudi 27 juillet 2017 11:41
À : Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org>; Nicolas Breuer <Nicolas.Breuer@belcenter.biz>
Objet : Re: [SR-Users] Add SDP Body

 

Hello,

 

On 27.07.17 09:57, Nicolas Breuer wrote:

Hello,

 

I’m trying to add a SDP Body on 183 replies.

 

From some carriers I don’t get any SDP.

The goal is to add SDP , Engage PROXY & stream2uac on all 183 packets without SDP

 

Do you think it’s possible ? J

 

it may be possible, if you try to combine adding content-type header and the sdp body, then use msg_apply_changes() inside reply_route{}. Later engage the rtpproxy. However, if you don't know the codecs of caller/callee, it may end in a mismatch.

Just dropping such 183 is not ok? If not, what about turning 183 in an 180? Or setting an SDP with media IP 0.0.0.0 (old on hold style)?

Cheers,
Daniel


-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - www.asipto.com
Kamailio World Conference - www.kamailioworld.com



-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - www.asipto.com
Kamailio World Conference - www.kamailioworld.com