Re: [Asterisk-java-users] Wrong PJSIP_HEADER read
Brought to you by:
srt
|
From: Yves <yv...@gm...> - 2018-12-24 00:47:20
|
Hello Ahmed,
thanks for you valuable findings. To find out, whats going on, I´d like
to copy your setup; so, what versions are you using concerning
- OperatingSystem
- Asterisk
- Asterisk-Java
How do you "time" the Hangup so that it occurs between the two
getHeader-Methods... or do you delay the execution in between
to better simulate, whats going on, if this special case occurs?
regards,
Yves
Am 21.12.2018 um 01:08 schrieb Salahuddin Ahmed:
> Hello,
>
> Let's explain the issue,
> In our agi script has those following header read,
>
> AGI Code:
> =========================================
> String fromHeader = getHeaderValue("FROM");
> String paidHeader = getHeaderValue("P-ASSERTED-IDENTITY");
> String privacyHeader = getHeaderValue("PRIVACY");
> String toHeader = getHeaderValue("TO");
> =========================================
>
> 4573 port trace
> =========================================
> T 172.32.60.11:4573 <http://172.32.60.11:4573> -> 172.32.10.70:38630
> <http://172.32.10.70:38630> [AP]
> GET VARIABLE"PJSIP_HEADER(read,FROM)".
> #
> T 172.32.10.70:38630 <http://172.32.10.70:38630> -> 172.32.60.11:4573
> <http://172.32.60.11:4573> [AP]
> HANGUP.
> #
> T 172.32.60.11:4573 <http://172.32.60.11:4573> -> 172.32.10.70:38630
> <http://172.32.10.70:38630> [AP]
> GET VARIABLE "PJSIP_HEADER(read,P-ASSERTED-IDENTITY)".
> #
> T 172.32.10.70:38630 <http://172.32.10.70:38630> -> 172.32.60.11:4573
> <http://172.32.60.11:4573> [AP]
> 200 result=1 (<sip:12016615429@172.32.100.100
> <mailto:sip%3A12016615429@172.32.100.100>>;tag=1).
> #
> T 172.32.60.11:4573 <http://172.32.60.11:4573> -> 172.32.10.70:38630
> <http://172.32.10.70:38630> [AP]
> GET VARIABLE "PJSIP_HEADER(read,PRIVACY)".
> #
> ===========================================
>
> When a new call arrived those lines are executing, and during that
> execution, if caller canceled the call then a HANGUP message send from
> asterisk to asterisk-java. If asterisk-java waits for any response of
> one of those 4 requests then I think asteris-agi get confused and the
> all further response will be shifted. Now according to code if
> asterisk-java received a response without "200 result=1" format, it
> discards that response, but this response does not belong to that
> request. In the next read, the actual value will appear.
>
> Now in this scenario, what would be the solution? could anyone please
> suggest this?
>
> Thanks,
> Salah Ahmed
>
> On Tue, Dec 18, 2018 at 1:31 PM Salahuddin Ahmed <tx...@gm...
> <mailto:tx...@gm...>> wrote:
>
> Hello,
>
> Recently I have noticed an error in my service. After some
> investigation, we found that its due to some calls is terminated
> very early.
>
> The scenario is, If Caller-A sends an INVITE to Asterisk, This
> INVITE processed on an agi method. On that method, we read several
> sip custom and default sip header for our processing.
>
> But during this processing, if Caller-A sends CANCEL then some
> header value read get malformed. Actually, it seems it gets
> shifted, suppose if we read To header first and then cseq, TO
> header value set to cseq value and TO return NULL. We have added
> some debug log in asterisk code and found, asterisk return good
> value. The time between INVITE and CANCEL is 50 ms.
>
> We have implemented AGIHangupException in our agi method, but this
> exception does not catch by this CANCEL request.
>
> Any idea/solution is appreciated.
>
> Thanks in advance,
> Salah Ahmed
>
>
>
> _______________________________________________
> Asterisk-java-users mailing list
> Ast...@li...
> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users
|