X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=sip.cpp;h=075447cb347463dde39dffc74678b9fa8e089cb0;hp=640631b1097a7c08de1956227129b0b86763eede;hb=5566f74eb29be75da44e29ba72ee6f015249ce61;hpb=e233557e40043050c72b46d4b32b3a04cfd3d947 diff --git a/sip.cpp b/sip.cpp index 640631b..075447c 100644 --- a/sip.cpp +++ b/sip.cpp @@ -15,6 +15,14 @@ #include #include +#ifndef SOFIA_SIP_GCC_4_8_PATCH_APLLIED +#warning ******************************************************** +#warning Please apply the sofia-sip-gcc-4.8.patch ! +#warning If this issue is already fixed, just remove this check. +#warning ******************************************************** +#error +#endif + #undef NUTAG_AUTO100 unsigned char flip[256]; @@ -280,6 +288,8 @@ we only support alaw and ulaw! } while(n--) *to++ = flip[*from++]; + if (psip->p_dov_rx) + psip->dov_rx(payload, payload_len); psip->bridge_tx(payload, payload_len); return 0; @@ -600,7 +610,10 @@ int Psip::bridge_rx(unsigned char *data, int len) int ret; /* don't bridge, if tones are provided */ - if (p_tone_name[0]) + if (p_tone_name[0] || p_dov_tx) + return -EBUSY; + + if (p_dov_tx) return -EBUSY; if ((ret = Port::bridge_rx(data, len))) @@ -846,6 +859,12 @@ int Psip::message_connect(unsigned int epoint_id, int message_id, union paramete , inet_ntoa(ia), inet_ntoa(ia), p_s_rtp_port_local, payload_type, payload_type, media_type2name(media_type)); PDEBUG(DEBUG_SIP, "Using SDP response: %s\n", sdp_str); + /* NOTE: + * If this response causes corrupt messages, like SDP body inside or + * before header, check if the sofia-sip-gcc-4.8.patch was applied. + * If it is still corrupted, try to disable optimization when compiling + * sofia-sip. + */ nua_respond(p_s_handle, SIP_200_OK, NUTAG_MEDIA_ENABLE(0), SIPTAG_CONTENT_TYPE_STR("application/sdp"), @@ -2045,7 +2064,7 @@ void Psip::update_load(void) return; /* don't start timer if ... */ - if (!p_tone_name[0]) + if (!p_tone_name[0] && !p_dov_tx) return; p_s_next_tv_sec = 0; @@ -2057,7 +2076,7 @@ static int load_timer(struct lcr_timer *timer, void *instance, int index) class Psip *psip = (class Psip *)instance; /* stop timer if ... */ - if (!psip->p_tone_name[0]) + if (!psip->p_tone_name[0] && !psip->p_dov_tx) return 0; psip->load_tx(); @@ -2111,6 +2130,9 @@ void Psip::load_tx(void) /* copy tones */ if (p_tone_name[0]) { tosend -= read_audio(p, tosend); + } else + if (p_dov_tx) { + tosend -= dov_tx(p, tosend); } if (tosend) { PERROR("buffer is not completely filled\n");